#667 – Long Distance with CNLohr-a

1:31:23
Long Distance with CNLohr-a cover art

Download episode · 114 MB

Also on Apple · Spotify · YouTube · RSS

Show Notes

Welcome back, CNLohr!

https://www.youtube.com/watch?v=eIdHBDSQHyw
  • Started in January 2024 with discussions with mustardtiger / Frank
  • Charles had done Wifi long range before
  • Also FM from ATTINY85
  • Ethernet + AM
  • Radio signals without radios
  • USB
  • Harmonics
  • LolRa
  • Upchirps / downchirps
  • 903.825 - 903.975 mhz
  • Michael Ossmann talk
  • LoRa doesn't do code matching
  • JP Norair talking about LoRaWAN / DASH7
  • Tool / emulator for the airwaves
  • 3 lines of the repo
  • Tool to create tables
  • There are two 2 lookup tables (up and downchirps)
  • Table is different for differnet spreading factors and base frequencies
  • Andreas Spiess LoRa/LoRaWAN distance attempts
  • Spreading Factor -- can't past SF10 on this setup for unknown reason
  • AirSpy
  • Matt Knight
  • LoRaWAN -- protocol vs network
  • The Things Network / Helium
  • Activation by personalization
  • Nesting dolls of encryption
  • New parts CH32V002 (also, -005, -006. -007)
  • Charles is excited about the op amp on the CH32V006 that has 64 MHz GBW
  • CH32V203 - 144 MHz - $0.24, has usb xcvr
  • CH32X035 is self clocking - best low cost option for USB
  • All are supported in library now
  • Community - CNLohr discord
  • Porting examples for the parts using the technical reference manual
  • MNIST database - handwriting recognition system
  • Announcement post on CNX about the new parts
  • It's possible to hook up parts directly through the 1 pin SWIO, so you can hot-load firmware
  • Writing code onto a "scratch pad"
  • Want to see more CNLohr experiements online?
    • Youtube.com/cnlohr
    • discord: cnlohr reach out for invite
    • Github

Transcript

Cnlohr A: This is The Amp Hour Podcast. Release May 23rd, 2024. Episode 667. Long Distance with C.N. Laura.

Chris Gammell: Welcome to the Amp Hour. I'm Chris Gammell of Contextual Electronics. And I'm Charles Lohr. I'm a developer by day, but by night, I'm a sort of recreational hardware software hobbyist, and I'm a YouTuber, and my YouTube channel is youtube.com slash C.N. Laura.

Cnlohr A: Well, welcome back. It's good to have you. You were here a year-ish ago. You know, that's the link I should have had up. But yeah, about a year ago, and you were talking about the CH32V003. People have probably heard me talking about it a ton since then, because I've leaned on your fun library a whole bunch to try out things, and I've been really excited about it, and glad to have you back.

Chris Gammell: Yeah, it's been really exciting, both because that library has succeeded in ways that I had not expected it to, where now, for people who really want to do wild projects with this horribly underpowered chip and do things that you probably wouldn't have expected to be possible, people really have taken that library and run with it.

Cnlohr A: So that's an interesting thing. The underpowered, like, it is, like, small, but it's, there's a ton of stuff in there. That's what I, that's what I'm always telling people, I'm like, yeah, it's 48 megahertz, like, it's like a, the equivalent of, like, a, what, a Cortex-M0+, right? But, like, that's...

Chris Gammell: No, it's missing the multiply instruction. Oh, that's the... Well, okay. It is, it is right now, there are, we can talk about that later, but... Great, great. But no, it is, it is a little bit more anemic than a Cortex-M0+.

Cnlohr A: Got it. Okay, so that's, that's good to know. Yeah. And that's the thing, I'm not down in the, I'm, I'm utilizing library, so, like, you're down, you're down in the, in the instruction set, so you see this stuff, you see when it goes right and wrong, huh? You probably see how much... Where those limitations truly are.

Chris Gammell: Yeah. I mean, it is amazing how far you can get before you actually, like, before the compiler even wants to emit a multiply, but, you know, it does at some point want to do it, because, like, yeah, shifts, shifts and rotates and all that's free, but, you know, at some point there are operations where you're like, dang, I wish I could multiply these two numbers, but, you know, you can still do it, it's just, now it takes time instead of it being instantaneous. So, you mentioned some crazy projects you've seen. What, what have you seen that, that surprised you with this? Oh, um, the, uh, the Charlie Plex steering project was just wild. The level at which people are able to, like, really make content small is very cool, and it's, it's kind of funny when you see, like, the demo scene and what people are able to accomplish with, like, four kilobytes, like, some really wild demos, when you have 16 kilobytes, which is what these chips have, like, you know, it's like the sky is just the limit. Um, and I was just, yeah, I don't know, I've just been seeing some really cool projects that people have been doing with it. And when you're not limited by like really big bloated frameworks, um, and you can really focus on making things. Small, like just doing what it is that you want to do instead of doing all of these other things, you can really go far.

Cnlohr A: Yeah. Yeah. And I think if, if there is a theme from the last episode, I think it is that like tight library, like efficient execution, fast iteration. I think fast iteration might be a thematic thing for you broadly. Is that, is that a fair, fair statement?

Chris Gammell: Yeah. Um, I am stifled when, when like, so I have a very short attention span. So if I can't try something and see what happens in a matter of about a second, like maybe two seconds, like between switching back and forth, like I, I just lose, I lose focus and interest. Come on, TikTok serve this new niche. One second. Yeah. It's funny. Like I'm not on TikTok, but, um, I, I do, I, I guess maybe I get it. Maybe it's just some phenomenon that's, you know, society.

Cnlohr A: I do, I do watch the YouTube shorts with my daughter. I'm just like, and then like, I look up and I'm like, Oh, it's 15 minutes later. Like how did that? I'm like, Oh yeah. Oh, I get it. Like I totally get it. I'm just terrified of it personally. Cause I will lean right into that, you know? Well, speaking of YouTube and speaking of your new stuff, you have been iterating on a bunch of stuff around Laura. Can you tell us about that?

Chris Gammell: Yes. So, uh, it actually started back in January. So it is a relatively new, like story arc for me where I was chatting with mustard tiger about Laura. And I was like, I was just historically always totally uninterested in Laura because for me, wifi is already really long range. Like around 800 meters is kind of like where the sorts of stuff that I do with wifi kind of top out. Um, because like when I'm using wifi, I'm using like the much lower speeds, the, you know, the one megabit coding schemes, the expressive long range modes. So for me, like wifi has just always been that magic bullet for anything that I needed to do wireless wise. But when I was talking to Frank, he kind of said things that, that hinted to me that like, Oh no, this is like really in the mud that these signals can come out like really low. And I was like, I just didn't, I don't know how to explain. Like I didn't, I didn't not believe him. Cause like, I know like theoretically like, yeah, yeah, yeah. That makes sense that you can use processing gained in order to like get it back. But like, I didn't have a visceral feeling for it. Like I didn't, I didn't internalize just how, how robust Laura signals were. Like, I just didn't, I just didn't get it. And, and sort of like, I got this feeling like there's something here and, and we were just chatting like a lot. And it's like, so you mix this thing where like, so historically, whenever I've tried broadcasting signals with microcontrollers, I'm always targeting a range of about say two times or three times the, the, the, the signal that I'm generating. So let me, let me back up a second. So for me, I love transmitting signals wirelessly for microcontrollers. There's probably like five or six YouTube videos I have maybe, maybe more actually where I'm doing something where I'm wirelessly transmitting some, something from a microcontroller.

Cnlohr A: Okay. And what is the relative, I guess you'd mentioned like the one megabit encoding, but like the, what is the type of signals usually are usually saying like the, Hey, I'm on kind of signal or is it more like bit streams that are not video, right?

Chris Gammell: If I'm actually transmitting data, I'm just using like ESP now with Espressif chips or something like that. Cause like Espressif just has the most amazing wifi stack. It just, all of that stuff just works. It's amazing. But what there, there's this other category of you taking microcontrollers that don't have radios and somehow transmitting something. Uh, I started with like a FM radio signals from like an 80, tiny 85. Yeah. A little bit later I was doing, um, well, I guess it was ethernet, but then with ethernet, you can also broadcast AM radio basically by changing what you have in your packets and in sort of like the, the other, the other side of the whole wireless thing that had always captivated me is like just transmitting radio signals without radios. And I, I really, something about that I've just loved, but sort of like I'd always been just sort of, I targeted these areas that I could reason about when I, like, I kind of have a feeling now and it takes like a long time to develop it. But if you just, if you just generally like write some code to turn it up in on and off at a certain speed using like a strip register and you have a software defined radio and you're looking at the signal, like you can, by playing with the code, get a very intuitive feel for like how these things fit together and like how like signals that you generate, whether it's like intentional or unintentional, but like, like what, what is actually radiating from the traces on your circuit boards?

Cnlohr A: Yeah. I think that's a key point too, for people that are not RF adjacent normally, like this is me 10 years ago, five years ago. I don't know. I don't know when it was, but like basically the, the idea that like when you have an ESP chip or a lower transceiver or something like it, it's like you're driving the input to like a high speed MOSFET and you're either you're driving a signal into a controller that's driving that MOSFET. But basically you need to be able to like very quickly turn stuff off and on inside some other part of the silicon. Right.

Chris Gammell: Yeah. And many times there's like highly specialized hardware to do exactly that, to generate specific types of radio waves, which will more effectively radiate out and be able to be received by other things. Right. And the FCC doesn't knock on your door. That is, I mean, so far knock on wood. It hasn't been an FCC person.

Cnlohr A: No, no, no, no, I meant, I meant in, in the general case, not, not, not in the, your case, right? Like I meant the, like, like I buy radio chips because those have been pre-certified and I buy modules even because those are even more pre-certified with like the passive components. But this also kind of fits that same element or that same thing we talked about the last time you were on the show with USB. You're basically doing USB without a USB transceiver, which is also specialized silicon that handles high speed signals from a USB cable. Yes. So much like in the last episode, you, you have the RV 003 USB, right? And so that, that is basically the same kind of thing of like using GPIO to interface with a high speed interface. In that case, a USB cable, right? Versus now you're talking about doing the same thing with, right? But without actually having the high speed transceiver, which is basically the, the, you know, digital to air RF kind of way of doing it.

