 Okay, it's time. So, I'm Ray Kinsley. I'm here almost accidentally, and the reasons for that will become clear. I have my garages full of half-finished projects, stuff that I get started on, and then lose interest or something with the kids or whatever it is, and I've just got tons of them. So, I try to spend as little money on them as possible because the likelihood is nine out of ten of them, I don't finish. But before we talk about that, I'll explain a little bit who I am. I'm a software engineer. I've been an open-source software engineer since 1995. I work for a microprocessor manufacturer today. I'm a tinkerer in my spare time. I like to take things apart and then try to put them back together successfully, that kind of thing. I want to give a shout-out to my friends at the Fab Lab in Limerick. It's my hometown now. The Fab Lab in Limerick is a makerspace, and I hang out there on Thursday evenings and talk about these half-finished projects in various stages of completion. So, this is about my weather station. So, in 2013, we bought a new house at the top of a hill over not far from the Atlantic Ocean in Ireland, and it gets whacked by the weather. Like, I don't know if you've heard of, you've heard of clearly hurricane Orphelia and those kind of things. We have trees down everywhere. We really get whacked. So, when we bought the house, I said, geez, this would be a great place to have a weather station. So, this is Lupe, it's the most westerly point from us, and this is where my house is in Asherow. And this is the geographical profile between Lupe Head and my house. And you can see here I'm a full 120 meters above sea level, with pretty much nothing between me and the ocean. So, it seemed like a logical place to have a weather station. So, that year, just after buying the house, I asked Santa Claus for a weather station and Santa Claus delivered. And Santa Claus asked if they have any stipulations about the weather station before we got it. You can see there's a Santa Hush on the weather station. Any stipulations? And I said, yeah, I like one with a USB port, so at some point I can pull the data out of it and maybe try to do something with it, because I'm a software engineer, right? So, I duly got an Oregon Scientific Weather Station, which is a pretty well-known brand. I erected it. It was up for two years. I did nothing with it, until I started to think about green energy. Electricity prices in Ireland are pretty expensive. So, I started to think, well, with all this weather, could I put up a wind turbine? So, I said, well, I'll do, as I'll monitor the wind over a year, seems like a logical thing to do, and then I can plot how much energy I would generate with other wind turbines, seemed like a very obvious thing to do. So, let's go pull the data out of the weather station. So, first thing I learned then, pretty quickly, was unlike most Oregon Scientific Weather Stations, even though this thing has a USB port to pull the data out of, USB port did not work. So, first fail, but two years later, I can't return it, it's full with green mold. So, the second, well, it's not fair to say it doesn't work. It does work with proprietary Windows software. So, to put this in context, this costs 250 euros. And in order to run the software to pull the data out of this, it would take a board, probably a $100 board running Windows, which is another $100, so you're already up to 200 bucks just to run the software to pull the actual data out of this. Because, so there's no Linux software that actually supported actually pulling the data out of this. And this was the conundrum Oregon had done something that people weren't able to figure out to stop people from getting open source software to talk to the weather station. And the other thing that I found out, other thing I found out while I was hacking this, is this is actually quite unreliable. The antenna and the hardware that's actually in the base unit of the weather station, drops samples all the time and there's absolutely no way of knowing it. There's no indicator to tell you how good the signal is. So, on the positive side, it's pretty accurate. It gives you a wind sensor, it gives you a temperature sensor, it gives you a rain sensor, and it's pretty robust. But there's no way to get the data out. So, I came across an Australian maker, magazine article that had used an RXB6 $2, $2, a 433 megahertz receiver, mounted on an Arduino shield. And this is something you can actually buy from a company in Australia. It's like a pre-made Arduino shield with the RXB6 already on it. And then you could load a sketch onto an Arduino and you could see the bit stream from the bit stream from the weather station. But it was like something like $25 and then shipping from Australia was like another $50. Okay, so that wasn't gonna work. So, but these were available for like $2 on Aliexpress, so I bought a bunch of them. And then I needed an Arduino to run them with. So, I bought a whole bunch of Arduino nano clones. Now, let me just preface this by saying that if I had to stop being a cheapskate and I had to just bought an RTL-SDR at the start, I would have saved myself probably about a whole bunch of hassle, a whole bunch of money, and probably about four months worth of work. So, but yeah, but I was on the path and I was gonna keep going. So, and then obviously you need something, so this kind of, this, the Arduino talks to the receiver. The receiver receives the 433 megahertz signal and then the Arduino decodes it and then relays the data back to an orange pi PC which is, takes the decoded bit stream and actually turns it into something to recognize pulse of sensor data out of the bit stream and then uploads it to an internet. So, we're up to about 20 euros worth of investment at this point. So, a few other bits of information that I had was that somebody had reversed it. So, most of the Oregon Scientific Weather Stations do have a USB port in the back. That does work and does talk to open source software. Not the one I had, but most of them. And somebody had documented the protocol that these things talk because all the USB port does is dumps the bit stream that it's received. So, that was documented. It's pretty old. Well, actually turned out later. I figured out it was quite accurate. Somebody had published a sketch for the Arduino. It's the Dominique Pierre. He published a sketch for an Arduino that took the, was able to decode the Manchester decoding bit stream from the weather sensor, sorry, from the weather sensors back to the base station. So, these things talk with Manchester encoding based on the length between pulses. You can tell whether it's a one or a zero. And then you just essentially bit bang the bit into the right position and you're able to decode from there. And then finally, I later used a piece of a software called we WX to take the data that had been decoded on the Arduino and pull the sensor data out of actually decode, take the bit stream and decode it into, you know, temperature like, temperature, humidity, wind speed, rainfall, those kind of things. So, I had enough clues. I had the reverse engineering of the protocol from people who were actually able to talk to their weather stations directly. I had a sketch that could talk to the 433 megahertz receiver and decode Manchester encoding and turn the 433 megahertz signal into a bit stream that I could decode. And then I had some Python software to turn that into temperature and sensor data that I could be uploaded. So this is roughly the design I ended up with. So you can see the orange pie is tox to the Arduino, the serial on the Arduino was plugged into the orange pie serial pins. The Arduino is then plugged into the RXB6. And the RXB6 is pretty, it's pretty simple. There's only four pins that you actually use. You power with five volts, you give a ground, you connect it to an antenna, which the 433 megahertz antenna will actually start passing this around so people can take a look at it. That's, now be careful, that's a whole two dollars worth of investment right there. So you plug it into the antenna. Now, here's where mine is clearly far superior to what the Oregon scientific guys designed because I connected mine to LEDs that I told you whenever valid samples were received, if you actually, I was actually in situations where I was sitting looking at the base station that Oregon scientific provided, knowing that the circumstances had changed and the screen should update and there was no updates on the screen, which was great fun. So what else is there to say about this? Very, very, it's a pretty simple circuit. So this came from the document that the Oregon scientific, decoding the Oregon scientific protocol document that I showed earlier. And it basically indicates what the header and looks like and the payload looks like and you end up with, you get the sensor ID, you get the channel, you get a rolling code which changes with every power cycle of the sensor, you get various flags to tell you if the battery needs to be changed, you get the sensor data itself and then you get a checksum. So it all should be fairly straightforward at this point, right? Well, not so much. So this sensor ID that I was pulling out of it and this 1A89, but it's nibble orientated so we flip it around so it's A198, it didn't correlate with any of the sensors in the document. So, and the checksum wouldn't calculate. I couldn't get the checksum to calculate, it drove me mad. Sitting down, read the document, read how the checksum should be calculated and read about all the variances that Oregon Scientific had in their different devices, but I couldn't get the checksum to calculate. It always seemed to be hex, it always seemed to be hex A out or decimal 10 out. So I made a mental leap here, I came to a conclusion that seemed to be pretty evident from the circumstances. I was looking at a new weather station that nobody had ever seen before. Nobody had ever decoded this weather station and that's why I need to go off now and it was completely new. Oregon had designed it a different way so that's why the bit stream was different. So I started to create well-known circumstances in which I could control what's in the bit stream. So I put a fan on the weather, the wind sensor, I put the temperature sensors into the oven and then into the fridge very to just change it. And then I watched what I'd get on the base station and then I'd correlate what I got on the base station with what I saw on the bit stream as a way to reverse engineer the weather station. And I did this for about a month and I successfully, this way, I successfully decoded the wind sensor, the rain sensor and the temperature sensor. It's all turned out to be quite a lot of work but the rain sensor under the faucet, the tap and I opened the tap and I let it go. And then I had an epiphany. I looked back at the document again and I figured out that the very, very, the least significant bit in the first byte that you get from the receiver was actually not actually part of the payload. It wasn't actually sensor data. It was the sink bit. And this had actually caused of its position and this was corrupting the checksum. This was actually also corrupting the position of all of the bits, all of the nibbles in the stream. So this extra decimal 10 at the very, very start which appeared as one, zero, one, zero was actually what was causing the problem. So this is after I had done all the decoding. Turns out as soon as I dropped that everything fell into place and I ended up with a proper sensor ID which in this case was one, nine, eight, four. And that corresponded directly with what was in the document. Of course this was after like six weeks worth of work that I just had to throw in the bin. Now if I go back, I might remind you at this point that if I had to just pay $20 for an RTL STR I could have used the RTL 430 treatment. It's a fork of the RTL software that will have done all of this for me. But I was doing all this stuff the hard way, right? So I rewrote the sketch. So the original sketch from Dominic Pierre was great but I now improved it to ignore the sync bits. I made it more robust so that when interrupts came in from the 433 megahertz receiver it didn't drop bits. I gave a variable output so it could output ASCII or binary. Obviously if you've output and binary it's more efficient. You don't need to do conversion on the far side. And it could output USB serial or the Arduino's UX or X or TX pins. And then I also gave the Arduino the ability to identify which sensor it was. So it could trigger the LEDs and you can actually see how frequently you're getting a good sample. That turns out to be immensely useful because when you're soldering the little antenna onto the board and then you're soldering the even bigger antenna on the board you actually have no way of knowing how well it's actually receiving sensor data. And then I wrote a driver to take the stream from the Arduino and to turn it into the sensor data and I integrated the driver with the WEWX software. And then I was able to take all my information and I was able to upload it to weather underground. I don't know if people are familiar with weather underground but it's basically, it's like a community website where enthusiasts, weather enthusiasts can upload their streams from their weather station. So that's essentially what I was able to do. So if you go on to weather underground you'll see my weather station quite happily uploading the data. So that's it. I thought it was great work. Thought I was done. So I posted an RFC V1 to the, as I said I'm an open source engineers developer. So this comes naturally to me. I published an RFC V1 to their mailing list after all of this work. And then about a month later some email popped up to say somebody had figured out how to make the USB port on the back of the base station work. What the problem was that it was talking a non-standard serial speed. It was talking like, if you're familiar with serial communications, 128k serial speed is fairly unusual. It's slightly faster than what it ought to be. So it turns out that when you configure the serial port this way you can talk to the base station perfectly from Linux software. It works fine. Five months on. So now we're doing an RFC V2 output. So we no longer, you might say we no longer need any of this stuff. You no longer need the receiver or any of this stuff. I'd argue that mine's better because at least I can tell when mine's dropping signals and I can at least plug in more, I can plug in bigger and more reliable antennas which is what I've done. So you continue to support both ways but for the vast majority of people who are not going to go and build circuits as I have we're gonna support in the RFC V2 talking directly to the weather station. So what did I learn from this experience? Well, always be willing to challenge your own assumptions. So assuming that this is a brand new weather station probably wasn't right, those kind of things and always be willing to adapt as changing circumstances. Somebody figures out a way to decode, to turn on the USB port so it works. It kind of adapted those kind of circumstances. So that's my war story of hacking my Oregon scientific weather station. Yeah, it was a lot of work and a lot of fun. That's all to say about it, thank you. And any questions? Yeah, well, orange pie can't do real time. So you don't know to what extent you're actually measuring the latencies in the orange pie or the actual, you know, you need very, very precise measurements of the pulses when you receive the pulses from the RXB6. The orange pie can't do that reliably just because it's simply a general-purpose CPU. Whereas the Arduino, because it's a microcontroller, can do that great. Go ahead. I'm sorry? Well, oh yes. So if I was to do it all again, how much of that cost me? Well, if I had to just bought the RTLS, the R I would have spent about 20 bucks. I don't know how many of those little things I fried, but I think I fried about three of them. And I think I ended up buying about five of them. And I fried a few of the nanos along the way as well. So I probably put about 60 to 80 euros per, a worth of money into it. If I was to do it all efficiently, I'd probably get it all right first go. That's the nature of these things, right? Sorry, do I have to? Do you have this? Oh yeah, I will publish this on my blog probably next week. My blog is, you can get me on ashrow.eu. Thank you. Any other questions? I just need, I should thank the room organizers for inviting me to speak. It was very kind. Thank you very much.