Jonathan: This is Floss Weekly, episode 783, recorded Wednesday, May 15th. Teaching Embedded with the UnPhone.
Hey, this week Rob Campbell joins me and we talk with Gareth Coleman and Hamish Cunningham about the UnPhone. That's a piece of hardware designed specifically for teaching computer science students about the world of embedded firmware. It's a lot of fun, it's open source, you don't want to miss it, so stay tuned.
Hey folks, welcome to Floss Weekly. That's the show about free Libre and open source software. I'm your host, Jonathan Bennett. It is good to have everybody here and we've got a, we've got a neat show for everyone today. Now we've got a co host and it's Rob. Hey Rob.
Rob: Hello. Always exciting to be here.
Jonathan: Yes. I appreciate you stepping in and this is, it's kind of right up your alley.
I don't know. Honestly, I don't know how much Rob does with Floss Weekly. electronics fiddling, but I know you've done some teaching and that's kind of an interesting tie into what we're talking about today.
Rob: Yeah, I've, I've done a little bit of university teaching and I'm not sure if this, how, how this will fit in exactly with that.
We'll find out. And as far as tinkering with hardware, I, I, I don't do as much as I used to. It's all about time, but I love to get into it more again.
Jonathan: Yeah, well, this is a, this is a project that might pull you back in. It might actually be useful when it comes to teaching too. So we're talking about the UnPhone, which is a it's a little electronic device that is, it's open and it's, I think it's based on the ESP 32.
We will ask, we'll find out. I don't know all of these details. It's got a Laura radio in it, and it is all about. Being able to get students, I think, I think university students kind of into the, the, the realm of writing firmware and working on these little embedded devices. So let's not waste any more time.
We've actually got, we've got Hamish Cunningham and Gareth Coleman to chat about it, to give us the details. And so let's go ahead and bring them on. Hey guys, welcome to the show. Hey. Hey, how are you doing
Hamish: us?
Jonathan: Yeah, so I have, I have worked, I've worked directly with Hamish just a little bit on bringing Meshtastic to this device.
But other than that, I don't, I don't actually know a whole lot about it. So let's, let's start, let's start with this. We'll actually start with Gareth and we'll go to Hamish. So Gareth. First off, tell me, like, what, how do you fit into the project? And then we'll kind of let Hamish answer the same question.
And I think in answering that we'll also get sort of a 30, 000 foot view of what the project is.
Gareth: Well I suppose I helped with the electronics design of the on phone and the software and the course was more Hamish's responsibility. Although we do occasionally help each other out to the best of our abilities, which in my case is a little bit limited, but yeah.
I I know a bit about firmware programming, but, um, the other more complicated things often elude me. So yeah I helped with the hardware design, and then, you know, revising it and, and testing it, and, and also helping support the students. using it as part of their course.
Hamish: Actually Gareth is far too modest and he did all the hard bits and I get all the credit, which is basically how you want life to work as an academic.
That if it's, if it's going really well, that's, and that's the sort of arrangement you, you end up with. So yeah, Gareth's the electronic genius and I was teaching we've talked now for almost a decade, a course on the internet of things which we define. Basically as microcontrollers with network connections, so tiny little computers, pretty much the smallest single die unit of computation that there is very little resources and a network connection And we ended up getting students to build all sorts of complicated Wiring looms and nests of cables and so on and so forth and waving one at the camera Which most people can't see so it's a bit pointless, but Some people take to that and some people find that quite a challenge just on a physical basis.
You know, you require a lot of dexterity some basic knowledge about wiring and so on.
Jonathan: And a lot of, a lot of patience, a lot of patience and care and not breaking the wires off once you solder them on. Yes. I've, I've played that game before. Yes.
Hamish: And you take it home in your bag and it doesn't work afterwards and so on.
Gareth: Exactly, particularly for our students who are coming into the lab and then taking it home in their bags and back and forth. Yeah with breadboards that doesn't end too well often.
Hamish: Especially because our students are computer science students, so they haven't got an electronics background or most of them haven't.
It's a bit of a shock, you know, they're used to using the latest and the greatest of the desktop computing. So we put together some boards that integrated some of the common sensors and actuators that we would be asking them to build circuits with. And that really cut down on the necessity for me to look at an oscilloscope and wish I knew how it worked.
Gareth's definitely the oscilloscope guy in the partnership. But we teamed up with a company called Pimeroni, who are a little electronics manufacturing company in Sheffield. And they now manufacture the boards for us. And in fact, it's gone on a retail sale just this year, only about five years late, but Hey, that's also typical for an academic five years late is on time.
I think.
Jonathan: Yes. So this is the, I've actually got, I was sent two of these as a mechatastic developer. I've got one of them here and the other is off in the other room. This is the first version of the unphoned. It's the first retail version.
Hamish: It's version 9, actually. It's been 9. Gareth's laughing.
Jonathan: Yeah. I had a full head of hair before
Hamish: that.
Have
Jonathan: the previous versions been used in teaching? How far are we into the process of actually using this for the course?
Hamish: It was version 4 that we first used for teaching, I think. So it's been used for about 4 years now, I think.
Jonathan: Okay. And I'm just because I'm, I'm curious. I, I am, I stand in, in a lot of the things I do for day job and hobbies, I stand kind of at that intersection between the programming, computer science stuff and hey, let's actually work with some hardware.
How, how did the computer science students take to the idea of here's a soldering iron and here's real hardware and oh, by the way, this, this device that you have only has, let's just say we measure the RAM in kilobytes and megabytes instead of the gigabytes that you're used to. Like, that's going to be a culture shock to computer science students.
Hamish: It is a culture shock. You know, I'd be lying if I said everybody talked to it, but quite a lot of people. just love to have something physical. They love to have, they've spent years and years and huge amounts of learning time figuring out how to get a screen to do stuff. You know, everything happens on screen.
And that's basically it. You're developing an application of one sort or another, just doing code all day, and all of a sudden they've got something in their hands. Which performs a specific purpose. I mean, the other thing about the internet of things is we're not talking general purpose computing anymore.
We're talking about embedding electronics in devices, which have very specific uses like washing machines or cars or mesh plastic communication devices or whatever. So you've got a whole different culture. You can't just throw more Ram at it. You don't have the perfect SDK. Quite often we're programming in languages like C or C plus plus.
The usual thing we say about those is that, you know shoot yourself in the foot. You're definitely going to take a leg off in the process. And yeah, there are challenges, but I think most people, they rise to the challenge, they do really well. And it's lovely at the end of the course that they take away something physical and they can show them to be showing a whole different thing to, to their mom when they go home, you know, I built this.
Rob: So so you talked a lot about soldering already here. When somebody gets one of these, is it in pieces and you have to put it all together? Is that just something you do in class? Do you, do you just dig into it and start putting on
Gareth: it? The, the board is fully assembled by Pimaroni. So they do all the hard sort of soldering and it's just needs its battery and case screwing together in the box.
But it's got the option of sort of connections on the back. So yeah, you might not be able to see this on the radio, but there's a sort of expansion Board that you can fit so it turns what looks basically like a phone form factor, and it gives it sockets on the back that Expose all the regular pins.
So it, it kind of crosses both worlds. You can just take it out of the box and, Okay, you might use, need to use a screwdriver for a couple of minutes, but, It's pretty much fully assembled. And then if you want to, you can make your own electronics. You could start off by just plugging in Adafruit. Headers, Adafruit Featherwing boards.
But you could graduate to making your own circuits. So it kind of covers the whole spectrum of pick it up and just start using it. But then hopefully leads you into putting a few bits of your own electronics on as well.
Jonathan: So I, I find it fascinating the, the, obviously we're here to talk about open source.
I think the, the, the, the board itself, the young phone, all the hardware of it. Is that actually open hardware? Is that, is that available? So if somebody looked at kind of the, the ultimate of open hardware is if somebody wanted to go and send it off to PCB way and fab their own, they can absolutely do.
So that's, that's part of the project here, right?
Gareth: Yes, yes, it's open in that sense. Absolutely. I mean, we, we're quite good friends with Pimaroni and you know I, I think it's just, you know, it's not good manners just to pick up a project and just clone it anyway because you're not adding anything of yourself to it.
And I, I think an etiquette of, of that should apply to anyone, you know, if you just want to make a copy for yourself, well that's one thing, but, you know don't just start selling it out your boot without adding something to it or, you know, giving us some kudos at least and stuff. Right. Very
Hamish: much cheaper if you happen to be, you know and have the option.
I mean, I think the way that Adafruit's ecosystem of open hardware products works is, is really great and something that we kind of, we both aspire to and profit from. Because they produce maybe 50 different little add on boards for microcontrollers. They've got a family of maybe 10 or 20 feathers.
That's the microcontroller boards. And we use those with our students and we have the same ESP32. In the on phone and then they have feather wings that Gareth talked about, which are all add ons, you know, I've got a Neo pixel array or you've got din connector for your MIDI synth or this or that, or the other thermal cameras, all sorts of stuff.
And they all use basically the same pinouts and the same form factor. So we put a couple of sockets on the back of the on phone that follow that form factor. And then we can just, you know, plug stuff in there and program from, from the end phone. If you get your prototype developed in this way. And you're not using any of the, you're not using the screen, for example, on the UnPhone, then you can very quickly take the circuit schematic and send it off to PCBWay or somebody else or any competent hardware manufacturer and they can put it together.
You've done all the hard prototyping stuff without really doing a great deal of wiring and a great deal of That difficult stuff.
Rob: So be being open hardware, does that mean these, like the schematics and stuff for the hardware is available? Is that I read on, on and Garth has shaken and said, yes, it is available.
So I've also read that there's a 300 page textbook. And I, I know I've paid more for. Educational textbooks than, than this whole project costs. But
Gareth: yeah, especially
Rob: recently. Yeah.
Hamish: I, I spent a lot of time on that in lockdown. I assume that you're doing lockdown. So I basically wrote down the whole course that we were giving.
Yeah, that's also open. If you go to unfone. net you'll find all the materials. You'll find links to our GitLab. repositories and the hardware schematics and you'll find a link to iot. unfoam. net which is the which is the book and that book describes it describes the unfoam but it also describes a 12 week That's the course that we give to our third level undergraduates based on ESP32 and the Adafruit ecosystem and the on phone and all that good stuff.
Jonathan: I'm curious what tool, what tool was used for designing this? My mind has gone blank. There's a popular open source tool that I, I know the name of that will not come out of my mouth for whatever reason.
Gareth: Well yeah, it's a, it's a great tool. It goes by two names. KiCad and KiCad. That's the one. Yes.
I can't, I keep forgetting which one is preferable or better, betterer, but yeah, that's the one that I used for the schematic, and, and then Pomeroni actually tweaked the board layout. And they did their usual magic with the silkscreen. Personally, I think they've got the best silkscreens around.
You know so, yeah, we're very happy that they took that part off, off my shoulders, so, so to speak.
Jonathan: Yeah, so it's always, it's always nice to work with like for, for some of what I do with writing, you work with a good editor and it makes your job a lot better. So you've got kind of a PCB editor there at Pimeroni.
It sounds like it was a great relationship. Absolutely.
Hamish: Paul, Paul Beach, actually one of the founders of Pimeroni, Pimeroni is responsible for the Raspberry Pi logo. Do you know the, the kind of raspberry on the raspberry pie? Paul won the competition to design the logo. It's actually a raspberry combined with a molecule called a buckyball which was discovered by a guy called Harry Crotto.
He won the Nobel prize for it. And he was a Sheffield university guy a long time ago. So it's a, it's a kind of Sheffield story. Paul's a Sheffield guy. One, the logo competition invented the first ever case for the raspberry pie, which was a bunch of Perspex layers cut on a laser cutter. Yup. I have, I have access space, which was the beautiful, aren't they?
Rainbow, rainbow colored cases. And that was made at access space, which was one of the first maker spaces in the UK. And the fact that that was open and available to somebody who just walked through the door one day with a crazy idea. Was how the, you know, how the first Raspberry Kai cases came into being and how the company Pimeroni came into being.
So it's kind of a nice success story for open source on, on all sorts of different levels I think. Yeah.
Rob: So. Bringing up the Raspberry Pi there, I know the purpose of that, a lot of that was for educational uses. And, you know, this, the on phone here, also you're using it for educational uses. But, you know, with the Pi, many people have found many practical uses today.
Are there any, any practical uses for the on phone? Any great examples that, that you know of? That the on phone has been used for
Hamish: We could be nice to john here, can't we?
Gareth: Well, yeah, I mean i'm just i'm just booting up. I don't know if it's going to show very well on camera and again from some apologies for the people at home on the radio but we're running the latest mesh tastic firmware on it.
Oh, there we are. And and that's I think In some ways the kind of killer app outside of education that some people might find the on phones a good sort of device. Unlike a lot of the mesh tastic devices, it's a sort of fully formed device with made by a sort of prop not proper company, but you know a company with a pedigree of of quality and they they're 100 percent tested and, you know assembled carefully and all of those sorts of things.
So There should be less problems for people than you get with some of the you know, amazingly cheap enabling hardware from AliExpress and places.
Jonathan: Yes, that, that, that hardware is notorious for being incredible and inexpensive and a crapshoot as to how long it's going to work and how well it's going to work.
Yeah. Yeah. I was,
Rob: I was, I was here for the Meshtastic interview too, a few weeks ago or whenever that was. And, and that also seemed like an interesting project that I'd want to get into. And, and this on phone right here, it sounds like a one way to get started.
Jonathan: Yeah. So let's, let's talk about the the, the actual hardware specs.
What what all is in the UnPhone? So obviously there's a display. Is that a touchscreen? I see we have some buttons. There must be a LoRa radio in there. There's a battery of some sort. What, what are, what, what all's in the, in the little box?
Gareth: Well, I suppose I'll carry on taking that one a little bit.
So one thing to say is we've, we are using the S3 the ESP32 S3. So we've used that for the last couple of on phones because it gives a boost in, in performance. And it's quite useful to give the students two cores potentially if they want to start exploring. Running two cores in, in parallel.
It's also got, as well as the screen and the touch, yeah, it's got a nice capacitive touch screen, and a decent sized battery, 1200 milliamp hour battery. It's got a vibration haptic motor feedback thing. It's got an RGB LED. And one of the coolest features is infrared blaster
Jonathan: LEDs.
Gareth: So if you put it surreptitiously pointing at a, an annoying sports bar television set, for example, then it might be possible to turn it off.
Although I wouldn't know anything about that, obviously. And accelerometer and a gyroscope. sensor built in. And I think that's pretty much all of the hardware. And then of course that's the expansion, of course, pack.
Jonathan: Right, right. That's a, that's a pretty, that's a pretty impressive list of hardware.
You talk about the, the ESP, the ESP32 S3 being dual core and how that, that, that enables students. Boy, the thing that comes to mind is, Writing code for single core is easy mode. And when you actually have to worry about concurrency in your programming, that is when things become challenging. So you've got, you've kind of got this, this added benefit from the educational side of things that, We get to talk about mutexes and we get to talk about concurrency and how you can easily crash your program by trying to access the same thing from two different cores at the same time.
That's, that's, that's sort of devious and I like it.
Rob: That is quite a list of hardware specs in there with the infrared, lower radio and all that. Are we missing anything in here? Seems like it has about every little Gadget spec, you can add to that.
Hamish: A few, few versions ago, we, we actually did have a some other stuff.
We had a microphone and a speaker. And the reason we took them out was because You know, fans are great, but they're also they're also massively susceptible to surveillance abuse, massively sustainable, susceptible to being hacked. And the thing I guess that I dislike about them most is that they just, they steal our attention, you know, and they steal the attention of our kids, you know, my, my kid will happily sit next to me watching telly and, you know, half the time the, the phone just never stops buzzing and she's looking down and, you know, I want to kind of, I wanted a device that would do some of the wonderful things that phones do, but without, without stealing all our attention and without, you know, without listening to me all the time.
So we took the. The speaker and the the microphone out. You can add them back if you wish. We have the I two s bus there that we do use for talking computer projects. But basically if what you are developing is something that just has a microcontroller and uses things like SPI or I two C or I two s or straightforward GPIO to talk to the local stuff, and then he uses wifi or Bluetooth or Laura.
To talk longer distance, and we think we've got a good representative set of what you're going to need.
Jonathan: You, Rob, you asked what's, what's missing and there is one thing that I know of that we thought was in there and then kind of got disappointed when we discovered it was not the, the accelerometer does not actually have a magnetic compass and we, we got a little excited because that's, that's sort of a thing that would be nice to have in the Meshtastic project.
In fact, somewhere around here, I've got, I've got a little tiny chip that has an actual magnetic compass in it. And we're going to try to add support for that.
Gareth: So that's the one thing. I don't know what your soldering skills are like Jonathan, but I think there was an issue during the chip shortage with we couldn't get hold of the MEMS gyroscope chip that we had been using previously.
And so we had to switch to a different chip. And this one that was available only had six degrees of freedom. So we had to drop the The gyrus sorry, the, the compass. But I think, as a consequence, the PCB still has footprints for two alternative sensors. So, if you've got a hot air station and, you know, a steady hand, then you're welcome to try luck.
Alternatively, wait for the possibly the 10th spin where we'll try and put it back, you know, but yeah.
Jonathan: Do you, do you, do you make the poor computer science students do surface mount soldering? No, no. I mean, no, I think that would be a step too far. Yes. Yes. I have I have attempted it a time or two and I don't know that it's ever gone well.
Gareth: If you need, you need some special equipment, I think, you know, you need a good hot air station and, and certainly I need microscope. So yes. Yeah,
Jonathan: it's a challenge. I'm curious, where did the, where did the name on phone come from? Like who's, who's brainchild is that? And what all are we trying to communicate by that?
Hamish: I think it just came up in conversation one day. The problem is that it looks a bit like a phone. And people expect to be able to do all the amazing things you can do on a modern phone with a microprocessor and gigabytes of ram and of course you can't so Calling it the on phone was a way of saying, well, you know, it may look like a phone, but it's not, it's something completely different.
Jonathan: We do have, we do have a, we do have a live chat. I just want to throw this in real quick. It's going to go back a conversation, but David Ruggles friend of the show. He says, does, does Tim you sell hot air stations asking for a friend? They probably do, and you probably don't want it.
Hamish: Buy the microphone first, and see if you can still find the parts, you know, and then think about it.
But they're too small for me to see with my eyes, but yeah, a younger person might. I don't
Rob: think my hands
Jonathan: are stable
Rob: enough
Jonathan: for that anymore. If you do it right, your hands don't have to be terribly stable. You know, you have your solder mask and your solder paste, and you scrape the paste on there, you pull the mask off, and then the only thing you have to be sort of stable about is actually getting it in the right My problem is I don't ever have the solder mask, and so I'm doing everything by hand, and that doesn't work very well.
Hamish: It's a really nice way to learn about how this stuff is made actually is what we show the students videos of Pimeroni's pick and place machine. You know, and it starts off with the solder mask, it puts the paste onto the board and then it goes into the next bit and the pick and place is so fast now, you know, placing thousands of tiny little components on these boards.
Trucks on into the oven and blah blah. So it's a great way to learn what's under the hood In fact, that's what we tell students when they start the course. This is you know, you've used this stuff From the outside in the past now you get to rip the hood off The engine and have a look at what's underneath.
I think people appreciate that and I think to be honest We need to learn that stuff, right? We need to know that stuff. If if everything that we use in everyday life Is a product has some kind of mysterious component underneath it that's manufactured somewhere a long way away and that, you know none of us actually know how to replicate or are capable of replicating and that makes us much more vulnerable and much less resilient.
So that's, that's another theme that runs through our technology development and so on. I actually started working with Gareth on a completely different electronic control system, which was for a sustainable agriculture project. Sustainable agriculture technology called aquaponics, which is basically fish and vegetables in the same water.
And that's the same stuff really. You know trying to think how we can make our communities more self sustaining and more resilient. The times aren't getting any, any easier or more stable unfortunately. That's probably why the hands are shaking a bit when you're trying to do the surface mount soldering.
It's only going to get worse.
Rob: You I mean, you've mentioned the specs and the battery and all that stuff. I probably could do the math, but being like a phone, but not a phone, the question people always want to know is what kind of battery life does it get?
Gareth: It depends what you do with it. Yeah. How deep of
Jonathan: sleep you're willing to put it into.
Gareth: Well, yeah, and the back, the back life is the real energy hog. So that chews up 70 or so milliamps. So that's probably one of the big considerations. If you can switch the screen off quite a lot, then you can go quite a few hours. I think I've, I've tended to get maybe four hours, five hours, and running Meshtastic.
So that's obviously using Both radios a bit quite well 10 percent of the time at least at most. So Yes i'd say yeah, four or five hours isn't a bad estimate for a sort of typical usage
Hamish: I think that's probably with wi fi on right? If you if you've got wi fi turned off it makes a big difference.
Gareth: I think it uses bluetooth but not wi fi So, yes if you were using Wi Fi that also really can sap the battery down a lot, yeah.
Jonathan: That's a, that's an interesting quirk of a lot of the ESP 32 devices. They use the same antenna for both wifi and Bluetooth. So in the, in the mesh tastic project, we get people coming in all the time.
Why can't we have Bluetooth and wifi turned on at the same time? And it's a hard limit of these devices. I, I, I kind of suspect that there's almost a bit of software to find radio happening under the hood and it uses some of the same circuitry to, to Talk to both of those things. It was just like, you just, you cannot do both at the same time.
Hamish: Yeah, it's one of the reasons why expressive got popular very quickly. Isn't it? Because they did have a really good wifi and Bluetooth stack. Some of the ESP 32 modules actually have external aerial connectors on them. Although with ours doesn't The big, the big pleasure for me in recent times has been seeing MeshTastic using the LoRa radio because we originally built that for connecting to the Things network, which was as I'm sure you know, a big international effort to produce a kind of neutral infrastructure for Internet of Things telecoms.
Got a bit stuck along the way, I think, when they did a version upgrade and everything stopped working but We're not now using LoRaWAN in Meshtastic, obviously, but the LoRa radio seems to work really well. And where I'm sitting, which is admittedly on a hill, I can get pings from people, I think 60 miles away was, was the furthest that I've got so far.
Yeah, that's impressive. And, you know, we can start to do what we've always wanted to do with this device, which is to have a telecommunications system, which is completely off grid. Completely without external infrastructure. And that's something that I think a lot of people are Well, the success, you know, Mesh tastic Discord, 50 channels, guys, I mean, you know.
50 channels?
Jonathan: There's a lot of
Hamish: people out there who are interested now. It's a real pleasure to see that.
Jonathan: Yeah, that's true. I mean, so the, the, speaking of Meshtastic, the thing that really got me interested in it is, around the time I first heard about it, we had a tornado. It was a small tornado, it wasn't very powerful, but a tornado in town.
And I found myself, you know, out helping cut down some trees and such. And I had the thought then that, man, if this was worse and the cell phone networks went down, I would need something to be able to coordinate this stuff. And Meshtastic really seems like it could kind of fill that void in an emergency.
And so that, that is very fascinating to me. I, I think there's an interesting connection there between, you know, what Meshtastic does. You know, the, the, the possibilities it presents and what you guys are doing with the academics course in coming along and teaching people how to work with these kind of lower level devices and this idea that you talked about, that that's important for resiliency because, you know, People need to know how to work under the hood.
I think that's real fascinating and maybe something we need to be thinking more about.
Hamish: It's never been a better time to do it. You know, it's, it's both more necessary and easier. You know, the, the 20 years, 30, oh dear, 40 years ago, I was studying electronics. And the idea that I could just go out and build something like this, you know, it was complete fantasy.
You know, if I'd been working for a huge company, I had a massive budget and years to spend. Could have done it now. It's actually very feasible
Gareth: Yeah, and yeah, we can't just accept these black boxes handed to us by you know wizards and we we have to be able to open them up and you know Otherwise we don't own them, you know, if you if you can't control these things at all if you've got no way of Changing what they do or taking you can't take ownership of it, you know in a way, you know, you're just a user
Jonathan: It's it's It speaks to me because my journey kind of into the hacker mindset, if you will, started with sort of two things.
One, it was my inability to see into, at the time I had a Windows XP laptop, and my inability to see into how it worked on the inside. In particular, I was having to do reinstalls of Windows every like six months to a year, just to keep the thing running properly. And, The thing that annoyed me so much is every time you do a fresh install and then try to go to the C drive It would throw up this big scareware warning that warning you may mess up your computer by modifying files in here and all that irks me so much and then the other thing is I Managed to I don't remember what the hardware was.
This is before the Raspberry Pi So it would have been maybe like the first generation of Arduino So I managed to use an Arduino with a relay connected all to the computer and And then control a light in my bedroom at the time and the ability to get a computer to interact with the real world, like you say, and something beyond just the screen like that was, that was kind of a light bulb.
Nope, no pun intended, but turning the light on from the computer was a real light bulb moment for me because then, you know, then the, the, the. The coolness of the computer and the computer code then has an impact out on the rest of the world. And that, that was, that was, that was the juice. That was the good stuff.
And so I guess I've, I've kind of always been an IOT nut ever since then. And I, I love seeing kind of this combination of these two things where we have IOT and we have it open sourced. It's just great.
Rob: Talking more about the software side of things. You mentioned Windows. I'm pretty sure this doesn't run Windows.
And before the show, you did mention this, this doesn't run Linux either. So what, what is the operating system? What, what, what is, what runs on this?
Hamish: Essentially, if you use the definition of an operating system, it's something that does time sharing and multiprocessing and stuff like that. We don't have one really.
What we have is is a library a C library, which implements what's called real time operating system which is a much lighter, provides a lot less facilities, but nevertheless is very useful. Precisely because it does have concepts like mutexes and semaphores and things like that, and tasks and timers that we referred to earlier on.
And we use one called FreeRTOS which has been around for quite a long time. It was actually taken over by AWS at some point, but I think the original developers still work on it and it still has an open source license. We are the board. Yes. Yeah. Yeah, Gareth and I were having a conversation about Open source licensing and this whole controversy about the way that big companies don't necessarily pay for What they get from the open source ecosystems Which I'm sure is in in your minds as well, but FreeRTOS is is very good and That's what we have instead of an operating system like Linux.
Jonathan: I think it's probably fair to call FreeRTOS an operating system It's just extremely minimal. It's down there as thin as it can be. But it does give you a lot of those same tools that something like the Linux kernel would. But you don't, you don't have to use that. You can do, you can do quite bare metal programming with these things.
Do you, do you guys ever or have anyone actually do assembly language code on it?
Hamish: We, yeah, we did assembler at some point. If you want to mess around with there's an extra There's actually two processors in ESP32. One of them is a ULP, Ultra Low Power Processor. And if you want to talk to that, you'd need to talk in Assembler, or you used to have to.
I'm not quite sure you do anymore. But actually we're, we're, we're basically going in the other direction because there's been, in the last few years, a lot of interest in CircuitPython. which is a microcontroller port of the Python language, obviously. It's a lot easier to program. Okay. You're, you're taking a step away from the hardware and you're getting less efficient and so on, but you know, not everybody wants to, to learn how to create a a composite binary from their C program and flash it and so on.
So we've got CircuitPython going kind of sideways step is that we've also, A student called Zalan has ported it to Rust. So we've also got Rust running on the, on the thing. I've forgotten what the question was now. We were talking operating systems, weren't we?
Jonathan: Well, I, I, I asked about assembly.
I think, I think Rust is really interesting though. That sort of gives you, well, what Rust does is it helps get rid of the foot guns. That C and C are so known for. And yet with Rust, you don't have the performance penalty that you would for something like CircuitPython.
Hamish: Yes, exactly. So that's, you know, that's quite possibly the future of this sort of stuff if it gets enough momentum.
I guess the issue that you always come across in this kind of context is that underneath all that the manufacturer of whatever chip you're using puts a huge amount of effort into developing their own SDK. And Expressive are no exception. In fact, I'd argue that's one of the main reasons for their success is that they've developed a very powerful and full featured and extremely optimized SDK for their chips called IDF.
And that's pretty much entirely C. And even when you're doing the C stuff that we teach our students, that people are familiar with from the Arduino world, you're using essentially those facilities underneath, and in fact the Rust port will use similar facilities. So whether, you know, for a language to actually completely replace C slash C It's quite a big ask because, you know, it's not just the chip and that really heavily optimized environment that runs on it.
It's also the fact that that interface is seamlessly with the Arduino ecosystem, and that has all your integration code for your sensors, for your actuators, for basically everything that somebody's done with a microcontroller in the past couple of decades. So, yeah, we're always talking layers on top of layers, aren't we?
But I think, I think Rust is a very interesting development that has the potential to go all the way down if it gets enough momentum.
Jonathan: I'm curious when you, when you teach the students to get started with this, what is, what does the stack look like? I mean, so in, in the Meshtastic project, we tend to use the Visual Studio Code, Platform IO, and of course, almost everything is in C Is it, is it the same stack?
Is it similar? Or, Lord help us, are you guys still working with the Arduino IDE?
Hamish: We, we tend to say, we say we give them 300 pages and we say, look, there's a thousand ways to do this. If you get one of them to work, congratulations stick, stick with it if you're happy. And the Arduino IDE even, we even, we don't even use version two.
We use version 1. 8. And that's kind of day one. This is absolutely the easiest. way to get something running. You know, you don't even get syntax highlighting. You certainly don't get autocomplete, whatever. But it is robust and it does work with all the different chips and so on. But yeah, Platformio and for myself, it's the VI editor.
But other people do use this thing called VS Code, which apparently does some things, but I think it's just Emacs version 2, probably.
Jonathan: Yeah, yeah, that's totally what it is.
Gareth: Oh, partly because we support all these students and they're all they've all got their own setups. So, we end up supporting four or five different stacks, which is a bit of a headache, you know.
So there's, you know, VSCode platform IO in, on Windows and Mac and Linux. And then there's a couple of versions of the Arduino IDE, and subtle differences if you install it from the web's app store, or if you download it. And, and then there's the online Arduino IDE that some students have used. And yeah.
So I think, yeah, there's There's a lot of possibilities there and we, we struggle to keep up with all the permutations to be quite honest.
Hamish: Sure. I like to, I like to use Docker. If you, if, if you can cope with the command line, then you fire up our Docker image. You do this, you run platform here from the command line and it's really repeatable and predictable.
Rob: I was going to say, working with this stuff C C and C and Rust are all compiled languages, at least to my recollection, and VS Code, I'm sure, doesn't run on this device. So, generally, are you doing development In a different environment and then moving the stuff over or how does that work if you want to make stuff for this?
Hamish: So you've got a serial connection to your device over USB and you're flashing from the computer to the device. Historically that's been done by the IDE. So the Arduino IDE would allow you to do this and VS Code slash Platformio allow you to do that. More recently, Web Serial has become quite a good way to do it.
So browsers now implement a kind of sandboxed version of the Serial protocol that allows you to flash your device. And if you're on Windows and Mac and you're using something like Docker or a virtual machine to, to do the compile, Which means that you don't actually have to do the complicated installation of the SDK, etc.
then you pretty much have to use web serial because Whereas linux will pass through the serial devices to your container and you can flash from in there On mac and windows that typically doesn't work. So then you have to do your compile come up with a bin file, which is your firmware, and then go to the webserial, select the bin, and flash it to your flash it to your device.
And all this is quite error prone Some of the microcontroller boards use additional chips. What are they called, those chips, Gareth? The CP, whatever. Oh,
Gareth: the serial UART chips. Some of them have a That's it, yeah. Yeah, a chip in the way of the USB and the microcontroller and And sometimes that helps you with the flashing, and sometimes it gets in the way, and yeah, I mean, I, I see on, on, for example, the, you know, Meshtastic Discord, there's a constant trickle of people saying how do I flash this thing?
I've been pressing the buttons and turning it off and on again and wiggling around, and I was just like, argh, you know. And I think usually they well, usually they stop, hopefully, because they got their problem fixed, but yeah, it is a, just a constant and it's not just us that struggle with this stuff.
I was chatting to someone who was does a lot of quadcopter sort of, hobby work, and he's, like, constantly struggling with getting firmware onto these things and getting them into DFU mode and I think, actually, a large percent of the population, probably, nowadays, have, Kind of struggled with updates of some sort that you click on something and it says the update process failed Try again later, and it's like oh what you know
Hamish: Welcome to the joy of embedded development.
Yeah
Jonathan: What year of university are students usually in when they when they take this course their third years in the UK? They're about to finish their degree. Usually. Okay, is it is it a single semester? Does it last all year? It's a single semester. How do you fit everything into a single semester? Isn't that, that's gotta be always the challenge.
Hamish: It is difficult. So we spend six weeks playing with microcontrollers and then we spend six weeks on a project. When we, when we started giving them the on phone and similar devices. So we also, we, we give different options. So we've got here a Lily go watch from. TTGO TTGO Watch, we've got a thing called the ESP Box from Espressif, which is kind of good for doing your Alexa like kind of things.
We, when we started giving out that kind of thing, like the on phone that's, that's pretty much a finished circuit extendable, but, but basically finished in its, in its basic form, then they, they, they start being able to do projects that they can get done in the space of the course. One of the ideas about the course originally, which has worked pretty well, is for them to be able to take the project hardware away with them.
And then they're sitting in an interview or whatever getting the, getting a job after college and they can, they can demonstrate some stuff, some physical stuff that they've done, instead of being reliant on the same old, Hey, I built a database backed web system you know, old. Yeah. So that's worked pretty well.
It's an advanced, it's an advanced course and not everybody takes to it, it's the truth, but yeah, everybody gets a bit of a flavor.
Jonathan: One of the things you guys mentioned in the notes you sent to me was a question about why you didn't get into microcontrollers in the 70s, the 80s, and the 90s. And thinking about microcontrollers way back then, there wasn't a whole lot.
I know there was things like the basic stamp in the 90s and some other things. But I'm curious, what's the story? What did it look like way back then and why wasn't it as appealing?
Gareth: Well, let me tell you a story, my boy. It was just so different. I mean I've always gravitated towards digital electronics rather than that tricky analog stuff.
But there were just so many barriers, you know, and, and like Hamish was saying, unless you were a, a big company with a big budget, you just couldn't even get started. The compilers were expensive the other bits of the tool chain development boards were expensive, and they were aimed at people working for big companies.
They cost a thousand dollars, you know, a thousand pounds easily, you know. And so I kind of bounced off a couple of times just unable to cross the, these sort of barriers and get into developing with microcomputers and then microcontrollers. And then a bit later on in the early 2000s, I had another kind of go at it, and I must have spent two, maybe three days trying to get, GCC embedded compiler configured and the linker configured and I think I gave up without ever being able to compile Hello World.
And I came along about three years later and I had an Arduino board, one of the first Arduino boards. I loaded up the IDE. And I wrote, like, Blink, and flashed it, and 30 seconds later, the LED was blinking, and my mind was blown. So that, the long answer is Arduino and open source basically were the enabling things.
Because the microcontrollers were cheap, as, as they always have been, and the little board was cheap. Cheap, but what was different was that the toolchain and the IDE and some quite good Educational resources were available even in the early days people were really keen to share blog about the projects They'd done there were lots of code examples and things So yeah, it was the Arduino that was the gateway drug to microcontrollers for me Yeah So yeah, and that's obviously built on the, the free GCC compiler and, you know, all the other good it's a, it's a great open source success story and it, it's turned hundreds of thousands of people onto electronics, I'm sure.
Hamish: I love the fact that it came from art students in Italy as well. Yeah. That's where the Arduino started.
Jonathan: Yup, yup. It's funny though, that's part of my story too about getting into all of this was again, working with the Arduino. I think it came, I came along at just the right time. I, I know some people get started, like I mentioned the, the basic stamp and that was available in the nineties.
But I think it, I think that, that must have had a, a harder on ramp, like the, the learning curve must have been steeper and it was more difficult to get started with it. Yeah,
Gareth: I missed that one, but yeah.
Jonathan: Yeah. Well, I did, I did too. I don't have any memory of using it. I just, I know, I know that it existed.
You know, it's kind of funny. We wonder sometimes, well, why, why is so much of embedded using like this Arduino framework? Cause you, you're, you're running on things now that have nothing to do with Arduino and yet you're using the Arduino headers, you know, some, somewhere there's Arduino that H getting included and you, well, why?
This is why it's because so many people got started on it. And Arduino was one of the first to really do a good job with it. So it's, it's stuck for better or worse.
Hamish: That's something we tell our students is that The speed with which you can develop is dependent. not just on the device you're using, not just on the SDK or the IDE that you are using, but crucially, it's dependent on a, a massive community of people and the e ecosystem, the code ecosystem that has grown, grown up around those enthusiasts and those people who have contributed their work to the to the open source code that's available.
And for Arduino, you, you still can't beat that, I don't think. Yeah,
Jonathan: yeah, absolutely All right. We are headed towards the bottom of the hour I do want to ask is there anything that you guys wanted to talk about or let folks know about that? We did not ask about
Hamish: We haven't talked about raspberry pi very much, but I think at least in the uk raspberry pi has made a huge contribution to Changing the way that we've been able to educate so when Hebdon Upton tells the story, he says, you know, back 10 15 years ago, undergraduates were turning up without any real hands on experience of computers, and that was because your home computer was an expensive machine, it ran an operating system which was easy to mess up.
Mentioned no names Redmond. And your parents, parents wouldn't allow the kids near the damn thing. So the Raspberry Pi has really changed that. You've got a fifty dollar computer, you can stand on it, break it. Um, hopefully it belongs to somebody who's, you know, lending it out to the school. We used to run We had a, we had a, what we called a pie bank some years ago.
And we'd go to schools with a whole bunch of raspberry pies. We'd give them out, let the kids play with them and so on. So that that's made a huge change. And I think we're profiting from that.
Jonathan: Yeah.
Hamish: That's another of the things that has got easier. One of the things that's really got harder and I really feel for the little companies doing electronics manufacturing is that I think the, you know, in the pandemic we had chip shortages initially because factories were closing.
But I think that's gone on and I think it's now actually, it's become a kind of not exactly standard practice, but I think people are hoarding, you know, the big companies are intentionally buying up every MMU of a particular type because they can see that, you know, then they'll be able to build their phones and their competitor won't be able to build theirs.
So, you know, that's, that's made it tougher and, you know, these, these things tend to go through more iterations now, smaller, smaller runs because you can't get the devices and you know, hopefully we're going to come out of that one of these days. Those are two things that I think we haven't covered yet.
Jonathan: Yeah, very interesting. All right. I do want to ask each of you. Okay, let me let me ask this. Let me ask this before we let you go What's the most surprising thing that a student or anyone else for that matter has done with the on phone? What what project what bit of software or hardware on there has surprised you the most?
Hamish: Rust made me fall off my chair. I must admit seeing that But um also we have a, we have a big, in our students union, we have this big nightclub with massive quantity of really high quality lighting in there and light effects and stuff. And this year two of the guys did a control system for that.
So you can, you can walk into the, into the, I'm, I'm, I'm really going to try this myself as soon as he submits his work. You know, I'm going to put the controller on. I'm going to go in there one night and just start running the lights myself, I think. That's,
Gareth: that's pretty cool. I think a student did a Etch a Sketch, which is such a simple idea that, you know and you know made Gareth on his screen and showed me.
I think that was the thing that tickled me the most, let's say. Yeah, that's fun.
Jonathan: All right. So two final questions for each of you before we let you go. And we can, we can start with Gareth and then go to Hamish. What's your favorite text editor and scripting language?
Gareth: Ooh. Well shamefully, I've got quite fond of the one in VS Code because I like, I like the pretty colours, and being able to click on a function and jump to it, so it'll have to be that one sorry Hamish and sorry, what was the second question?
Scripting, favourite scripting language. Oh it's gotta be basic. Basic, old school, you know, but yeah, I've got a soft spot for it. I don't use it anymore, but you know, definitely my favorite.
Jonathan: I, I got, I got my programming start with all the QBasic from Microsoft way back in the day. So the only way is up, you know, and then how much same two questions.
Hamish: Tip of the hat to Bram Molyneux, sadly died a year or so ago developed Vim. Porta, the VI editor, which is my tool of choice, very fine piece of software. Um, and scripting language has to be Bash, I think, the Bourne shell. I'm one of few people who's written a fairly functional web server in Bash, which I think, you know, probably go on my gravestone.
Jonathan: Probably lead me to my grave, actually. That is, that is definitely saying something. Is that source code available? That sounds extremely fascinating to look at. Or is that something you just dope show to everybody? A lot of my, a lot of my, a lot of the code
Hamish: that I write for the course Yeah, I need to hide it, it's so bad, but, yeah.
We can talk offline, as they say. That's fun.
Jonathan: That's fun. All right. Thank you gentlemen, both of you for being here and thank you for the UnPhone. It's a, it's a great project. Thank you so much.
Gareth: It's back on sale. Yes, hopefully some more
Jonathan: people get to share it. Yeah, there you go. All right. Rob, what do you think?
Have we talked you into it? It's back on sale. You can go get one now.
Rob: I did look it up on their shop and I think it was about 139 pounds. Convert that to US, I don't know, a few more, a few more dollars, but Just a
Jonathan: few dollars more?
Rob: Something like that. I don't know. I don't know the math. I'm not here for math.
But it's definitely something interesting to look into. Just because even if you think of all those extra things, if you were to get a pie, a raspberry pie or something like that and add, All those extra infrared and all those lower radio year and a screen year, you're right around the same, about the same price anyway if not more.
So I'm definitely, definitely interested in, maybe that's going to be my way to get into Meshtastic also, which I kind of mentioned early. Yeah, there you
Jonathan: go. You could next time they ask you to teach a course over at the local college, you could use it for that too.
Rob: Yeah, it doesn't fit directly with the classes I have taught, and I don't know that I have the pull there yet, just as an adjunct to get them to add a new course.
But, Someday, I'm kind of hoping maybe that can be my twilight year job or my retirement job. And, you know, maybe I'll have some more pull there someday.
Jonathan: Yeah, yeah, it's fun. All right. Yeah, I very much enjoyed talking to this project. Rob, do you have anything that you want to that you want to plug?
Rob: You know, just you guys can come connect with me. My website is robertpcampbell. com and there's links to my Mastodon social media there. Otherwise, also come and listen to me and Jonathan at the, on the Untitled Linux Show every
Jonathan: week. All right I do want to let folks know that the current plan is next week.
We're going to talk with the, talk with the guys behind Poutine, which is a security scanner from Boost Security. They recently released it. They released it as open source and it sounds pretty interesting. So we shot an email off to them and they, they said, sure, we'd love to come on the podcast and talk about it.
So that is currently the plan for next week. If you know a project or are a project that you think should be on the show, Shoot us an email. It's let's see, floss at hackaday. com. That's the one that'll get to me. And let us know about it and we will try to get it scheduled. We are always looking for guests, always looking for new projects to cover.
And then as for me, the only things I really want to talk about is. Of course, Hackaday, the home of Floss Weekly now, we appreciate them for that. It's also where my security column goes live on Friday mornings and a few other things happen from time to time. Yeah, make sure and follow us there. We, we sure appreciate everybody listening live and those that get us on the download and we will see you next week on Floss Weekly.