Chris Gammell: You know, I had, I had never even like I was caught off guard there because I, I've never ever thought about that symmetry. I just never thought about it that way. Um, it's like, you really like making the G and GPIO, like do, do its work, right?

Cnlohr A: Yeah. In general.

Chris Gammell: I mean, I don't necessarily only do pure GPIO, but, but yeah, that is an interesting point where it's like, like you have just generic things like a shift register or whatever. And being able to, I guess the thing I really enjoy is finding ways to write software to just to somehow like, like you can just write software to send data or receive data. I don't know how to explain this. Yeah. That's a, that's an interesting symmetry though, that, that like the idea would be that you just write software to do the thing that hardware normally does. Yeah.

Cnlohr A: It just, it's the new interface is the same interface, you know, meet the new interface, same as the old interface, right? It's it's, and software is the, the defining, the defining change. So that's cool.

Chris Gammell: Yeah. Yeah. Like, so instead of using software to just control registers, you're using software to control bits, but you're still doing the same sort of thing. And that, that is an interesting point that you're, you're using software to control the signal. That's like the RF signal or you're using software to control like the USB signal, I guess. I'd not, yeah, that's, that's just an interesting perspective that those are kind of the same, which makes sense. I just never really had the introspection to see that. Yeah.

Cnlohr A: I mean, it's, and I, we all benefit, so that's super cool. So now one of the other things I think we need to explain here too, is the, and you do this great in your video and the repo that we'll, we'll link into the show notes, but like the idea that there's harmonics, right? Harmonics are like super key in all this stuff where maybe you can explain harmonics real quick.

Chris Gammell: Yeah. So I don't want to get into like specifically which ones you tap into, but going back to playing with things. So if you just, if you have a signal that you're turning on and off on a microcontroller, literally just turn a pin on, turn a pin off. If you do it at a regular interval and you have a software defined radio sitting right next to it, you can just scrub around on the spectrum and try to find, well, what, what changed when I'm transmitted, when I'm turning this thing on and off versus when I'm not. You'll, you'll see things on the software defined radio, say like you turn, you, you do this thing where you're turning on and off on, then you do nothing for a second and you go, and you do nothing for a second. If you do that, you can actually scrub around, like, like sweep around by, by just like sliding a slider basically and look at the R of spectrum and see like, well, what changed? Like literally just what changed? And what you'll find is that when you turn a pin on and off at, you know, a frequency, you'll actually see other frequencies being made elsewhere in the R of spectrum, like sometimes much higher. So with, with the square waves, right?

Cnlohr A: Because a square wave has other components. Like if it, yes, if digital signals turned on sine waves, you'd only get the base frequency. So if you turn that is true, yes. If it was a perfect sine wave, you would never see a hundred megahertz. So you wouldn't get any other, any other harmonics, but if you do it at a hundred megahertz square wave, then you get a hundred, the little bit smaller at what? 200 bigger at 300 smaller 400, right? Like that's how the, the frequency conversion goes. Yeah.

Chris Gammell: Approximately that. And so, but the idea is that because these things are actually turning on MOSFETs and they have this, like this sharp, like impact, like think about when you hit like a symbol, like or like a drum that like say an untuned drum, something where it's like an impact, it creates just this, this noise all over the place. Yeah. Because it's not creating this nice properly formatted tone. And, and that noise has interesting properties that if you play with, you can start to learn about and control and, and do interesting things with. Um, oh, so I, I, I guess like now would be a good time to tie that back in. So I was talking to Frank and Frank, like, and it's sort of like, was this, this thing where, as you mentioned, like less loud, less loud, less loud, as you go up the spectrum, that is true because like naturally when you turn on these pins, if they're not designed to be high speed outputs, they're going to much more slowly turn on and slowly turn off, which means that the amount of noise, it's like, like imagine if you just put muffle the drum. So now all you really get is the lower notes. That's kind of what you're working with. So when you get up to like 900 megahertz from turning a signal on and off down at like, I don't know, six megahertz, the amount of power you have is itty bitty because there's just so many limiting factors. But the big interesting part when I was talking to Frank was it's like, well, we're pitting these two things against each other. So we're pitting this protocol, which is extremely sensitive against this output, which is very low power at 900 megahertz. Like which one of these terms is going to dominate? And like, we just didn't know. And it was like, it's this thought of like, well, almost certainly the fact that it's going to be very muted. Like, I mean, you're basically like piled pillows on your drum set and you're trying to hear the drum set from a mile away. Like, is that going to work? Like, probably not. But, you know, maybe there's something there. And so that's what kicked off this whole software to find Laura project.

Cnlohr A: Got it. I mean, that that level of curiosity is very impressive. I got to say, like, I would look at that and be like, yeah, probably not. I'm gonna make a sandwich, you know. So like, kudos on that. You really you really dig in your brain. I feel like we could do a whole episode just on like your your methodologies and your brain and how you think about engineering problems. You're you seems like you have a very interesting driving factor and all this stuff.

Chris Gammell: So I think I can sum it up, though, really quick, which is I'm I think I am much less afraid of failure than most people. And I don't know why. But but like like the only projects that we talk about are the ones that succeeded. And I probably do on average two pretty in-depth projects every month. And the only two really worth talking about in the last year had been the USB project and this Laura one.

Cnlohr A: Yeah. But I would also say you you do dedicate a lot of time to it, too. So like there's something driving you there. Right. So I see what you're saying. Future episodes.

Chris Gammell: You know what I mean? OK, that would be more for a future episode. Yes. Yes. Yeah. OK. But yeah, I want to clarify. It's not like I have some like secret Oracle of like, oh, this is going to be amazing. It's like like we just didn't know. And and it wasn't until we like, I mean, I don't even know. It was probably 100 hours of work before. No, probably a little bit more than 100 hours of work before we even got like even the most literally I had a wire wrapped around a Laura receiver like like is anything going to get through? Like if I can if I can get this thing to go like a foot, I'll consider it a success.

Cnlohr A: You know, I think about this for my kids, though, too. Like so I think about like how do I inspire? I mean, we are getting into it. But like so I think about like, you know, people like you or Ben Krasnow or like Colin Furs, like there's just a lot of failure in there. But like how do you institutionalize that? Like that desire to keep pushing through it? You know, like that's that's what I think about as a as a parent now, because I want to like I don't think I have it myself. I think I'm, you know, somewhat tenacious, but not like not like your level of tenacious. But like that is it's impressive. It's really impressive. So I don't know. I think I'm going to keep thinking about it. I'm probably keep talking about the show, too.

Chris Gammell: So, yeah, I don't. Yeah, that would be something that we could talk about some other time. I don't have I haven't thought about it myself that much, but that is something that is probably worth thinking about, because, you know, like, sure, I can I can show you what succeeded for me, but I've never really tried to express the why. Yeah.

Cnlohr A: Feedback loops, positive feedback loop somewhere, you know, like, you know, like positive. Yeah. I mean, reinforcement rather. Yeah.

Chris Gammell: I think that it's it's it's got to be different for different people, because I agree that it looks like a similar thing is what like Ben Krasnow has. But like I it sounds strange, but it's a lot of it's rooted in my religion. But yeah, that's definitely another another episode. That's great.

Cnlohr A: OK, cool. Well, let's get let's get to Laura. Let's talk about that. So now we're talking about like you've turned this thing on and off and then Laura is like here's what I know about Laura. And we talked about on the show a lot. There's chirp involved. I know there's a chirp. And I know that there's a bunch of stuff on top of that chirp. And there's like uptrending frequencies and downtrending frequencies. And I will be honest that I was reminded of that from looking through some of the I knew that before. And I was reminded today when I was looking at your repo. So with that in mind, what is Laura?

Chris Gammell: OK, so and let me just give you a real quick background there. Like even though Frank has worked with Laura like professionally, even he was like, yeah, I know there's up chirps and down chirps, but he didn't know any of these details around surrounding how all that works. So it was just interesting that pretty much all of us were going into this blind. It was like, OK, well, I know I got to make chirps and I kind of get like where they should be and what they should look like. But yeah, but like I just didn't even have the foggiest idea how to organize them. So without further ado, I let's let's give the like one minute one one minute on the clock. Yeah, go. OK, so the idea is any time that you want to be able to send the most basic thing with Laura, it's either a boop or a boop. And what you end up doing is if you're looking specifically for that sound of sound, then you can do some really interesting RF tricks to find and like match a boop. And if you are looking exactly for the sound exactly for just that that specific sound, you can pick it out of extremely noisy stuff. So if you if you have something that's specifically designed, go boop and like you look for that and you're in a crowded room with people talking, you can still find it, which is kind of crazy that you would think. But it is it is such a specific thing that with Laura, if you're looking for, you can find it. So the idea is that you construct a series of whoops and boops in order to identify and like send a signal. Laura is a little bit weird in that is like we thought like, oh, maybe a boop is like a one bit and a boop is a down bit or is a zero bit. But it doesn't work that way at all. For Laura, it's just a series of whoops. And then what they'll do is in order to transmit data, they'll start somewhere else in the boop and go and like continue. So it'd be like start halfway like and then start at the bottom. And the idea is by like shifting the whoops around, you can actually encode data that way. And you can encode a lot of data like so per chirp, you can get anywhere from like about five bits to about 12, not 12, 10 bits of data from a single chirp by depending on how much it's shifted by. And then the idea is by constructing a series of these these chirps, you can then actually have a frame which can contain data. And they do a whole bunch of other stuff on top of it to try to make that more robust. But the the general idea is that you have these up going tones for synchronization. They have two down two and a quarter down chirps. So that's how they synchronize. And that's the only place where the down chirps are used. And then the rest of the data is all up chirps. They could probably get more data by interleaving the up chirps and down chirps, but it's just not done.

Cnlohr A: So interesting. Yeah. Yeah. And so the chirp refers to like the well, I guess if you look at it in the frequency domain, it literally looks like a straight line, like going up into the right. Yes, it is. It is linear. Yes. And then it's like my chirp was not like, right? Yeah, right, right, right. But then in the sorry, in the time domain, it looks like a rapidly increasing frequency signal. So it starts out with the equivalent of like a 10 hertz sine wave all the way up to like a 10 kilohertz sine wave as an example. But that's not actually the range, right? Yeah.

Chris Gammell: So what it actually is going between is like 903.9 is the center and then you minus 75 kilohertz. So that would be like 903.825 to 903.825 to 903.975 megahertz. So a really tiny change in frequency. But when you're up at 900 megahertz, that like, you know, 0.001% is like, is significant. Like, like you can actually tell the difference there.

