text stringlengths 0 1.49k |
|---|
**Marc-Antoine Ruel:** Yeah. Actually, the 1-Wire hasn't been written by me at all. Thorsten wrote it. Gosh, I forget his full name... [Thorsten von Eicken](https://github.com/tve). He contributed a lot to the project. He was the one that did all of the 1-Wire codes. He started with the device that is connected over I2... |
He also wrote -- well, he actually designed the Periph-tester board. Basically, it's a board that has eeprom, and the device that exposes 1-Wire. Basically, you can test eeprom over SPI if I recall correctly and eeprom over 1-Wire. This way we can make sure that all of these protocols are not broken by any kind of chan... |
\[20:03\] It's really awesome. It's being tested continuously. Basically, every time there's a change pushed, the smoke tests are tested on this port. |
**Erik St. Martin:** That's awesome. I think we are a little overtime for our first sponsored break, so let's take that, and then I wanna talk to you a little bit about some of that performance stuff. I know we chatted behind the scenes a little bit about some of the performance differences, like using this for doing t... |
**Marc-Antoine Ruel:** Perfect. |
**Erik St. Martin:** So our first sponsor for today is Toptal. |
**Break:** \[20:34\] |
**Erik St. Martin:** Alright, and we are back, talking to Marc-Antoine. Just before the break I wanted to hear -- we were talking about the performance differences, and we had talked a little bit about how you have the DMA (direct memory access) support, and you had done some things for performance of bit-banging. |
**Marc-Antoine Ruel:** It's still a work in progress, it's not fully live yet. What I realized is -- and that's actually one of the reasons I've decided to go with this project - there's already C projects that do bit-banging \[unintelligible 00:21:41.16\] abusing the DMA controller (I think it's a better word) in user... |
Basically, it works in C; there's Python bindings, which is [RPi.GPIO](https://pypi.org/project/RPi.GPIO/) I forgot the exact name, but it's for a popular library. And I basically said "Well, let's do one in Go, so that there's no other need for requiring any C libraries to do that. |
So I started playing with that, and then I realized if I wanted to do this kind of stuff, I need to do it in a way that works on multiple CPUs. So then I started working on the [Allwinner](https://en.wikipedia.org/wiki/Allwinner_Technology) CPUs. I have a few boards based on Allwinner CPUs, and I started looking at it.... |
Someone on the IRC channel on freenode helped me with that, because otherwise I would have never figured it out. I forget the name of the person, but thanks a lot. |
On the other processors, for example like the [BeagleBone](https://beagleboard.org/bone), it could be possible, I just didn't get to that point yet. Basically, the idea there is really just that you can do bit-banging, and I've done it by the DMA controller, or the reverse is to basically have your own logic analyzer t... |
\[24:08\] On the other hand, because it's using memory map GPIO registers, you can actually read through really fast and basically you can abuse the system by taking a full core, and have this full core just doing a busy loop of reading a register, then you just append that to a circular buffer. Then another core can j... |
**Erik St. Martin:** I know a lot of our listeners too probably aren't all hardware people, so maybe we can talk a little bit about what DMA is and why you would wanna use that. |
**Marc-Antoine Ruel:** Yeah, sorry about that... \[laughs\] That's a good point. DMA means Direct Memory Access. It's kind of a small controller inside of your CPU; well, aside, but mostly in the chip. It can do bit shoveling, basically. It can copy memory from one page to another on the BF of the CPU. One of the big u... |
So it really helps, because then you can do these, which takes time, but without incurring any cost on the CPU side. It's very important on single core systems. For example, if you take a Raspberry Pi Zero W, you only have a single core, so in that case you really need to free up as much as you can... So that's one way... |
**Brian Ketelsen:** Now, while we were talking here I installed Periph.io on the Raspberry Pi that's running my barbecue grill right now, and on that particular board we've got pin 22 that controls the relay the turns the fan on and off, while the blower controls the temperature of the barbecue grill. And I just set th... |
There's three commands that are shipped with Periph.io. There's `periph-info`, which I pasted the output of that into the Slack channel, and then there's `headers-list`, and then there's `gpio-list`. All of them worked beautifully on the Raspberry Pi that I have. That's really cool. |
**Marc-Antoine Ruel:** Yeah, actually there's even more than that. Let me paste that on the channel. One of the first ways that I decided to test devices was to write one executable per device driver. So you are not required to use them, but it's a nice way to figure out how to start your application, basically. So if ... |
\[28:13\] Most of them are really meant to make sure that your device works well. They are not necessarily exposing a lot of functionality, but enough to be able to get by. The GPIO ones are really useful and you just want to do a quick switch of value, just reading quickly. It's pretty nice. |
**Brian Ketelsen:** That's awesome. |
**Erik St. Martin:** I think you had mentioned too that you had been playing with the [PocketCHIP](https://en.wikipedia.org/wiki/CHIP_(computer)#Pocket_CHIP_and_Pockulus), too. |
**Marc-Antoine Ruel:** Yeah, the pocketCHIP is kind of neat. It's a very low-power single core system, with half a gig of RAM. It runs a custom distribution that is based on Debian, and it actually exposes I2C, SPI and a few GPIO on the top of it. Actually, my goal has been to expose the -- basically, you can connect a... |
You can actually build on it, so I literally just start up `vi` and edit my code and build my Go projects on it... So it's a pretty nice device for that. |
**Erik St. Martin:** Do you prefer it over a Pi? |
**Marc-Antoine Ruel:** Well, it's different, because the chip is much cheaper than the Pi. It has Wi-Fi, which I think it got announced before the Raspberry Pi 3 which had Wi-Fi. So it's a different market. |
The Pi is incredibly faster, but on the other hand you have to buy an SD card, while the chip already has 4 gigs of flash on board. Because of that, the total cost of the chip is much lower. And the fact that it has a battery connector included is also a plus. It's very easy to run it on a Lithium battery, and it can c... |
So for embedded stuff -- not embedded stuff, but for stuff to be carried on, it's very nice. It's something I really like a lot. One thing I wanted to backtrack is when I started the project on Periph I wasn't sure actually if I were going to do it or not. Thorsten von Eicken, which I referenced earlier - he reached ou... |
\[32:03\] I decided to make it private for a long time, because I really wanted to refactor the hell out of it. Basically, when you have a project and you have no users, you cannot break anyone, so that's the best thing ever, because nobody's complaining if they are not using it. But the problem is that eventually we w... |
Eventually, I got the pressure to actually release it, because eventually I just wanted to have something -- people wanted to use it, but at the same time I still feel that it's not... I feel right now that it's not good enough in the design and I really want to change a lot of features. For example the SPI driver I'm ... |
**Brian Ketelsen:** So you mentioned a [gohci](https://github.com/periph/gohci) - is that a CI system that you've built specifically for this package? Can you describe how that works? |
**Marc-Antoine Ruel:** Yeah, so the gohci is basically my CI system for the cheaps... For the cheap people. \[laughter\] Basically, what happens is that I was at the point where I had to decide if I would pursue that as a project or just leave it there, and it works and it's fine. I really felt that if I wanted it to b... |
So I worked on the quality of the code with a gohci. Basically, it's really a cheap hack. It runs a service... Basically, I started via SystemD, and it exposed a web server, which basically you would trigger GitHub webhooks, and when there's one that's based on the pull request it decides to do a testrun based on the c... |
The other thing is that I didn't want to pay for a server, because I'm super cheap, so what I decided to say is well, actually on GitHub you can save a Gist, and it's actually free, and you can save multiple files inside a Gist. It could be just the STDOUT out of the commands being run. So I started playing with this i... |
The nice thing with it is that every time there's a commit, it will run, but the tests are specific to the hardware it's running on. For example, if the board running gohci as a tester board, it will run the smoke test related to that. Otherwise, I can run the GPIO smoke test to make sure that edge triggering is good, ... |
\[36:10\] They're still unit tests, and the unit tests are run on Travis, and it works great, but sometimes you're testing also the operating system underneath, and the hardware itself. I really wanted to have a distinction between the hardware testing and the unit testing, and it's kind of the side effect of my work, ... |
Chrome is a really large project and there's a lot of unit tests and a lot of smoke tests, too. The current scale at which Chrome runs is pretty intense. There's over 200 commits per day, and a single test can represent up to around 30 hours of tests for a single commit. So the scale at which it runs is very high, and ... |
**Brian Ketelsen:** That sounds amazing. It sounds like it would be a really good blog post. |
**Marc-Antoine Ruel:** Yes, I should. I'm really not good at writing blog posts... Which brings me to the website - I had a lot of pain to create the website, and one of the funny things is that I realized that there was the freebie Google Cloud VMs that you could get - the very cheapest one, which acts like a fifth of... |
So basically what I said was "You know what? If it can run Docker, it can run Caddy." My idea was "Let's see..." and basically what I did is I fired up a VM, I looked at all the paths that were mounted as executable and I just SCPed Caddy there and tried to run it, and... I've used it! It worked because of Go's static ... |
But writing the website -- because I knew that the website was very important and that documentation mattered, but at the same time I'm not that good at writing documentation, so a lot of iteration went on that before making the project public. One of the nice things is that I asked my daughter to draw the mascot, and ... |
**Erik St. Martin:** Yeah, that thing is adorable. |
**Marc-Antoine Ruel:** Yeah, it is. |
**Erik St. Martin:** It's got its little wired up backpack and the LED... |
**Marc-Antoine Ruel:** \[40:08\] \[laughs\] Yeah... Another thing that I did was doing outreach to people. One of the first persons I tried to talk to was Jana -- actually, I kept contact with her for pretty much the whole cycle. I also discussed with [Ron](https://twitter.com/deadprogram), the maintainer of Gobot; he'... |
As I've said before, most of the devices I wrote were really just to test the underlying code for the host operating system drivers. I tried to position the library as much as low-level that would fit under Gobot. That said, it's not a given that there's a way to make everything work as much as I'd like, but that's def... |
As I wrote in the web page, as an enabler, to be able to access as much functionality as it's exposed by the operating system. I'm hopeful that we'll continue working together. |
One thing, actually - I'm trying to make work gohci with pull request better, and I'll probably fire up the first Gobot worker there. If that works well, it's going to be great. |
**Brian Ketelsen:** That's really cool, I'd love to see these two projects work together more, if possible. Gobot is a great project, and Periph.io looks pretty darn amazing to me. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.