Cnlohr A: Yeah, totally. Huh. And so you mentioned kind of like this, um, the wind, not the windowing, but what is it called? I went to a talk a long time ago, Michael Osman, who's a former many time guest on the show was giving a talk about the kind of digging stuff out of the dirt. And is it also doing that like the, the code, I forget what the name of it is. Like the, where you have like a long coding game, um, process game, maybe multiplexing.

Chris Gammell: There's like a bunch of different of these.

Cnlohr A: Yeah. Right. Right. I don't remember what it was. It was basically like you had like a, like the word was like 120 bits long. And so then you also multiplied it by another 120 bit word, but that also helped to dig more of it out of the, out of the mud.

Chris Gammell: No, that's, that is a slightly different. That is a different approach. Um, I, I struggle to really understand the nuance there of there, there is sort of like what GPS uses, which is where you have like a code sequence. And if you're looking for the thing that matches that code sequence, you can find it in the, like the absolute just dirt. But Laura takes a different approach where, and I think like one of the issues, by the way, with that is that it's harder to do synchronization for those, those systems. But with Laura, it's a lot easier to synchronize. So instead of having, so like with code division multiplexing, every single code is totally unique, like, or like it doesn't have to be, but it can be completely unique and totally orthogonal to whatever other codes you're using. With Laura, it doesn't quite work that way. So Laura makes a compromise where it's much easier to detect and lock onto the Laura signals. But in exchange, if there is somebody else who is transmitting a Laura signal on the same coding at the same time at the same frequency, and like if all of the properties perfectly line up, then you actually can have collisions with Laura in a lot of cases where it becomes very difficult, if not impossible to tease out the original signal. And that was a compromise that Laura made. But it did make it much easier for them to implement it on very inexpensive hardware, like the hardware receivers, hardware transmitters for Laura, which is something that would have been much more difficult if it weren't for that. I guess the other thing you get there, total side note, is that one of the other issues is that in terrestrial applications, you have a lot of multipath, which means like a signal will like bounce off a building and then you'll get part of that and you'll get part of this other signal that's, you know, going around this way. And so you get these signals which are kind of like torn apart in time and just messy. And Laura is very resistant against that and not not resistant, but like it's robust against that because it's looking for these tones versus something like code division multiplexing. If you get this inter symbol interference where like, you know, some of this bit is interfering with some of that bit, it becomes very difficult to like reconstruct it. Right, right, right, right. I don't want to say impossible, but you know, it becomes very difficult in comparison.

Cnlohr A: I finally wised up and I pulled up old Amp Hour episodes and it was code matching. So I think you were right on that one. That was the thing I was looking for.

Chris Gammell: Oh, I'd never heard of that as, I mean, I understand like that makes perfect sense that you would describe it that way.

Cnlohr A: So yeah, 352 is the episode of the Amp Hour with that. And the other thing I was thinking of is actually JP Norayer, who's on the show 443, he was talking about the Dash 7 stack that's instead of LoRaWAN. It was basically because LoRaWAN has many collisions like you're talking about. That was like his answer to it. And so that's another one. Oh, I've never heard of that. I'll have to look into that. It is. It's not popular. I know that. It's not like widely deployed, but it is like an argument against LoRaWAN. I remember that from the episode.

Chris Gammell: Yeah. The things that interest me in my projects aren't things necessarily that have become popular, but they're things that are interesting.

Cnlohr A: Yeah, right. Exactly. Cool. Okay. So we've gotten to the point where now we have had these uptones, we have these downtones, we have this kind of framing around it. So then how do you then implement that with just a GPIO? That's wild to me.

Chris Gammell: Okay. So I don't know. You just sit there and you play with code and you play with generating certain types of signals and you just play with it for a while. You get a feeling for what kinds of things generate what. I actually have a tool online, which is it's sort of like an emulator for the airwaves where you can write JavaScript code and that JavaScript code will create a bit stream. And then the demo will simulate that. Well, what actually is being transmitted on the spectrum? If you were to take the signal and output a GPIO port now, it ignores all of the sort of like, you know, parasitic capacitance. It ignores all of these things. But like, it's just much more like if you want to just simplify it and get down to like what, what is theoretically being sent? I don't have an intuitive mathematical construct of understanding of how all that works. But what I have found is if you sample a signal and, and what I mean by samples, I mean, like if you just like look at a bit and you turn a GPIO on or off at that time. So you can use like a shift register for that or just, you know, whatever you're end up using, you can then sort of look at what that does in the spectrum and sort of like write code and play with it and understand how that works. And one of the tricks that I found was if you just pretend you're sending a 903.9 megahertz signal and then at a much lower frequency. So 80 megahertz or 40 megahertz or something like that. You say right now, if I were to look at that, that high frequency signal and I were to say like, like say, is it above zero or is it below zero right now at this time? And then in one 40 millionth of a second, I'll look at it again. And one 40 millionth of a second, I'll look at it again. So if you, if you read that, you save that table and then you shift that table out. So you output whether it was high or low at one time, you output whether it was higher low at the next time you output this higher low at the next time. You'll get this like noise that gets spread all over the spectrum. But the magic is you will get a little bit of signal exactly where the signal was that you were sampling. And it's even cooler than that. So if you want to generate like two signals right next to each other up at 900 megahertz, you know, something like that. And you sample those like you just add them together and you sample that. When you look at the output signal, there will be one signal here and one signal there. And they will exactly match what you were, what you were synthesizing, even though you were only sampling at like 40 megahertz. It's able to this, this shortcut basically is able to synthesize these exactly where they're supposed to be. These signals up at 900 megahertz. And so if you generate a sweeping tone at 900 megahertz and you sample that at 40, 70, whatever it is, megahertz that you're able to output on your hardware, then when you hook that up to a GPIO, there's going to be just a tiny little signal exactly where you wanted it.

Speaker ?: Wow.

Cnlohr A: Wow. Okay. So, so when you say, when you're saying sampling in this case, what is the feedback mechanism that you're talking about in that, in that case? So you're saying you're sampling, but so I'm thinking sampling like an ADC samples, but you're actually talking about sampling of like, like.

Chris Gammell: Like you're, you're sort of like in pretend, like literally what it is, is there's like, if you, if you look at some of the, the RF code in the Laura, L-O-L-R-A, the, the stack here, the RF data gen code, it has a for loop. And what it's basically saying is for every bit that I could shift out at, at the time it computes the time that that bit would be shifted out down to like basically the nanosecond or probably smaller than that. Like, I don't know what the precision is. They're like double precision floating point. So it's like femtosecond, addosecond. What would, and the idea is that inside this loop, you're going iterating through all of your bits. You want to say at this time, should I turn the GPIO on or off? Then one time slice later at this time, should I turn the GPIO on or off? And the idea is that when I say sample, I mean that function, when it's going through that loop says, is the signal up at nine hermegahertz or whatever, is that positive or negative at this time? Is it positive or negative at this time?

Cnlohr A: Is it positive or negative at this time? How is it determined what's positive or negative? There's some feedback mechanism that's, is it, is it you? In the loop doing that? Or what is it actually telling whether or not the positive or negative at this time at the 900 megahertz? That's the piece I, it's a literal sign function. I create a sign way like, oh, okay. So wait, sorry. You're saying you've created the, the chirp. Let's just say it's a chirp, like a table. That is the chirp. Correct. And then you're saying you're doing that comparison. So you're just doing a lookup table. Then the, the 40 megahertz comparator effectively, like software comparator is just saying, where am I in the cycle? That kind of idea.

Chris Gammell: So let's, let's actually take a step back then. So the idea is that I have a table creator. The table creator steps through like, like the, the, what times everything is. And it looks at this, this sine wave and saying like, should I be high or low? Got it. Then that table creator stores away that list of bits. And then in the hardware, so you transfer the list of bits to the hardware in the hardware. It just reads that list of bits. And it, it, the hardware has literally no idea what it's, what it's doing. It's just, it's looking at this table. It says, oh, at this time I'm supposed to make the, the output go high. At this time I'm supposed to make the output go low.

Cnlohr A: It's like the most literal version of a magic number in a program, huh?

Chris Gammell: Oh yeah. Yeah. It's the, the code that is outputting the bits has literally no concept whatsoever of what it's doing. There's, there's just a table that gets produced by the first step and you just shift through it on the microcontroller. And all the microcontroller knows is if I shift this table out, it's going to somehow produce the signal at the right place. And one of the really cool parts about that is it means that if you want to make a very complicated signal up at 900 megahertz, uh, you can, and, and you just have to store what that would be. Uh, one of, one of the fun things I did in my, at the end of the, my video was I encoded like a meme, a picture of a Leonardo DiCaprio from the great Gatsby, like a drawing. And I just made it so that the lines that have to get drawn inside of my waterfall spectrum, I just, all I did was I just said like, well, I want, you know, some signal here and some signal here and some signal here at this time. And I just created a bit stream. Um, and I send it down to the device and the device plays that bit stream. And when it does, it creates a signal. It creates the signals that I want up at 900 megahertz to do what it is that I want it to do.

Cnlohr A: Yeah. That's awesome. Yep. I still, I will probably always remember at the first hack at a super con, that was the winning badge hack. That was someone basically encoded in a, I think it was an AM thing. There was like an AM receiver or no, it must've been audio. Even it was like a speaker. Yeah. Cause you could hear it. So it was like a speaker and then they encoded the hack at a logo using a teensy. They encoded the hack at a logo and audio. And then there was like a spec, there was a spectrum and it was like listening to the microphone and then, you know, a little logo. It was a great hack. I loved it.

Chris Gammell: Yeah. So sorry. I hope that that made sense. It is a little bit strange. Like I sent, I just sent you, it's, it's only three lines of code to create the table. So it's, it's kind of magic. Yeah. Yeah. Like, like the magic is just that you, yeah, I, I, I'd have to base, I don't have any great better way to explain it. Okay.

Cnlohr A: But yeah, I think I got it enough to at least in my head, I'm hand waving past it. I think, I think the best way to understand it would be to go and execute this code myself. So that is probably my homework for today.

Chris Gammell: And actually even better is a link to, I have this little simulator that I mentioned earlier where you can go there, you click on this little NTSC button because it's not, and what it does is it produces the simulation of what would actually happen over the year. And you can play with JavaScript code and try to generate different signals and it'll output those signals. And you can see what those signals would look like if, if you were going through this whole process of computing a bit stream and then transmitting that bit stream over the year. Got it.

Cnlohr A: I will add both, both of these things will go into the show notes for sure. Both the links that I was just sent. So yeah. That'd be great. Yes. So now where are we now?

Chris Gammell: Yeah. So now what we've done is we've generated a 900 megahertz tone. We can, we can shift it around. We can bump it over here, do whatever we want to do with it. We can, we can generate a tone. And in fact, what I do is I create a whole table for an entire up chirp and an entire down chirp.

Cnlohr A: So that's interesting. Yeah. So I was wondering how you shifted it up and down. So it's now it's like basically creating a lookup table and then kind of grabbing parts of it. Is that a fair, a fair assumption?

Chris Gammell: Well, it's two lookup tables. There just happened to be one concatenated to the other. And actually one of the kind of interesting tricks is that I actually include a little bit more than one tone. So it kind of can go off the end of one side and down, down to the other when you're going up or when it goes down, it goes from the top down and it continues going a little bit. So that the idea is that whenever I want to transmit it up tone at a certain phase, because that's how, as I mentioned, that's how Laura sends its data is like, well, what, when does this, this, this, this up chirp start and end, um, it's shifted around is I'll just say, start transmitting the bits located here inside of the table. And it will just start sending that bit stream and I'll go like, you know, go the rest of the up chirp and it'll start at the bottom and it'll go back up to where it started. And then I just repeat that for every one of the chirps.

Cnlohr A: And that's, I have a question that might help clarify some of this, the lookup table and the bit stream thing for me is, okay. So now if I wanted to take a radio that works here, which is nine 15, is it nine 50? No, nine. Oh, you said nine Oh three here in the U S.

Chris Gammell: Well, so it's, it's part of the 900 degree spectrum from 900 to nine 15. The uplinks are at nine Oh three. Uh, so Laura, Laura works at many different frequencies over that spectrum, but all we're interested in is transmitting. I should actually point that out. Like this, this is, it's much more difficult to receive than it is to transmit when, when it comes to these weird.

Cnlohr A: And yeah, there's different channels and stuff too. Cause I remember there's like a one channel receiver, like the SX 1276 is the chip that I've used in the past, but that's a one channel receiver. But then you can buy like the eight chance or sorry, one channel send receive, but then there's like eight channel receivers you can get if you're building like a gateway. Right.

Chris Gammell: Yeah. Yeah. Or yeah. Like the, uh, I don't remember what the chip set is, but it's like inside of the micro tech, uh, gateways, the ones that are like used commercially, a lot of places, uh, what they'll do is they'll be receiving on several channels simultaneously. So if any, any message comes in, they can receive that and then they will transmit back at a different frequency. Right.

Cnlohr A: Like a full duplex, right? That's full duplex. Yeah. When it's different frequencies, send and transmit. Okay. So now my clarifying question is I have this thing that works at nine Oh three for uplink in the U S if I want to do the same thing now in Europe, which is eight, six, eight is kind of the frequency I always think of for Laura in Europe. Do I have to regenerate that table as well? Yes.

Chris Gammell: So the table is only valid for one frequency at one SF rate. So one of the things that we didn't mention yet is Laura has different SF rates. I can't remember what SF means right now. Spreading factor. Spreading factor.

Cnlohr A: I was thinking of this as, as you were doing your boops, I was thinking a higher spreading factor would be like.

Chris Gammell: Exactly. Yes. And so if you have more time, like a longer chirp, you can more accurately lock onto it. And so that's how, depending on how you're transmitting Laura, you can get some very long range or shorter range, but faster data rate.

Cnlohr A: Right. Yeah. This is what I, I think they turn up the spreading factor all the way when I, uh, Andrea Spies does a bunch of Laura videos and he had like 38 kilometers or something like that. Like some, like, I know that there's like the world records are like insane. They go up to space too, but like he was doing when it was like 38 kilometers, I think I remember. And it was, yeah, you always do like the slowest spreading factor for that. Right.

Chris Gammell: Right. I mean, yeah. And unfortunately to date, by the way, I've never been able to figure out how to go past spreading factor 10. Um, my code just doesn't work with commercial receivers past spreading factor 10. I've never figured out why. So if somebody out there is, is up for a weekend project and they want to see if they can get this working at spreading factor 12, I'm, I am all ears.

Cnlohr A: And that's on the getting your stuff to work as the commercial off the shelf stuff. Got it. So you see it on like a spectrum analyzer, but you don't see it hitting the pack.

Chris Gammell: Oh yeah. I see it on the analyzer. In fact, I can even use like, there's some code that you can use for software defined radios where they have software, Laura receiver stacks and those even receive it. So clearly like whatever I'm doing is not quite what the commercial ones are doing, but it's close enough that other stacks receive it. So I just, I've never been able to figure that one out.

Cnlohr A: Okay.

Chris Gammell: So, but yeah, so the idea is that you would generate this table for a specific tone at a specific frequency with a specific intonation. And so like, if you're in Europe, you have to make a different table with a different tone with a different, you know, maybe the same intonation, but a different frequency, different tone. And you just have to do that for all of them. And a total side note, you might be wondering like, well, what if you try to generate a frequency that's almost exactly some order of, of the sampling frequency? So like you'd sample a zero at the same time you're trying to sample your signal every single time. So you just get all zeros. The answer is you get all zeros and it doesn't transmit the signal where you want it. So there is a little bit of an art of, of selecting a sampling frequency such that like you get the most number of ones and zeros, like in your output to make it as like powerful of a signal up at what you're trying to transmit as possible.

Cnlohr A: Interesting. So like the entropy matters in this case, huh? Yes. Yeah. Yeah. That's interesting. Cause it is that because the thing that's actually making it go is the, is the transitions right between the, between on and off.

Chris Gammell: Yes. Yeah. Yeah. That's, that's, that's the interesting part. Cause it's not like there's no, you're not like magicing information to the air. It's through turning a wire on and off that you're actually creating radio waves that can then be received.

Cnlohr A: Wow. Well, that's, yeah, that's, that's very interesting. So, and maybe that's tied to your spreading factor thing you think or what? No, not, not really. Okay.

Chris Gammell: I mean, yeah, I, I, I struggled to find a connection there. Yeah. The spreading factor just has to do with like when you have, you know, more time and more total transitions, I guess that that is connected because like if you have a longer spreading factor, you're transmitting for longer. So you have more time and more transitions that are going to happen for that receiver to be able to receive it.

Cnlohr A: Yeah. I guess, do you visualize like the, the chirp when you look at us, like a spectrum analyzer now, does the width of the chirp line matter? Because like you're dealing with, you know, using GPIO to this sort of thing, you're doing kind of like noisy processing versus like a super precise, like driving like a transistor, like RF transistor. Does that width of the, of the chirped line matter? Yes.

Speaker ?: Yes.

Chris Gammell: But personally, I, I always struggle with remembering exactly how that impacts it in general with Laura. If you're willing to transmit wider signals, they transmitted higher rates. And I believe that that's so, okay. They do transmit a higher rates, but okay. Let me, let me try to take it back. Take a step. If you're using a commercial Laura receiver and you transmit, it's a 500 kilohertz channel widths instead of 125 kilohertz channel widths. So four times more bandwidth you can, and you're transmitting at the same power, like peak power, or I guess like signal power. So like over the spectrum, over that area, you're transmitting at the same power. You can actually transmit four times more data in the same amount of time and get it to go as far. But in our case, if you're transmitting some, a signal that's four times wider, then it's also four times quieter. Okay. So if you take the signal and you're generating just a tone, it's actually a pretty strong peak on the, uh, I mean, not really strong. You're still talking about like picowatts, but, um, it's, it's, it's, it's a very, it's a sound better, right? Then, uh, then in the act, the true power. Yeah. That's actually, yeah. DB does. Cause like when you say DB, it's like, oh, well it's minus 70 DB. Oh, minus 80 DB. But no, that's like 10 times less signal.

Cnlohr A: Yeah. Yeah. It really changes the stuff, you know?

Chris Gammell: Yeah. Uh, but, but so, so if you were to like spread out over more signal because, you know, we only have a GPIO, we can't just like turn up transmit power. Like there's just no power there to be had anyway. Then it's like, you're, you're taking what little signal you had and, and you just have such little signal.

Cnlohr A: Yeah. Okay. So we're talking about the, like, what is the main signal relative in, in DBs, I guess. What are the kind of, you're looking at spectrum analyzer. You're seeing, you're seeing these peaks and happen. The one that is actually 903.

Chris Gammell: Yeah. The reason I'm seeing these peaks happen is because I like take the GPIO wire and I put it like six inches from the receiving antenna. But like, even then, what is the, what is the, what is the power levels you see? So I'm not an RF engineer and I, I've always really struggled with this. I mean, I can, I can describe it relative to other things in that, even if I'm only six inches away, radio stations are typically at least five or like distant radio stations, like on some tower, like, you know, miles and miles away. Those, and comparing to something that's like six inches away, typically the radio stations are at least five to 10 times more powerful.

Cnlohr A: Okay. Okay. Yeah. That's good. My relative measure. Yeah.

Chris Gammell: Like if you go like, you know, three feet away, you can barely see the signal at all, at all coming from my little transmitter.

Cnlohr A: That also seems a really good antenna on your, on your spectrum analyzer, right? As well, because you're tapping into that. You don't have any amplification. I'm guessing there.

Chris Gammell: Honestly, I've just, well, okay, that's true. To be fair, when I've been doing this, I have been using nine 15 megahertz antennas because it's just, yeah, but, but you don't have to, like you can use just a regular old piece of wire or like the duck antenna that comes with the SDR.

Cnlohr A: Oh, sure, sure, sure, sure. But like if you buy a transceiver, sorry, if you buy a receiver rather off the shelf, like you have like, what do you list to some of your receivers? You have like a micro tick LR nine, right? That is coming with a, uh, antenna. It's coming with a specifically tuned antenna specific for minor megahertz. Giving yourself the best shots. I feel like that's, that's important there. So yeah, no, you're right. All the, all these are like relative to, to your full setup. But I, I, what I'm remembering is like, I had a not so great. I still have a not so great spectrum analyzer, uh, uh, old tech scope, like a built-in. And it's like, so it's not that great of a spectrum analyzer. I put an amplifier in front of it. I put a good antenna on, on front of that. Then I was able to see some lower signals and I was like trying to see them sort of thing. And it was still very close. You know, it was just like my setup wasn't that good to start with.

Chris Gammell: So like, yeah, yeah. And that's another thing to point is so like, I had actually switched to using an air spy from RTL SDRs. Okay. And, and that's like a massively better receiver that has a really good front end PA, like the front end amplifier. And even with that, I was having like a hard time seeing these signals at all at just a few feet. And so like that sort of, I guess what, um, I guess let's finish the, the, the first that, that part of the story. Um, so I had, I had, you know, the wire wrapped around the LR nine and finally, like I was seeing something it was, it wasn't properly decoding into actual signals, but I was seeing something. I had assumed that that's something that it wasn't working. I assumed it was cause it was just like, well, maybe my signal is just too bad, but it turns out that no, the LR nine was able to say like, Hey, there's something here. I can't decode it. Like I can't even figure out at all what it is, but there's something here. And that was sort of like, I was like, wow, it's getting something. And I just assumed that it was that the signal was just too ratty for it to pull out what I was after. But it turns out like there, there was just bugs in what I was trying to do because like the idea is that all of the code that generates the protocol level for Laura, for me is all in this one, this one file, uh, Laura SDR code.h, it's like 600 lines of code. And there were, there were legitimate bugs in there that over time between like Frank and me sitting down and trying these different signals, um, we were able to kind of tease out where the, the bugs were and, and then it became really reliable. And then I was able to like actually move the antenna like a few feet away and it was still getting through. And then maybe a few more feet and it wasn't getting through again. And, and, but like, it turns out like that, that even that was actually legitimate bugs where like I was doing something that was causing most of my packets not to get through because of some bizarre thing. Or like I was, I was missing coding a lot of the bits, but the error correction that was built into Laura. So even though I was transmitting the wrong thing, there was enough error correction that the receiver was able to kind of figure out what I was trying to say. And it's funny. Cause like I spent a vast majority of my time trying to like figure out like, okay, is it this, or is it this here? Like, how do I actually transmit this little, you know, what should I, should I, should I, should I be doing ones and zero? Like, what should I be actually transmitting? And, and not a lot of time figuring out what the RF stuff, but sort of going back and forth between a CH 32 V two O three or O three. And which is just this pure bitstream synthesis versus an ESP 32 S two, which we haven't talked about yet, but there's this whole other way that you can generate it, which is creating the square wave, which makes nice, clear harmonics with a PLL. So the ESP 32 S two has a PLL that can be ultra fine tuned down to like, I think you have 16 million unique tunings for any, no more than 16 million unique tunings per input signal. So you can hyper fine tune that thing. And I was going back and forth between these and I finally got stuff going on the OO two, sorry, not O two, two O three. And, and sort of like, we kept working at it. I guess it was like, Frank would come over some days. I would just work on it some days and we finally got it like transmitting and it came time to like actually test it. And so I was, when I'd started out, we were barely, barely able to go a few feet, let alone like anything significant. Uh, my girlfriend came over is like, okay, so let's see, is it going to be 20 feet? How far is this thing going to talk? Um, once we get this thing down, like working and like, so she walked across this one parking lot and it's like, no, it's, I'm still getting some of the signal. And then she walked across the street and this other thing. I'm like, well, I'm, I'm still getting signal. And like, when she left line of sight, I couldn't get the signal anymore. And I'm in downtown Bellevue. So it's like, right. There's just not the quietest environment. No, it's, it's a loud, loud place to be. And so we finally just decided to go actually out into the suburban area. And like, we were still getting these signals through like 500 feet. And like, you know, we just kept going like 2000 feet at one, like for the next one. And, and finally we're just like, okay, put it on a drone. Let's see how far this thing goes. And we were getting like over a kilometer of access out of just, just ratty little signal. So it's, it was for us, it was just wild because even when we were testing sort of in the lab configuration here, and to be clear, like when we're transmitting these signals, they are extremely low power. And for the most part, I do it inside of like a room that's relatively shielded. I only have done these for doing the range tests for brief periods of time. So don't, don't, don't, don't make a project where you're blasting this stuff out all the time. Exactly. They will find you. Yes, I'm confident. But we just kept going. And even though in the lab environment, we were having trouble at first at like a few inches and then a few feet. We just never expected it to just keep going until, and actually the wild part was that we had not even tried doing the ESP 32 S2 since doing all the work on the, the two Oh three was just so much more promising, but it turned out that like in fixing all of those bugs on the two Oh three, when we backported it to the ESP 32 S2, all of a sudden it just went, it just, it like, it was cooking. And we, I don't remember the actual distance, but it was when we finally like went back at the end of the day and like did like the full distance measurement that we could. Yeah. We got, uh, 8,000 feet or 2.5 kilometers out of just this, like just these two little wires hanging off of the swadge. Wow. The swadge being a, like a ESP 32 S2 dev board.

Cnlohr A: Oh, got it. Okay. So the, uh, the PLL that's on the ESP 32 S2 that what is the, what's the max frequency you can get out of that thing?

Chris Gammell: So it's kind of funny that it works out this way. It tops out internally at, uh, give me a second here. I just typed something into a calculator and was doing it in hex. Uh, it tops out internally at around 270 megahertz. Um, and there's a lot of part to part variation there. So some will go up to like two 90 most will stop at around two 70, two 60. I think officially they support two 50, but unfortunately, because of the way they set up their clock tree, the most that you can get out of the part is that divided by four. So when I, when I'm transmitting these like 900 megahertz signals, I'm actually transmitting like a 69.53 megahertz signal is what's actually coming out. But because it's a square wave, there's a little bit of noise up at 900 something megahertz, 9039.

Cnlohr A: Which, and which, uh, harmonic is that? How many harmonics up do you have to go? Let's see.

Chris Gammell: Uh, 13. That's the 13th for the ESP 32 S2. It's the 13th harmonic.

Cnlohr A: Got it. Yeah. Yeah. So if you're starting lower by just having like toggleable, you said six megahertz on the CH 32. Is that right?

Chris Gammell: Uh, no, it depends drastically. So, um, on the CH 32 V two Oh three, we, we get this really nice thing where we can transmit a bit stream at 72 megahertz.

Cnlohr A: Okay. Yeah. The higher you start, the better off you're going to be right. That's, that's the word I'm really getting at is like, you start at a higher frequency coming out of the pin, the better off you're going to be because you have to be clear.

Chris Gammell: It's not, it's not a hundred percent of that because for instance, on the ESP 82 66, when we use the direct synthesis with the bit stream, remember how I mentioned that if you have, if you're generating a frequency that when it aliases down, you end up getting very few transitions, it's very low power. Uh, sometimes by reducing that speed in which you're outputting the signal, you can end up putting the signal you're trying to generate right in the sweet spot, right in the middle where it's going to get a ton of transitions versus if you go up in the frequency that you're shifting out. Now all of a sudden it's putting that frequency you're trying to transmit in a sort of no man's land. And then, then you actually lose, lose quality. Got it. Got it. Also total side note. One of the fun things that you can do with an ESP 82 66 is control its clock tree. Exactly. And that's the, the Espressif doesn't document their clock trees anywhere, but the clock tree in the ESP 82 66 was simple enough that people have been able to completely reverse engineer it. And so what you can do with that is it means like now all of a sudden most SPI like outputs on things or shift registers, they top out at, you know, 10 megahertz, 20 megahertz, something like that on the, um, on the ESP 82 66, you can gotta get my calculator out of hex mode. Uh, you can actually output a shift registered around 190 megahertz on an ESP 82 66, that older chip. But that's just because people have been able to completely reverse engineer the whole clock tree. So if you want to get like the absolute best shot you could possibly get it outputting signals with direct synthesis, which is what this is where you're just turning a signal on and off ESP 82 66 is actually are surprisingly basically the best you can get right now.

Cnlohr A: Interesting. 82 66. Huh?

Chris Gammell: Well, at least it's low cost. That's good. Yeah. And it's yeah. The stack I use to develop on the ESP 82 66 is it's just like a super bare bone stack. So you don't even have to have the whole IDF or anything like that.

Cnlohr A: Yeah. I think we, yeah, I think we mentioned that last time. Okay. So what is doing the heavy lifting out here? I mean, obviously your brain, uh, but you know, you're, you're shifting all this stuff out of GPIO. And then is it the receivers that are doing like kind of the, is it the driver of the pin? Like the current flowing through the MOSFET, like from gate to source? Is that doing the, the, the hard work of like getting this, this data to go farther? Or is it really on the pickup side, like on the receivers that are like really digging it kind of out of the dirt then?

Chris Gammell: Well, on the transmit side, when you're turning that wire on and off, I don't know. It's kind of easier to conceptualize. If you think of it as a capacitor, it's not really a capacitor, but if you think of it as like a capacitor on the pin, there's very little current that's actually able to be radiated out that wire. Because when you turn the pin off to on or onto off, most of that, it's just turning a pin on and off. It's not, it's not driving anything. Only a tiny fraction of that, that power that goes into turning it on or like not even power, only a tiny fraction of the potential that's going into turning that pin on and off is actually being radiated. Like microscopic amounts. Like, I mean, we're talking like less than one 10,000th or 20,000th of that, that potential is actually being radiated versus on something like an ESP 8266 or ESP 32, or, you know, one of the actual like SX 1270 chips. Those are a lot of the power. Most of the power that is going into turning that on and off is, is actually being radiated. So I would say that the heavy lifting really is in the receivers that the commercial receivers, because they, they are really able to pull the signal out of the mud. And it's, it's not the hardware that's doing that. The hardware is sampling. It's that because of the way the LoRa protocol is, is set up, when you have a bunch of samples of what is the potential on the air at this time, and you're receiving that when you look at all of those samples all together and you know exactly what you're looking for, you can really find a very quiet whoop in the middle of a lot of noise.

Cnlohr A: Yeah. Yeah. Interesting. Okay. So you've got this now, you've got this distance stuff, and this is all, I guess we, you know, we should say that hopefully it's been obvious to people that all this stuff is already documented in the video. Right.

Chris Gammell: And, and, and I wrote the GitHub. If you're somebody who likes reading the GitHub, all of this information, not all of it, almost all of the information that's contextualizing a lot of stuff here, folks. So I, I, you know, yeah, I tried to update basically like think of the GitHub page as a write-up, like primarily, I mean, I don't even know how many pages it would be if you printed it out, but the, the GitHub page is quite long.

Cnlohr A: Yes. It's great. It's great. It's like a intro and a lot of links out to, I, one of the things I mentioned before that we started recording too, is that like you use some of Matt Knight's stuff. Matt has done the show as well. So that Matt has some great write-ups as well. And obviously you can listen to the episode if I'll link the episode in too. Yeah. Just like there's tons of good resources, but one of the things you kind of referred to as well is that like, it's not, it's not super well documented because it's, you know, this is a proprietary protocol that Semtech owns and licenses out as well. So it's not like they want people to replicate it. So you really did have to work with some reverse engineering and get this working. So that's. Yeah.

Chris Gammell: Yeah. There's a lot of, there's a lot of resources, but all of it, you just, you have to test it because so much of it was like, it was like right on the surface, but then like the details weren't quite right for a lot of the stuff. And it just, it took a huge amount of trial and error to get it to actually like, okay, how do you actually get this thing to actually work? So, yes.

Cnlohr A: I always find that when I'm, when I'm doing stuff with like, I mean, I'm always just using like the ESP 32 and like stacks on stacks on stacks on stacks, not in the money sense, but in like the, I'm basically just saying like wifi dot on here's my SSID and the password, please send some data for me. You know, like that's like the level that I'm normally at. And like, like just the layers that is all built upon. I never even think to, to dive all the way down to the bottom, but that is an awesome move to do that sort of thing.

Chris Gammell: You know, I think if more people did it, it would be a massive, this is just me giving my Jeffersonian, you know, but I think if, if more people used the appropriate part, like layer of the stack that they're trying to use, I think everybody would benefit massively from it. So like a lot of times you see this in web dev where somebody will use a framework, which uses another, like, you know, module of this other thing of this other thing of this other thing all the way down. But what you find is you find these loops in the abstraction where there's been some piece of the abstraction that you've tried to recreate that actually, if you had just not used the top seven layers or something, you would get exactly what you're after. So an example of this would be like, if you're trying to just get the newest signal of the newest data to a bunch of devices, like I have a wire, I have an ESP 266 and I want to send a signal to a bunch of them. And if I don't get it, that's fine. I don't care. That's just an example of something you could do. And like, I don't know, lighting up a bunch of lights in somewhere based off of something. And if they don't get the message, that's fine. Cause I'll just, I'm updating it a lot. A lot of times, sort of the way that people will think about how to approach that problem will be to think in the terms of the very high level stacks that have been developed, such as like, oh, well I could put it on some sort of like high level, like I can use some higher level protocol that's on top of TCP. And then I just have to associate all of these ESP 266s to this AP. Now, when this ESP 266 sends a message to the AP, or like, I guess it has a bunch of connections to all the devices that it can send to all the devices, the signal, then I can send the things to light up. Now, from a conceptual standpoint, oh, well, I just include this library and this library handles that. But you've ended up making something that is far more fragile, far more sophisticated, having lots more unusual latency involved, all of these other problems versus if you just used ESP now to broadcast the packet and all of the other devices could just be listening on ESP now and receive the packet when they receive it. The complexity of that system is like literally in order of magnitude less. And you're going to reap so many benefits of much lower latency and much lower just problems that you're going to run into and weird things because every one of these layers of abstraction have just like separated you. Yeah, that's my whole thing. It's like, I just think that if more people did that, then more people would be aware of and the other layers would be more fleshed out for like just direct use.

Cnlohr A: I think a good way to wrap up that talk would be, thank you for coming to my TED talk, right? Yeah. Yeah, that's good. No, I agree with you. I think, you know, it is kind of like right tool for the job kind of thing. And it does sound like that. I was, as you were saying that, I was thinking the people who do robotics with JavaScript and I'm like, yeah, like it's great.

Chris Gammell: I mean, the tables for my video NTSC thing are all written in JavaScript. So don't like, it's okay.

Cnlohr A: JavaScript is bad. JavaScript by itself is not bad. It's just like the framework on framework. Like you said, like layers and layers and layers.

Chris Gammell: To be clear that that isn't using any framework. That's just JavaScript.

Cnlohr A: So yeah. Yeah. Yeah. Okay. So now one of the things that you showed in the video as well is that you were also able to interface this. So you were talking about with the drone, you were basically sending point to point using Laura from a transmitter on the drone back to a receiver over vast distances. But you also mentioned something talking to Laura Wan as well. Is that right? Yes. Okay. So that's another layer we've talked about in the show before. That is, I feel like it was always a thing that we were trying to disambiguate, but now we've, we've been building up from basically GPIO. So now we're like at protocol. Now we're moving up into network, right?

Chris Gammell: Yes. So the reason why a lot of this became interesting wasn't just that, Hey, there's this weird RF protocol that maybe we can send on because there's lots of our protocols. We can just make up our own protocol and do whatever the heck we feel like, as long as it's, you know, really low power or that it's, it's kept into the parts of the spectrum where we can transmit more power. But the interesting part about Laura is that there's a lot of Laura gateways all over the place and a Laura, Laura Wan gateway. Laura Wan gateway is something which will take packets, which are going out over the air and transmit them over the internet back to, so you can get them anywhere. This is used in like HVAC systems and sometimes in like various, like trucking, transportation things, stuff like that, where the idea is that like, Hey, I want to be able to transmit the signal from anywhere and I want to be able to receive it on my server.

Cnlohr A: And the internet do the long distance work basically. Right. So you have a wide net of receivers, but then the internet does the lifting.

Chris Gammell: Yeah. There's, it's a whole just network kind of just all over the place. And I'm not saying that it's everywhere. Where it doesn't have the same coverage as like, you know, if you have narrow band IOT and making your device talk back through that. But it is, it is a pretty serious network. And like there, there's actually like three or four access points inside of my city within like a couple blocks of me, even I gotta be honest. I hadn't actually tried deliberately transmitting these packets to see if there was another, I should have done that. I should test to see if there's one with an earshot. But the idea is that these gateways will receive these packets and forward them to, you know, like appropriately to the internet in, into a direction, which if you want to receive that specific packet and you have the appropriate keys to do so, they'll send you the packet over the internet. So now all of a sudden, if you're, you know, uh, on the other side of the world, somebody could, you could give somebody a firmware blob, they could flash it. And now you can receive data from their device from the other side of the world. And that's kind of the interesting part there with Laura Wann is that it gives you this extra framework, this extra, like it's one more layer of encapsulation. I don't know how much I hate encapsulation, but like it is, it has value in it. This one extra layer.

Cnlohr A: When you said the receivers you have in your town and stuff like that too, are you specifically talking about the things network or are you thinking about talking about a different?

Chris Gammell: Oh, there's, so I'm, I'm lumping together the things network and the helium network.

Cnlohr A: Got it. Okay. Yes. Right. So, and those are basically publicly accessible, often sometimes volunteer run or backed by tokens. Yes. Yes. But basically open ones. Cause you can also have private Laura Wann networks, which are basically, you're setting up your own access points. You're setting up your own network infrastructure using something like chirp stack or the, the things industries privatized version of the things network. That's another like layer of disambiguation. I feel like we need to do where like you can use other people's infrastructure either because it's community based or sometimes it's paid even. So like that sort of thing.

Chris Gammell: Yes. Yeah. And so like, it's not just that like you can use them, but you can really use them. Yeah. Like there are limitations with it. Like you're not supposed to be doing it like a ton, ton all the time, every day, like all day. But like, you don't have to go in and set up a gateway yourself in order to receive these messages, you know, for whatever it is you're trying to work on.

Cnlohr A: Yeah. It's almost like, at least with the things network, which is the one that I've seen the most, it's like volunteer run. Basically people host their own gateways. They donate the bandwidth to backhaul and then they tie in because of mutual benefit with other people that are also on the things network. Yeah. Yeah. Yeah. It's pretty cool. It's pretty cool. Okay. And so then what were you then transmitting? How much like overhead was there then to then put on? So now just thinking of this, this swadge that was on the drone that you wanted to go through a gateway, how much overhead did you have to add? Like in terms of like network keys and stuff like that, was it just like one set of keys that you have to kind of put into the software or what was the level of things you had to add on to make that work?

Chris Gammell: Actually, let me go look it up right now. It is in one file, laurawansimple.h. It looks like it's maybe about four bytes for the LoRaWAN header and four bytes for the check and another eight bytes for like actual addressing. So yeah, it's maybe about 16 bytes a little bit, maybe, yeah, about 16 bytes. It looks like. Yeah. Of overhead. Yeah.

Cnlohr A: And you had to like basically pre-provision and say like you had to go to the things. Yes. Yeah.

Chris Gammell: So that's, that's another major note is that for LoRa, LoRa devices, typically you will activate, the device will hop on the network and activate with the network mutually. Whereas we only transmit. So if you want to associate to a network, you have to do something called activation by personalization, which means that you directly program in the specific keys to the device.

Cnlohr A: Yeah. Right. That's basically like username, password. You get an encryption key, you use that to encode your traffic and then you're. Yes. You're a-okay, right? Yeah.

Chris Gammell: Well, there is no username, password that's done on the front end. Sure. It's the network key and the device key and you have to give it a device ID. So it's, it's three things. It's network key, device key and device ID.

Cnlohr A: Yeah. I, the username, password is just the way I talk about like pre-shared keys in general. You know, it's just the easy, the easy analog when I talk about that sort of stuff. But yeah, yeah, totally. It's, it's different, different information. And that's the other interesting thing is like coexistence of like multiple users. So like, if I was so bold to say that I had one and you had one and we're both going through the same server, it's not like I could like peek at the network. Well, I guess I wouldn't have access. Even the, the operator of the, the gateway doesn't have access. They don't have the keys for any, any old random packet. It just says, Hey, this packet is allowed to go through, please send it through. And then it's not like they're decrypting the data though at that gateway and then sending

Chris Gammell: correct. It is a bit of a strange threat model in that, like they went way out of their way to make it as secure as they could feasibly make it. And the, the people who are ferrying the data to the network can't see what's inside the packets. I don't want to say camp, but it's, it's pretty secured. But as soon as it hits the things network, the encapsulated data is completely decoded and stored on their servers. That said, you could add another layer of, of encryption if you want it on top of that. But the reason they do that is because they need to figure out where the data needs to go and how it needs to be routed. And they have to look inside of the packets to figure out, well, what, what is it that it's actually trying to send to so that it can send.

Cnlohr A: Otherwise you'd have to put like readable metadata outside the encryption. And that point is like, it's like your, it's like nesting dolls basically. So at some point, one of the dolls you open has to have the, oh, please deliver this to Chris Gammell at North Carolina sort of thing.

Chris Gammell: And, and so what that means is that people who are running the gateways can't actually see who the packets are supposed to be going to or what the data contains. So like, you still have to have a fairly high level of trust of the things network themselves, but you don't have to trust the people who are running the lower land gateways at all. Interesting.

Cnlohr A: Yeah. Well, we were already way, way deep into this episode, but one of the things you and I were talking about before the episode is one of the things that's enabled all the, a lot of this stuff too. And well, I guess we did kind of refer to it, but like the, so the CH32 V003, we talked about last time we mentioned some of the things that are maybe possible with new parts. And we were going to talk about that too, because that might end up feeding back into the Lowell repository. And, and then also like just some of the new things that are possible on these newer, newer versions. Yeah.

Chris Gammell: Yeah. So that's actually a lot of that plays directly into the story of one of the things that from the last episode that we were talking about is the CH32 V003 fun, which is basically a, like a, a development environment for the CH32 V003. It's a 10 cent processor, which is basically a mountain of examples. And the core of it is just enough to get the chip to wake up and handle interrupts. Like when you make it as small as you can, it's like 128 bytes of, of flash. I think is the minimum, the minimum incarnation. I don't recommend using it. You have to know certain things with that, but you can get like for a pretty, pretty good setup around 300 bytes of Ram will get you a lot of stuff and around maybe like five, hundred bytes. It'll get you even like print F back to your host. Like it's pretty stripped down. And it means that you can develop things very quick iteration. And also when the overhead of the tool, the, the, the, the, the environment is small, you have a lot more room to play with for your actual application, what you're trying to do. And so people have like really taken that and run. I mentioned the earring thing before that was by a Metaxilla. They did some really cool projects with this. They also did a, like a MIDI adapter, a USB MIDI adapter with the OO3 that fits inside of a MIDI connector. Wow. Like a bunch of interesting projects with that by like having it really tight. And a lot of other people have done interesting things there too. Uh, but, but for this project, um, I was like, well, I really want to try to use the two Oh three. Uh, the two Oh three goes at 144 megahertz. See, it's 32 V two Oh three. That is. And it's, it's a lot like the O three. It's pretty cheap. It's like 24 cents, I think, but it's a much more powerful processor. And so since I have a transceiver as well, a USB transceiver.

Cnlohr A: I thought one of them. Uh, yeah.

Chris Gammell: Two or three has a USB transceiver. It does.

Cnlohr A: Yeah. Okay. I remember one, as you moved up, it did. Yeah. Okay.

Chris Gammell: Yeah. The, Oh, actually the XO three five is probably the best one. If you want like a USB device. Cause I think that's like 18 cents or something or 15. Uh, and, and it's also completely self-clocking. So if you use the CH 32 X O three five, it has no external crystal whatsoever. And instead what it does is it uses the, the soft packets coming from your host, uh, over USB to precision time the internal chip. So it actually like locks to the right, to the same frequency your host is on. Highly recommend the, uh, XO three five, very cool chip. Uh, but all of these now have support in, in CH 32 V double O three fun. Uh, a lot of it was done by Alexander M and, and other people from the community, but I was able to like leverage that work. And then when I was working on the Laura stuff, I was able to use the CH 32 V two O three to do a lot of this and, and to leverage sort of like it has a much higher performance, uh, SPI engine than the O three, the, uh, to, to transmit these packets on the O three, it looks like utter garbage and it does work, but it doesn't work very well. But when, like when we were transmitting the packets with the two O three, those were able to go much, much further, much more cleanly. Like for the, uh, the two O three, I think we topped out at around, yeah, about half a mile or, uh, 829 meters. That is unless we, uh, overvolted it, which was a lot of fun. Cause then that was able to go like over a kilometer, send the packets over a kilometer. The O three is rated to five volts. The two O three is not officially rated to five volts, but it seems to work just fine. So.

Cnlohr A: Yep. Yep. X experiment experimentally proven. You have mentioned the community a couple of times. You kept mentioning these, uh, these usernames as well. Maybe a quick shout out for the community because people can also interact with you there. I mean, we'll do this again at the end, but you can also like contribute and like play along. You know what I mean? Like this is, it's a great community.

Chris Gammell: Yeah. Yeah. Yeah. Yeah. So, uh, one of the things a lot of people have kind of been doing is what they'll do is they're like, well, I want to be able to use X peripheral on, on Y chip. And I may not have an example for it, but maybe there is like an official example, but one of the problems is a lot of the official examples are licensed in really restrictive ways. So what people have done many times is like, if you want to like play with a certain feature of a certain one of these chips. So what you could do is you can get it, go read the technical reference manual, figure out how the, that part of the chip works or whatever it is you're trying to accomplish, create an example. And then that example gets rolled back into the main CH 32 V double O three fund repository. And I would say the vast majority. Yeah. I think the vast majority of all of the examples are by other people than me. And at this point, like I'm, I've probably done less than 30% of the work overall, especially in supporting all of these other chips. Like other people have been like, oh, I really want to add support for whatever that is. And then throwing it in the repo. And then, you know, we have to, you know, you can't just throw it over the fence. Like we have to actually work through it and like, make it like fit really well. But people have really kind of taken this and, and made this thing, which was supposed to be a cute little repo for just making this chip wake up and blank to, um, to now it opens

Cnlohr A: its eyes and it eats everything alive because it's, it's, yeah. Yeah.

Chris Gammell: I mean, heck there was a, speaking of it opening its eyes, somebody even ported, um, are you familiar with the MNIST database? No, it's, uh, it, they're able to run an AI. I handwriting recognition system on a CH32 V double O three. Uh, they also used O three fun, but yeah, there's, there's been some really intense stuff people have been doing. So yeah, there, there's a, a, a lot of just community out there surrounding this. It's, I don't know how to explain it. It is something where it's like the O three has the right mix of, of enough horsepower to do really interesting things, but it also doesn't have so much that you feel driven to dumb it down. Um, there was somebody who recently like said a quote, which was, uh, something like if you give a man, uh, a cortex M zero plus whatever, Oh, here it is. Uh, give, give somebody a cortex M four and it'll be too cumbersome to implement cool hacks, but give somebody a grain of rice that was tricked into doing computation at a few megahertz. They'll bit bang USB and USB PD on it. Um, that was my spirit. And, and like, that's really true. Like you can do, this is enough horsepower to do really interesting things, but not so much that like you, you can't get away with running Zephyr on it. I mean, maybe you could, but you shouldn't like, you know, you shouldn't. Um, and, and so it just, it opens the space for some really interesting things.

Cnlohr A: Yeah.

Chris Gammell: That's awesome.

Cnlohr A: Well, okay. So then people are doing this stuff in the O three, but you are really excited about the O five and O six, which are yet to be released in, in process of being released.

Chris Gammell: Yes. So one of the things that just happened two weeks ago was there was a, uh, product selection guide, which leaked from, I don't want to say leak. They did. I think they didn't intend to talk about it at the time. Uh, leaked out the front door. Let's put it that way. Where strategically. Yeah. Yeah. Maybe. Maybe. Yeah. Possibly. Um, where WCH mentioned that there are now going to be more chips in the same line as the O three. So to be clear, like this space mimics the ST line series of microcontrollers. So sort of like you have the CH 32 V zero zero three, which means like the really low end, the really cheap chips or the one Oh three, which has like some basic features like USB and whatever the two Oh three, which is a much more powerful chip with like some, some extra features, even like the three Oh seven. So C 32 V three Oh seven, which has like a literal gigabit five. Um, okay. Yeah. Just to like, like show how much this gamut runs, but, um, no, they, they like leaked in air quotes out that there's now plans for a C 32 V. Oh two, Oh five, Oh six and Oh seven, where they sort of like refined a lot of the other aspects of it, as well as giving it a pretty hefty, uh, S Ram and flash bump where like the Oh six and Oh seven have a 62 kilobytes of flash and like a three kilobyte bootloader versus the Oh three at 16. Um, but also they refined the hardware to like the ADC now can do three mega samples per second on these tiny little chips. The op amps that were built in that they, you know, previously a pretty rough op amp in the Oh three now has like, they're adding a high speed mode in the Oh six, which will let you have up to like 64 megahertz of gross bandwidth product bandwidth out of the, the op amp built in. And so like you have the situation now where there is the, there are these microcontrollers that have peripherals, which are performing like the discrete peripherals of much more expensive chips, like an op amp that would perform similarly to the op amp in the Oh six costs more than the whole Oh six. Like these very interesting things have now are starting to happen where, uh, and, and the two Oh three or sorry, the Oh three has been firmly in this already where now you have a chip, which is cheaper than any I squared C IO expander on the market. Yeah. Oh man. Those things are a rip off anyways, though. They, then they're always, I get it. But at this point, like you have no excuse to use those IO expanders because like, I mean, I guess if you really have to use it, okay, sure. But you can, you can get this chip and you can flash it and it can mimic, it can, it can be a better IO expander. You could do something more creative on it or just make it. So it's a really dumb IO expander. And it's cheaper than just an IO expander. Yeah. And I do want to caveat that. I do want to point out like a lot of people are concerned about like, Oh, but like, I don't want to have to be able to worry about managing firmware revisions and all that. Well, first of all, make your IO expander code simple by using, you know, Oh, three fun. And if you make things simple, you don't have to worry about firmware operating. But then the other side note is if you want, just run, make the way you talk to this IO expander over the SW IO pin. It's a single pin off the side of these chips where you can flash them. You can debug them. You can print F through it. You can send and receive data and you can send and receive data without code on the other side, having to be intercepted for it. Like it doesn't use resources on the processor to send and receive data out the debug pin.

Cnlohr A: So you're saying if you were creating a GP IO expander, you would actually just have a

Chris Gammell: single wire IO. I would just use a single wire. And in fact, I have a project, which I'm working on right now. I may or may never finish it where I'm using all eight channels of the OO3, even though officially the OO3 doesn't have touch. You can configure the ADC in such a way that it works very, very well as a capacitive touch sensor where I'm making an eight channel analog capacitive touch sensor out of an OO3. And the only way I'm talking to it is over the debug interface, that single wire debug interface, because I can, I don't even have to flash it. Like that's like the other thing is like, I'm a little piece of me is hoping WCH makes some of these parts without any flash, because I don't want to flash it. I just, when I power it on, I want to tell it what it is.

Cnlohr A: Yeah. That's interesting.

Chris Gammell: And there's more than enough SRAM to go load the code into SRAM and you can run from SRAM anyway, and it runs faster from SRAM anyway. Yeah. There's just, there's no, no reason not to really do that.

Cnlohr A: So wait, so then, okay. So then the thing controlling it over SWIO, what is, are you writing, you have a different library that just controls it over the GPIO from another. Yeah.

Chris Gammell: I have, I have a library written for the 203 right now. Sorry, a few different processors, but primarily the ESP 32 S2, because that's what my programmer uses is the library I frequently go back and use. But it's, it's just an GPIO library where you just, you basically like have to give it like a delay function and to turn this pin on, turn this pin off and turn this pin into high Z state. And it will handle the rest of the whole stack for you.

Cnlohr A: Wow. That's great. Yeah. That's really great.

Chris Gammell: You can say like, Hey, dear stack, please write this into the debug register. Or dear stack, please write this blob of memory into the Ram on the OO three. And it will handle writing that memory to the OO three in the appropriate region or, or boot or, you know, whatever it is that you want it to do. Uh, just a little bit of insight.

Cnlohr A: Like layer on it as well. So like the ESP 32 S2, like talking to like a CH 32 VOO three, would you then be able to run that library on that CH 32 VOO three that then controls a bunch more? So you get kind of like that expanding universe.

Chris Gammell: I mean, you can, but then you end up having like, well, now it's kind of slow. Cause you're going to have to talk to each of these things. Like I, yeah, I mean, I wouldn't recommend it, but you could. Yeah. Yeah. The, uh, I guess one of the side notes there, the, one of the really cool things about that debug interface is that instead of it being like a complicated protocol for, for setting things up, what all it really is, is it gives you access to this, this little scratch pad where you can write code into the scratch pad. And then you send a command and it just executes the code on the pro it'll pause execution of the process of the program running. And it'll just execute the code on that scratch pad. So like, if you want to go, you just write risk five code to do the flashing, you just write risk five code to do the writing or whatever it is you're trying to do. Like, that's just how it works is that you just write the code over the debug interface. And it's just, it's like a direct thing into the processor's brain to just go execute this.

Cnlohr A: Yeah. Huh. That's really cool. And then, because then from there, you can also then replace memory. Like you said, you said you want to write it dynamically, right? And you want to load it up dynamically, but you're saying.

Chris Gammell: Personally, for me, my kinds of things, I don't really want to worry about managing, making sure that configurations are correct, but like firmware blobs over here and not over here. And what I really want to do is just whatever processor is kind of the one in charge. I just want it to know like, oh, when I wake up, I just have to go write this into all of the chips RAM and then it'll do the right thing.

Cnlohr A: Yeah. That's yeah. That's a really cool idea. I like never thought of that idea. That's, that's a really interesting idea for me. Like I've never, I never thought to operate like that. Does that then speed up your iteration cycle as well? Like, is that another thing that kind of helps that?

Chris Gammell: Oh yeah. It means that you don't have to like have multiple programmers connected to something and it just, it simplifies a lot of that. So.

Cnlohr A: Yeah. And then how do you, is it always, then you're always pulling that and like pulling data back from it or does it. Yeah.

Chris Gammell: That is one of the drawbacks. Um, and, and there's not really, there's no, I mean, maybe somebody, well, actually I, there is somebody I'm aware of who commercially took that library and made one that uses the DMA on a Nordic chip. I, this is not public or not. Um, it's not, it's not private information, but it's not a public. It's, it was never commercially or it was never released as open source, but like it can be made to be done in such a way where you can leverage host hardware. But as far as I'm aware, there's just no open source stacks right now that can do that.

Cnlohr A: Huh? Yeah. Yeah. It's just a different paradigm than I thought of. Okay. So then the op amp that's on there, what are you usually using that for? I mean, at the 64 megahertz.

Chris Gammell: Oh, um, okay. Well, this is just to aside for me, this is fascinating because it now all of a sudden opens up possibilities for doing much higher speed optical communications with a reverse biased photo diodes. Huh? Like that's something that I've wanted to do for a long time, but just I've, it's, it's so hard to get good, good op amps. So now I'm really fascinated by this because it's a really supposedly on paper. We'll have to see when it plays out. Um, but it's exciting because like at some point I'm going to get one of these in hand, I'm going to hook it up to a photo diode. I'm going to see, well, how, how fast can I send and receive data to these things over optical means? And I'm really curious to see what that got it.

Cnlohr A: And so you need the op amp in that case. Cause you're basically like using it as a photo multiplier, not a photo multiplier, but

Chris Gammell: like a trans trans impedance amplifier.

Cnlohr A: Yeah. Right, right, right. Okay.

Chris Gammell: Interesting. Uh, I, I encourage you to read the Wikipedia page on it cause I'm not going to be able to articulate or explain it here. Uh, if you want to know how to, it's basically, if you want to know how to measure voltage to current, really tiny currents.

Cnlohr A: Current to voltage converter with a really, really big resistor in the feedback loop. I used to work on really big, slow ones that were like electrometers. That was, oh, I think. Yeah. Yeah. Well, that's cool. That is. And then what is your guess? I mean, do you think it would be that 64 megahertz or, or you think you could get some kind

Chris Gammell: of, Oh no, no, no, no, no, no. I would, I'm targeting for me. Okay. It's total side, side note is if I can get to three megahertz, three megabits, then I could even do things like, well, I'm not giving away the farm.

Cnlohr A: Yeah.

Chris Gammell: Let's, well, yeah.

Cnlohr A: Maybe there'll be another interview sometime later. Future. Yeah, exactly. I will just put you on the calendar for a year from now. I'm sure. Yeah. Figured out. Yeah. Okay. Any other things that are on this part? So when, when we were talking about it before the show, you said like, this is the new jam, right? This is the new, this 0, 06 is the 06 is like the new jam. Are there other things on there that are particularly interesting? Okay.

Chris Gammell: Well, the reason we'll also have to see is cause like, we don't, we don't know what the price is going to be yet. Yeah.

Cnlohr A: Yeah. True. True. True. Yeah. I'm guessing they WCH would love to move up market as all chip companies do. I'm sure, but that's okay.

Chris Gammell: Like it is, they seem committed to keeping the price of the 003 what it is. So, um, yeah, we'll just have to see.

Cnlohr A: Cool. Yeah. And this one does not, does not have USB on it, but it will be able to, it'll port RV 003.

Chris Gammell: Yes. I will make sure that RV 003 USB works on it. It does not have dedicated USB hardware, but again, uh, there really is a lot of is a really good solution for that right now. And the CH 32 X 035 it's, it is, it is very simple to use. It is a very good USB stack.

Cnlohr A: And that'll go higher speed then. Uh, cause the RV. Oh yeah.

Chris Gammell: So to clarify RV 003 USB is a low speed USB stack that talks at 1.5 megabits per second. Yeah. Right. And realistically, you're only actually able to use about half of that for actual useful data transfer. So like one of the, Oh, by total nice thing about that is it even supports like hit API. So you can do like web USB in Chrome to your CH 32 V 003. But, uh, realistically you're not going to be getting more than about like 80 kilobytes per second through that versus something like the, uh, the CH 32 X 035, where you can get around 600 kilobytes per second.

Cnlohr A: Oh, okay. Wow. Yeah. Yeah. That'll make, that'll make a difference. Okay. That's, that's great. That's great reference one and that sort of thing. Well, I'm really excited about this. I mean, I, I don't know. I'm appreciative of you and your community. And like, I don't know, I've, I've just been tinkering really just using, using, just trying out a lot of the demos and stuff like that. I, it's been on my list of, you know, things to build with, uh, of course, but babies, uh, in my house. Uh, so yeah, hopefully, hopefully someday soon I'll build some real things with it. Best I got was a little dev board, uh, that I built for myself, but it, it worked and it was great. And I don't know, it's nice to have this in the toolkit now too, you know, like that, that sort of thing is just all this stuff just feels like tooling that people get to take advantage of when they're doing their own projects and try out new things and want to iterate fast. Like you do.

Chris Gammell: Yeah. Yeah. It's, um, it is fun to, to watch the examples proliferate because you start with like these handful of make an led blank. And then now all of a sudden it's like, well, I want to do this really complicated thing. You're like, well, there's already a few examples that kind of do all the pieces you're after instead of having to like start with nothing and try to figure out how to make it do the thing you want it to do.

Cnlohr A: Yeah. Yeah. All right. Well, thanks so much for being back here. Uh, like I said, we'll have you back in another year. I'm sure. Um, and keep, keep on making new things. Cause it's, it's a lot of fun. It's a lot of fun to watch from the sidelines. I'm, I'm sure it's a lot of fun from your side too.

Chris Gammell: It is. Yeah. Even if still most of them are failures, but every now and then those successes are just so much fun to go dive into.

Cnlohr A: One more time. Where can people find you online and join your community if they want to do that sort of thing?

Chris Gammell: So we did have to close our public discord invites, but if you have interest specifically in the CH32 V003 or CH32 V003 fun, please reach out directly to me on discord. Um, I'm C N L O H R. Um, and I, my DMS are totally open. Please just reach out. Like we are still accepting people to the discord server, but we just, we, we had to, we had, we had a bit too much people who weren't actually interested in, in, in this kind of stuff. So I just ask that you just reach out to me. So if it is something that you're interested, you're interested in learning about it, you're interested in chatting with other people who are really passionate about this kind of stuff. We're still open to new people. Just reach out to me directly on discord at C N L O H R. Or you can see any of my other projects on GitHub at github.com slash C and Laura, or my YouTube channel where the, this video, uh, L O L R A L O L R A, uh, is all documented at, uh, youtube.com slash C and Laura.

Cnlohr A: All right. Well, thanks so much for being here and we'll talk to you soon. Thank you. Bye.

Speaker ?: Bye.

Archived Discussion (1)

Comments are closed. Archived from the original site.

Show archived discussion (1)Hide discussion
  1. Scott
    This guy's work is just stunning. I've started using CH32V003 after I heard him on here the first time. Really great to listen to, great contribution to the community with CH32V003fun. Can't wait for the next time.
Topics

CH32V003ch32v003funCH32V203CNLohrLoRALoRaWAN

Keep current

Every episode, plus the occasional job post, in your inbox.