1 00:00:00,001 --> 00:00:07,260 Welcome to the CircuitPython Show. I'm your host, Paul Cutler. This episode I welcome 2 00:00:07,360 --> 00:00:12,100 back Jan Goolsbey, also known in the Adafruit community as cgrover. Jan first visited the 3 00:00:12,260 --> 00:00:16,900 show back in episode 33, which I've linked in the show notes. Jan, welcome back to the 4 00:00:16,980 --> 00:00:17,180 show. 5 00:00:18,140 --> 00:00:19,320 Hello, Paul. How are you today? 6 00:00:20,060 --> 00:00:23,400 I'm doing great. Thanks for making time and coming back on. I really appreciate it. 7 00:00:24,120 --> 00:00:27,320 Well, I enjoy the discussions with you and I'm looking forward to this one. 8 00:00:28,120 --> 00:00:31,480 I am too, so you've been working on a weather station for a number of years. 9 00:00:32,020 --> 00:00:33,180 Tell me how it all got started. 10 00:00:34,640 --> 00:00:39,240 Well, it got started many years ago when I, when we moved into this house, we have this 11 00:00:39,320 --> 00:00:42,000 detached garage that I call my workshop. 12 00:00:42,720 --> 00:00:44,420 It does have an area set aside for that. 13 00:00:45,120 --> 00:00:48,200 And I brought a collection of my electronics projects. 14 00:00:48,380 --> 00:00:51,180 And back then I wasn't doing a lot of software, it was mostly hardware. 15 00:00:51,820 --> 00:00:55,960 So I had, you know, an IBM 5150 personal computer. 16 00:00:56,200 --> 00:01:01,020 I had Intel 8080 parts and resistors and capacitors, you know, the whole thing. 17 00:01:01,840 --> 00:01:05,280 And I was throwing them out in this detached garage where we have in the 18 00:01:05,420 --> 00:01:07,380 workshop that was unheated. 19 00:01:08,060 --> 00:01:13,580 And I noticed after about a year, components started to decay and especially 20 00:01:14,140 --> 00:01:18,120 the metal leads, like on integrated circuits would get this corrosion layer on 21 00:01:18,220 --> 00:01:20,220 them and it made it really difficult to solder. 22 00:01:20,840 --> 00:01:23,000 They didn't work in the sockets anymore. 23 00:01:23,320 --> 00:01:25,740 And so I was getting a little bit discouraged. 24 00:01:25,800 --> 00:01:31,480 I also noticed some damage to my metallic tools, you know, things like wrenches and screwdrivers. 25 00:01:31,840 --> 00:01:34,020 We're starting to show some corrosion on the outside of that. 26 00:01:34,640 --> 00:01:39,100 And I never thought that would happen because we live in the desert here in Washington State. 27 00:01:40,740 --> 00:01:42,380 You just don't expect that to happen. 28 00:01:42,900 --> 00:01:44,260 But we have wet winters. 29 00:01:45,120 --> 00:01:49,780 You know, even though we get less than six inches of rain in a year, it happens in the 30 00:01:49,960 --> 00:01:53,800 winter and that's when things are colder and that's when condensate forms. 31 00:01:53,800 --> 00:02:23,680 Well, you get the drift there. I was needing to upgrade the garage so that I could store things out there and work on things out there without worrying about corrosion. So I get this new obsession. The new obsession was, how do I solve this corrosion? So I did some reading about it. And the first thing I needed to do was measure temperature and humidity. And that was, that was really where it all starts. And, and if you can determine when condensate forms, 32 00:02:23,800 --> 00:02:53,780 then you can probably prevent it. And that's really what I wanted to do. I didn't want to put a heater out in the garage right away. I wanted to figure this thing out first. So that's where this started. And fortunately, about that same time, MicroPython came onto the scene. And Tony DeCola was working on putting MicroPython on some Adafruit M0 boards. And I thought, well, this is perfect. Okay, you know, I had done some Arduino programming. But Arduino doesn't, you know, it's not as good as Arduino. And I thought, well, this is perfect. Okay, you know, I had done some 33 00:02:53,800 --> 00:02:59,020 doesn't work with my brain. I'm a hardware guy and so I had to do compiling and all this kind of stuff. 34 00:02:59,100 --> 00:03:04,000 Yeah, I know how to do that, but that's not the fun part of it for me. So I wanted to get something 35 00:03:04,220 --> 00:03:09,900 like MicroPython where I could very quickly put together a prototype, start to characterize what 36 00:03:10,080 --> 00:03:16,160 the temperature and humidity issues were, and see if I can solve this corrosion problem. And Tony did 37 00:03:16,240 --> 00:03:22,980 some great work with getting MicroPython introduced in some Adafruit boards. And I, at the same time, 38 00:03:23,160 --> 00:03:53,140 Lady Ada came up with a board with an RF transmitter on it. It was the RFM69, an 800MHz transceiver that could send and receive little tiny data packets, you know, 10 to 15 character data packets. Nothing fancy, nothing fast. And I thought, but that's perfect because I just need temperature and humidity. And since it's a detached garage, I didn't want to have to go out there and read the display all the time. So I made a little unit that was, you know, a little bit more compact. And I thought, well, I'm going to have to make it a little bit more compact. And I thought, well, I'm going to have to make it a little bit more 39 00:03:53,160 --> 00:03:59,380 an M0 with the RFM69 built into it, put micropython on it, stuck it out in the garage, 40 00:03:59,720 --> 00:04:05,940 transmitted it to a tiny little remote that I made with an OLED display, and all I did was I just 41 00:04:06,200 --> 00:04:11,880 watched temperature and humidity just to try to figure out when does corrosion occur. Meanwhile 42 00:04:12,020 --> 00:04:16,040 I'm doing some studying because when you get that data, well what's the first thing you do, 43 00:04:16,160 --> 00:04:23,140 at least for me, throw it in a spreadsheet. Start looking at things like dew point and the capacity 44 00:04:23,140 --> 00:04:28,440 air to hold moisture and all the kind of stuff that leads to corrosion. I started to refine the 45 00:04:28,640 --> 00:04:36,520 software to convert the humidity and the temperature into something that looked more like an index that 46 00:04:36,560 --> 00:04:42,520 was related to whether I was experiencing a corrosion event. I was hoping to get to the 47 00:04:42,660 --> 00:04:48,220 point where I could predict when a corrosion event occurred. That took me to the next phase of the project. 48 00:04:48,340 --> 00:04:56,920 next phase of the project was setting aside that RFM69 and M0 and go to more of an internet solution 49 00:04:57,200 --> 00:05:03,180 where I put a Pi portal out in the garage and with the same temperature humidity sensor 50 00:05:03,920 --> 00:05:10,860 transmitted the data up to Adafruit I/O and got data trends and you know you've got a great 51 00:05:11,780 --> 00:05:17,779 browser-based dashboard tool that I could use to look at the data and compare and get some feeling 52 00:05:17,780 --> 00:05:23,800 for an even deeper feeling into how to solve this corrosion issue. And by about that time, 53 00:05:24,000 --> 00:05:31,460 I figured, well, I better remodel this garage. It was built from surplus government lumber. 54 00:05:32,560 --> 00:05:39,140 The whole garage was. It was very functional and it was retro-fantastic. It was great. As a matter 55 00:05:39,200 --> 00:05:45,379 of fact, a friend of mine came out and filmed a short video in there about time travel because 56 00:05:45,380 --> 00:05:50,480 they needed a workshop that a crazy scientist would use, you know, to build this time machine. 57 00:05:51,000 --> 00:05:56,560 So they filmed the time machine portion in my workshop. And the next week was when I had the 58 00:05:56,640 --> 00:06:02,300 crews come in and tear down the garage and put up a new one and build on the same footprint, 59 00:06:02,460 --> 00:06:08,540 build the garage. And PiPortal was perfect timing for that. And I also put in a heat pump out in the 60 00:06:08,620 --> 00:06:13,560 garage because what I had determined by then, I was using CircuitPython with the PiPortal, 61 00:06:14,020 --> 00:06:43,940 I determined that even though there are some complex equations for figuring out how much moisture there is in the air and you know how it forms and and there are some standards for when you can expect certain kinds of materials to corrode, it really boiled down to keeping the garage above 32 degrees. And that way you avoid the condensation that obviously occurs when things freeze. And as long as you keep it at a comfortable temperature, somewhere above 32 degrees, you can pretty much avoid corrosion. 62 00:06:44,020 --> 00:06:49,440 issues. And so if we finished the remodeling, we got the pipe portal out there, I'm watching the 63 00:06:49,640 --> 00:06:54,940 data, and we had this great snow storm and I, you know, backed the car back into the garage next to 64 00:06:55,060 --> 00:07:01,740 where the workshop is, and about 15 minutes later the corrosion alarm goes off and I, oh, I brought 65 00:07:01,980 --> 00:07:07,340 moisture into the garage that wasn't natural. What happened? And the snow melted, we get this 66 00:07:07,520 --> 00:07:14,000 corrosion event, and that created a whole new set of concerns for me that how do now how do I get 67 00:07:14,000 --> 00:07:21,080 rid of the moisture in the garage. And thanks to CircuitPython, I can modify the PyPortal monitor 68 00:07:21,620 --> 00:07:25,460 to give me the data that I need to look at different algorithms for solving these problems. 69 00:07:26,060 --> 00:07:32,680 And prototypically, almost immediately, you can study the data, change the algorithms, 70 00:07:33,460 --> 00:07:39,680 and completely change the functionality of the monitor to suit your whole new set of theories 71 00:07:39,680 --> 00:07:45,060 about how you're going to predict and prevent these things. Well, since I was in the problem-solving 72 00:07:45,240 --> 00:07:50,340 mode there and needed to get rid of the moisture in the garage, that's when I determined there's 73 00:07:50,380 --> 00:07:56,820 a really tight link between internal corrosion and external corrosion. The data and the conditions 74 00:07:56,880 --> 00:08:02,120 that can cause internal corrosion are driven by the exterior weather conditions, as well 75 00:08:02,200 --> 00:08:07,280 as the heat pump and all those things. It got me thinking about how do I incorporate 76 00:08:07,280 --> 00:08:08,740 external weather conditions 77 00:08:09,780 --> 00:08:14,100 with the internal workshop conditions and get a better feel for 78 00:08:14,880 --> 00:08:19,960 how I can prevent and how I can be even this case mitigate the 79 00:08:20,660 --> 00:08:22,560 collection of the moisture in the workshop 80 00:08:23,800 --> 00:08:29,020 That's when I started going down this this path of taking a look at open weather 81 00:08:30,040 --> 00:08:35,360 map.org because they have a free weather condition service for local conditions and 82 00:08:36,159 --> 00:08:42,700 And that worked pretty well. I had one device that looked at the external weather and one device that looked at the corrosion monitor stuff. 83 00:08:43,219 --> 00:08:48,800 And I, you know, went between the two and started to try to make a correlation between those. 84 00:08:49,540 --> 00:08:57,920 It became rather difficult to do that. I had spreadsheets and I couldn't correlate the data very well because I couldn't collect it in one place. 85 00:08:58,160 --> 00:09:11,540 That's when I had the idea of uploading the weather condition data that I was getting from openweathermap.org into AIO, so I had streams that would show up on my browser dashboard. 86 00:09:12,360 --> 00:09:21,580 And then I could start mapping one temperature set against the other and make a determination of what the relationship is between inside and outside conditions. 87 00:09:22,160 --> 00:09:26,140 So I knew when to open the garage door, turn on the fan, and blow the moisture back out 88 00:09:26,160 --> 00:09:26,900 into the environment. 89 00:09:28,000 --> 00:09:32,160 Which doesn't work, by the way, when it's raining, because you can't fit any more moisture 90 00:09:32,280 --> 00:09:34,000 in the outside air, which makes sense. 91 00:09:34,500 --> 00:09:34,920 Good to know. 92 00:09:35,580 --> 00:09:40,380 Yeah, I'll have to write up this whole corrosion monitoring obsession one of these days. 93 00:09:40,440 --> 00:09:42,300 I'll let you know when that comes about. 94 00:09:42,800 --> 00:09:46,200 I'm having too much fun programming what I'm working on right now. 95 00:09:46,940 --> 00:09:54,480 And what I'm working on right now is this evolution of that into a combined weather 96 00:09:54,880 --> 00:10:02,900 system that looks at internal sensors, specialty sensors that I might have locally, and weather 97 00:10:03,000 --> 00:10:03,460 conditions. 98 00:10:04,140 --> 00:10:10,480 And it was kind of all spawned by this AIO collection of the data feeds and the way that 99 00:10:10,520 --> 00:10:11,200 I could look at that. 100 00:10:12,280 --> 00:10:18,000 So I worked on an architecture where I can upload that data, where I can bring it down 101 00:10:18,080 --> 00:10:18,620 to devices. 102 00:10:19,520 --> 00:10:24,640 And I got to the point where I could take all that data and put it into spreadsheets 103 00:10:24,680 --> 00:10:28,800 or make comparisons, but I had the collection of the data from the two sources. 104 00:10:29,820 --> 00:10:32,100 And that whole thing was working fine. 105 00:10:32,240 --> 00:10:37,360 And I was learning more about how I'm going to do this corrosion monitoring, how I'm going 106 00:10:37,360 --> 00:10:38,220 to set these alarms. 107 00:10:38,860 --> 00:10:40,140 And there's still work to be done. 108 00:10:41,160 --> 00:10:46,560 know, a wrench got thrown into the works and that was openweathermap.org decided that they were going 109 00:10:46,560 --> 00:10:52,940 to start charging for their service and I can't blame them. It's a great service. But the model 110 00:10:53,040 --> 00:10:57,420 that they used was, at least at the time when I was making the consideration, I don't know if it's 111 00:10:57,760 --> 00:11:04,960 changed, they required a credit card to be able to get data from them even though they called it a 112 00:11:05,000 --> 00:11:09,639 free service. And you know I'm just not trusting enough to give somebody my credit card say here's 113 00:11:09,640 --> 00:11:11,440 here's a blank check for you, you know? 114 00:11:11,940 --> 00:11:13,740 And I thought, well, I'll just look for some other ones. 115 00:11:13,800 --> 00:11:18,500 And I ran across weather.gov, which is a NOAA service, 116 00:11:18,880 --> 00:11:23,260 the National Oceanic and Atmospheric Administration there. 117 00:11:23,340 --> 00:11:24,300 I knew I could figure that one. 118 00:11:25,020 --> 00:11:27,000 NOAA had this really great service 119 00:11:27,220 --> 00:11:31,200 that had this fantastic detail of these weather stations 120 00:11:31,360 --> 00:11:32,740 that were really close to my home. 121 00:11:33,460 --> 00:11:36,220 And I thought, this is two miles away at an airport 122 00:11:36,460 --> 00:11:37,520 that's real close by here. 123 00:11:37,920 --> 00:11:38,880 They had a weather station. 124 00:11:39,000 --> 00:11:40,240 I thought, this is perfect. 125 00:11:40,660 --> 00:11:44,780 It's not just some consolidated weather data that I might get from open weather 126 00:11:44,880 --> 00:11:49,060 map, which they do a good job, but they average weather stations in the area 127 00:11:49,200 --> 00:11:50,700 to come up with their, their number. 128 00:11:51,380 --> 00:11:52,620 I thought this is going to work great. 129 00:11:53,160 --> 00:11:55,720 Well, what I found out was these little tiny weather stations, they 130 00:11:55,820 --> 00:11:57,080 have peppered all over the place. 131 00:11:57,620 --> 00:12:00,160 If you just look at one of them, it's not very reliable. 132 00:12:01,140 --> 00:12:04,140 So, and I thought, okay, well, that's fine. 133 00:12:04,220 --> 00:12:06,900 I'll just go, I'll do what openweathermap.org does. 134 00:12:07,240 --> 00:12:10,360 I'll look at 20 different weather stations and I'll average the data. 135 00:12:11,100 --> 00:12:14,840 And you can imagine I'm taxing CircuitPython pretty significantly. 136 00:12:15,540 --> 00:12:20,200 I'm trying to do this on a Pi portal with an M4 processor, even though it has a 137 00:12:20,380 --> 00:12:26,820 separate ESP32 processor on there, the M4 just doesn't have enough memory to do all 138 00:12:26,920 --> 00:12:31,460 that internet, you know, downloading all the JSON files that are necessary, decoding 139 00:12:31,580 --> 00:12:31,780 that. 140 00:12:31,900 --> 00:12:35,919 And then of course I kind of went nuts and I needed a fancy display and that eats up 141 00:12:35,920 --> 00:13:05,900 memory too. The poor little pipe portal was just suffering. Pretty soon I found that that would be an impossible task. And I really didn't know where to go from there. I didn't want to have to go back to openweathermap.org, although that would have been a viable solution. I was pouring through some Adafruit IO documentation because I'm trying to solve some of the reliability issues I was having using the M4 and memory capacity issues. And I found out that there's an Apple 142 00:13:05,900 --> 00:13:11,900 weather kit plus up in AIO plus that I hadn't realized was there. 143 00:13:12,940 --> 00:13:18,320 And I had been using AIO plus because, you know, I have lots of AIO feeds, 144 00:13:19,820 --> 00:13:21,040 because I have lots of data sources. 145 00:13:21,500 --> 00:13:25,380 So I was already paying for this, but I just didn't realize that this plus up to 146 00:13:26,040 --> 00:13:31,740 the Apple weather kit was out there and it gives an open weather map kind of view 147 00:13:31,740 --> 00:14:01,720 of the world, including five-day forecasts, you know, some data that I wasn't using that could be very useful. This is a no-brainer. We're just going to go with that. And that's where I started to think about this collection of data that I have as an architecture. Since I was facing that choice of determining where the source was going to be for this weather data, I got about a dozen Pi portals, I needed to make it compatible with that. That's when I started to develop that architecture. And that's where I started to think about how I could use that data to make my architecture more compatible with the weather data. And that's where I started to think about how I could use that data to make 148 00:14:01,740 --> 00:14:08,580 and version one of that architecture is in an article, it's documented in an article out in the 149 00:14:08,740 --> 00:14:14,500 Adafruit Playground. That was something that the objective of that architecture was to get that 150 00:14:15,140 --> 00:14:20,680 the two weather conditions, you know, the internal and external weather condition data into a single 151 00:14:21,000 --> 00:14:27,460 place, but it was also to try to preserve the pie cordless that I used for displays. 152 00:14:27,900 --> 00:14:34,120 Since they were limited, I had to try to find an architecture that could support the need for the 153 00:14:34,200 --> 00:14:40,660 PyPortal to have a bunch of data, but keep it from having to go out to the internet and get these 154 00:14:40,960 --> 00:14:47,540 gigantic data files, JSON files, and decode them itself. It just couldn't do that. And so the first 155 00:14:47,740 --> 00:14:54,220 architecture was designed to take care of that. So what were the challenges with the first 156 00:14:54,220 --> 00:15:00,120 architecture of the weather station? Well let me recap just for a second and go 157 00:15:00,240 --> 00:15:04,600 back to the you know the zero architecture was just a point-to-point 158 00:15:04,720 --> 00:15:09,620 thing with that two-way radio kind of a setup and then you know I saw the 159 00:15:09,840 --> 00:15:17,220 obvious need at that point to use AIO so the architecture became more AIO centric 160 00:15:17,480 --> 00:15:23,540 and then I started gravitating to the Pi portal and that's that's kind of the 161 00:15:23,540 --> 00:15:32,100 Lexus of the issue and when you work with the Pi portal you have a lot of overhead contained in 162 00:15:32,240 --> 00:15:38,660 the drivers that make the Pi portal easy to use and easy to program but if you're trying to expand 163 00:15:38,740 --> 00:15:44,140 and take in a bunch of feeds and I had a lot of AIO feeds of course you start running out of memory 164 00:15:44,400 --> 00:15:50,260 and with that M4 processor and so I got to the point where I saw the need to do something different 165 00:15:51,140 --> 00:15:57,520 and yet I still tried making the M4 work. You know, I bumped up against the memory all the time, 166 00:15:57,640 --> 00:16:02,660 and I got rid of some of the fancy graphics and put in some more pedestrian stuff, and I just 167 00:16:03,000 --> 00:16:10,120 wasn't very happy with it. So I came up with this idea that I needed to modify the architecture so 168 00:16:10,160 --> 00:16:15,420 that I could still look at weather data. And the other goal was I wanted to continue to use the M4s, 169 00:16:16,100 --> 00:16:21,800 the Pi portals, but be more sensitive to the memory issues and some other issues that they have, 170 00:16:22,220 --> 00:16:26,180 so that I could still continue to use my investment in Pi portals, because I have many of them. 171 00:16:26,880 --> 00:16:31,740 But I needed to move to something, and I'm very reluctant to move to something new, because 172 00:16:32,740 --> 00:16:38,620 I had it working, I thought, and but also I'm cheap and I'd like to use the Pi portals wherever 173 00:16:38,980 --> 00:16:46,080 possible. I struggle with the notion that once you write some software, you make it as good as you 174 00:16:46,080 --> 00:16:52,200 possibly can and you shouldn't ever have to change it, which that's a myth. And so I get 175 00:16:52,360 --> 00:16:58,780 trapped into that often. I try to talk myself into a philosophy that I learned a while ago 176 00:16:58,820 --> 00:17:02,480 when I was making printed circuit boards is, yeah, it's okay to start from scratch. It's 177 00:17:02,600 --> 00:17:08,300 okay to start over. You probably learned something since the last time you coded that and it's 178 00:17:08,319 --> 00:17:16,060 okay to recode it and you'll probably use something better the next time around. So 179 00:17:16,060 --> 00:17:21,720 limitations in the Pi portal predominantly. I wanted to have multiple display devices. 180 00:17:22,860 --> 00:17:28,880 And the first architecture was kind of funny, the way I tried to synchronize all these asynchronous 181 00:17:29,220 --> 00:17:34,880 devices. If you have four or five displays and they're all accessing AIO, you run into 182 00:17:34,960 --> 00:17:42,180 the throttle limits of the Adafruit I/O. And if you have a free subscription to AIO, you're 183 00:17:42,180 --> 00:17:49,860 limited to 30 transactions per minute, which doesn't sound like a lot, and it isn't when 184 00:17:49,880 --> 00:17:55,320 you have multiple devices. Fortunately, I was using AIO Plus and I had the limit of 185 00:17:55,460 --> 00:18:01,920 60 transactions per minute, and double that other rate. And I certainly appreciate the 186 00:18:01,940 --> 00:18:05,060 fact that they're trying to give this service to a whole bunch of people and they need to 187 00:18:05,100 --> 00:18:12,160 throttle it that way. So I would go to each one of my devices and I'd say, "Okay, the 188 00:18:12,160 --> 00:18:16,120 to AIO at 10 minutes past the hour, get your business done. 189 00:18:16,920 --> 00:18:19,840 And then the weather monitor can go out to AIO 190 00:18:20,180 --> 00:18:21,700 and extract weather information 191 00:18:22,340 --> 00:18:24,460 at 15 or 20 minutes past the hour. 192 00:18:25,240 --> 00:18:28,580 And the second weather display, the one that, or the, yeah, 193 00:18:28,660 --> 00:18:31,220 the second weather display that I have is in the living room 194 00:18:31,580 --> 00:18:32,780 is a matrix portal. 195 00:18:33,600 --> 00:18:36,860 And I said, well, you can go at 20 or 30 minutes 196 00:18:37,060 --> 00:18:38,220 past the hour and get the data. 197 00:18:38,400 --> 00:18:41,320 And you can only go out there every 20 minutes 198 00:18:41,320 --> 00:18:47,160 get the data. I had this really complicated formula trying to synchronize all these devices 199 00:18:47,680 --> 00:18:52,360 that were, that I wanted to be autonomous and it just couldn't work. Because if you 200 00:18:52,400 --> 00:18:57,920 ever had an internet error, if you know what those are, which we have a few, the wireless 201 00:18:58,200 --> 00:19:02,300 connection would break or something and then the device would have to resynchronize and 202 00:19:02,300 --> 00:19:06,100 it would heterodyne with the other devices and you'd still end up with throttle failures. 203 00:19:06,460 --> 00:19:14,320 and I just didn't know how to fix that. Well, I think Brent and Tyath, who do the development 204 00:19:14,560 --> 00:19:22,300 work for Adafruit in the AIO realm, they came up with a really simple scheme for providing 205 00:19:22,460 --> 00:19:29,240 throttling information. And I thought, well, I've tried everything else. Let's try this 206 00:19:29,280 --> 00:19:35,640 and see if we can make it work. And I hesitated to try their new scheme for throttling because 207 00:19:35,640 --> 00:19:41,140 I figured it would be way more complicated than what I could do. I'm not an expert programmer. 208 00:19:42,100 --> 00:19:47,940 I ran into so many troubles trying to synchronize anyway that this throttling stuff is going 209 00:19:47,960 --> 00:19:53,000 to be a scheme that will take me a while to learn how to do. I was wrong. It was so simple. 210 00:19:53,600 --> 00:19:54,680 That's a good problem to have. 211 00:19:55,400 --> 00:19:58,800 It was surprisingly simple. I should have known better. I should have checked it out 212 00:19:58,820 --> 00:20:04,280 and played with it. Well, anyway, I know better now. But Tyep did most of the work on that 213 00:20:04,280 --> 00:20:10,560 And it's just brilliant what he did just brilliant and I put in you know one or two extra lines of code 214 00:20:11,180 --> 00:20:13,600 Whenever I had to go out and do something with AIO 215 00:20:14,320 --> 00:20:18,320 And all it did was it did a query and it says how much throttled do I have left? 216 00:20:18,840 --> 00:20:25,800 And that's all controlled them by the server rather than by my devices and my devices was just wait until there's enough throttle left to 217 00:20:25,840 --> 00:20:32,220 Do something so Adafruit IO actually has part of the API that you can query it to say how many throttling requests? 218 00:20:32,300 --> 00:20:33,800 Do I have left in this minute? 219 00:20:34,260 --> 00:20:42,440 Yes, and and surprisingly that going out and querying how much throttle you have left doesn't seem to affect your throttle limit 220 00:20:43,380 --> 00:20:45,120 Which just you know, that's a real plus 221 00:20:45,940 --> 00:20:54,100 So whenever I have a transaction with AIO now, I go out and check that throttle. Well that forced me to go to a new architect 222 00:20:55,300 --> 00:21:02,160 So I have an architecture version 2 that I put in place and this is the version 2 is called remix 223 00:21:02,160 --> 00:21:17,880 and it's out in the Playground. If you're interested in it, there are two articles that I wrote for Playground. One is the structure of the first architecture, and the second is the structure of the second architecture. And it also gives the code examples. 224 00:21:18,780 --> 00:21:20,640 And I'll make sure I link to those in the show notes as well. 225 00:21:21,160 --> 00:21:27,160 And I welcome as many comments as I can get on that, because I'm hoping that I'm using a throttling correctly. It seems to work. 226 00:21:27,960 --> 00:21:42,600 Because now with the second version of the architecture, I've tested with six devices and four of those are Pi portals. One is an ESP32 S3 repeater is what I call it. 227 00:21:43,120 --> 00:21:58,660 but it takes the place of the corrosion monitor out in the garage and it picks up the Apple WeatherKit information, translates that and moves it back into AIO feeds that I can then access with PyPortals. 228 00:21:59,460 --> 00:22:03,660 And I'm only getting that small chunk of data that I need rather than the whole JSON file. 229 00:22:04,120 --> 00:22:11,180 So I can get the pi portals to continue to work because I limit how much data they get when 230 00:22:11,260 --> 00:22:15,620 they're accessing AIO. They don't have to get the whole thing. They only get what they need. 231 00:22:16,720 --> 00:22:21,180 So I've had six devices running with the new throttling stuff and it's just been flawless. 232 00:22:21,800 --> 00:22:28,240 The only errors I have much more related to, you know, my need for fancy graphics and things like 233 00:22:28,300 --> 00:22:32,440 that where I ran out of memory and that, you know, that's a personal issue that I'll just 234 00:22:32,440 --> 00:22:37,060 have to resolve somehow. Well tell me a little bit about the interface because I've seen pictures 235 00:22:37,480 --> 00:22:42,520 and I think most of the listeners would be interested in knowing more about it. Right now 236 00:22:42,720 --> 00:22:49,660 there are four different user interfaces that I use. The corrosion monitor, even before it came 237 00:22:49,800 --> 00:22:55,960 into this new architecture, was an Elkar's Star Trek style interface. It isn't touch sensitive or 238 00:22:55,960 --> 00:23:02,660 or anything, but it still uses that feature. And it's built very similarly to the displays 239 00:23:02,740 --> 00:23:09,420 that they actually use. Not necessarily in the code or the graphics design, although 240 00:23:09,520 --> 00:23:16,180 that does kind of mirror it, but it uses a layered graphics approach. So the background 241 00:23:16,420 --> 00:23:22,340 image has all of your indicators in it. Like, I'm using the internet now, or I'm going out 242 00:23:22,340 --> 00:23:29,380 I'm looking at my thermometer or I'm using the SD drive to store information for that wonderful spreadsheet that I always keep track and 243 00:23:30,540 --> 00:23:36,120 You cover those up with masks instead of drawing the object like an antenna or 244 00:23:37,000 --> 00:23:45,180 Wireless access that's in the background and you just cover it up with a colored square. So the interface really is kind of graphical 245 00:23:46,220 --> 00:23:53,120 reminiscent of the L cars and it uses some trickery to make that work which is a little stage magic which I think is kind 246 00:23:53,160 --> 00:23:55,900 Of a nod to how they did things on Star Trek, too 247 00:23:56,660 --> 00:24:02,040 So that's the corrosion monitor and that that has been modified somewhat and is coming to the new environment 248 00:24:03,000 --> 00:24:08,560 the weather monitor was one based on something that John Park did quite a while ago on the Pi portal and 249 00:24:09,300 --> 00:24:12,180 I've adapted it and changed the graphics a little bit 250 00:24:12,880 --> 00:24:17,360 We call it Mikey because our local weather man. Its first name is Mike 251 00:24:18,320 --> 00:24:23,360 And I recorded a snippet of his voice introducing the fact that we've turned the weather monitor on 252 00:24:23,860 --> 00:24:30,220 So every time we turn it on we get our favorite forecaster telling us that he's gonna give us the web. That is pretty neat 253 00:24:30,960 --> 00:24:37,040 the other interface is the matrix portal weather station and I used an m4 initially, but 254 00:24:37,840 --> 00:24:42,860 There again, I started running in performance problems. So I switched that one to 255 00:24:42,860 --> 00:24:51,520 the Matrix Portal S3. So it's a fully capable ESP32-S3. Lots of memory available for goofing 256 00:24:51,620 --> 00:24:57,380 around with graphics and doing things. Technically I could download entire JSON files and things like 257 00:24:57,480 --> 00:25:03,100 that, but I still kept it in kind of a simple display and it shows an abbreviated version of 258 00:25:03,100 --> 00:25:09,060 the weather and then in the scrolling bar down below it tells us what the wind is gusting to, 259 00:25:09,100 --> 00:25:16,140 it tells us what the shop temperature is and it scrolls by and we find that one probably to be 260 00:25:16,340 --> 00:25:23,000 the most useful out of those interfaces the first three interfaces and the fourth interface is one 261 00:25:23,020 --> 00:25:28,600 that I'm not happy with well it kind of looks like a raspberry pi booting up it's just text 262 00:25:29,460 --> 00:25:33,580 and that's the translator that sits out in the garage and I really need it to be more of a clock 263 00:25:34,380 --> 00:25:39,240 and I needed it to, well frankly, I needed it to look more like an LCARS interface. So, 264 00:25:39,940 --> 00:25:45,400 the next version of that, which I'm working on right now, and I do have a link and some pictures 265 00:25:45,700 --> 00:25:53,680 in that second Playground article, it shows a more expansive LCARS interface and it combines 266 00:25:54,040 --> 00:26:01,420 the external weather with the internal shop conditions in a single display. It can either 267 00:26:01,420 --> 00:26:06,820 be used as that repeater that translates data and sends it back to AIO or it can be used as a 268 00:26:07,100 --> 00:26:15,260 standalone display. That's the up and coming for it. Will there be a modification to the architecture? 269 00:26:15,620 --> 00:26:21,580 Well, I don't sit still on this stuff so probably a version 3 but right now I need to perfect that 270 00:26:21,720 --> 00:26:28,140 new Elkars interface and that's running on a let's see that's running with a 3.4 inch 271 00:26:28,860 --> 00:26:35,760 TFT feather wing with an ESP32S3 feather plugged into the backup. 272 00:26:37,340 --> 00:26:45,280 So it it's kind of like a Pi Portal which I dearly love but it's it's not yet a Pi Portal. 273 00:26:45,720 --> 00:26:50,600 I hope in the future to add some other bells and whistles to it so it has sound because we've got 274 00:26:50,600 --> 00:26:58,840 to get Mikey to talk. And also I like to when I put these in an enclosure I like to have a 275 00:26:58,840 --> 00:27:03,660 inside the enclosure in case here in the desert things get hot, you know, and you've got to turn 276 00:27:03,760 --> 00:27:09,380 on the fan inside the enclosure. And that's, those are things that I need to add. Is there anything 277 00:27:09,540 --> 00:27:14,580 else that comes to mind for what's next in the project? Of course, I'm still on that journey 278 00:27:14,740 --> 00:27:22,000 to figure out how do I adequately predict corrosion? What weather changes outside and 279 00:27:22,220 --> 00:27:26,440 conditions inside, including, you know, back in the car and that's, that has snow all over and 280 00:27:26,440 --> 00:27:28,080 and under it that's gonna melt. 281 00:27:28,640 --> 00:27:32,660 How do I predict when that corrosion event's going to occur? 282 00:27:33,180 --> 00:27:35,400 And there's some science in that. 283 00:27:35,460 --> 00:27:38,040 And right now I focus on dew point 284 00:27:38,780 --> 00:27:41,580 because dew point seems to be, that's a magic number 285 00:27:41,660 --> 00:27:43,960 'cause that tells you when the air is saturated with water, 286 00:27:44,180 --> 00:27:46,680 that the temperature at which the air gets saturated 287 00:27:46,780 --> 00:27:47,920 with water is the dew point. 288 00:27:48,520 --> 00:27:50,040 Well, that tells you a lot about corrosion 289 00:27:50,220 --> 00:27:53,200 because if the air is saturated with water 290 00:27:53,200 --> 00:27:56,120 and you have something metallic that's a little bit colder, 291 00:27:57,220 --> 00:28:00,000 it's going to condense water on that right away. 292 00:28:00,860 --> 00:28:05,480 And if you compare internal dew point to external dew point, 293 00:28:06,060 --> 00:28:08,600 that tells you a little bit about the other condition 294 00:28:08,700 --> 00:28:11,040 I talked about where if I want to take the water 295 00:28:11,200 --> 00:28:14,320 in the workshop and push it outside with a fan, 296 00:28:14,980 --> 00:28:17,180 is there room outside to accept that moisture? 297 00:28:17,700 --> 00:28:19,340 And dew point can tell you some of that. 298 00:28:20,140 --> 00:28:24,300 It's not a true measure of capacity of the air outside, 299 00:28:24,440 --> 00:28:26,220 but it's a pretty good indicator, I think. 300 00:28:27,180 --> 00:28:30,700 But what I struggle with is really gaining an understanding 301 00:28:30,860 --> 00:28:35,560 about how much moisture do I have in the workshop 302 00:28:35,920 --> 00:28:38,080 and how much moisture can the outside tolerate? 303 00:28:38,360 --> 00:28:39,200 How much can I give it? 304 00:28:40,080 --> 00:28:42,460 So that's the next step is to do a little science 305 00:28:42,600 --> 00:28:44,000 and try to figure this thing out. 306 00:28:44,580 --> 00:28:47,540 And then you would think that would be enough. 307 00:28:47,980 --> 00:28:55,060 the natural extension is now how am I going to use the features of AIO to control the 308 00:28:55,220 --> 00:29:00,200 internet connected heat pump that's in the garage so that I can have it automatically 309 00:29:00,360 --> 00:29:07,540 abate it while I'm sitting on a beach somewhere. Sure. Well a good project is never over. No, 310 00:29:07,600 --> 00:29:12,880 I'll find something. Well that's fascinating. I appreciate you coming on the show. I appreciate 311 00:29:12,960 --> 00:29:17,960 you letting me talk about this because I really like the feedback that I get. And there's 312 00:29:17,960 --> 00:29:47,940 I need to add to this besides thanking you for the opportunity to have these discussions that I really enjoy. I would like to thank, of course, Tyath and Brent for the work that they've done on AIO to make it so easy to use and for adding all these features in AIO plus like, you know, Apple Weather Kit that I'm using now. But I also like to go back to like the first architecture that I put in place with the two-way radio kind of a setup. And I think that's really, really cool. And I think that's really, really cool. And I think that's really, really cool. And I think that's 313 00:29:47,960 --> 00:29:54,360 up, that was made possible by a lot of work that Tony DiCola did, because he introduced 314 00:29:54,560 --> 00:30:00,900 MicroPython into that environment very creatively and made that really useful. So I appreciate 315 00:30:01,020 --> 00:30:05,840 all the work that he put into that and the leadership that he had shown back then to 316 00:30:05,920 --> 00:30:12,320 see the possibility to put MicroPython on these little devices. And of course, the evolution 317 00:30:12,320 --> 00:30:17,700 the CircuitPython has just made them even easier to use. And then Jerry N, Jerry Neal, 318 00:30:18,660 --> 00:30:42,300 he was a developer for Apple back in those days, and I think he's a part-time developer now. Jerry N, his handle on Discord, he did some really breakthrough work in getting the two-way radio drivers for CircuitPython, and those were game-changers for me that got me into this whole rattle that I'm traveling through. 319 00:30:42,300 --> 00:30:46,420 through now and having fun with the corrosion bond. 320 00:30:47,000 --> 00:30:47,500 - That's great. 321 00:30:48,260 --> 00:30:49,260 - So I wanna thank those people. 322 00:30:49,840 --> 00:30:52,000 You know, the community has really been supportive 323 00:30:52,520 --> 00:30:54,700 of all these things and giving me lots of suggestions 324 00:30:54,920 --> 00:30:57,060 and ideas and so I appreciate that. 325 00:30:57,400 --> 00:30:59,500 - I'll make sure I share the learn guides in the show notes 326 00:30:59,520 --> 00:31:01,160 and hopefully you'll get some more feedback from it. 327 00:31:02,280 --> 00:31:04,500 - That's super, it's something I look forward to. 328 00:31:04,980 --> 00:31:06,420 - Jan, thanks so much for being on the show. 329 00:31:07,760 --> 00:31:09,060 - Oh, you're welcome and thanks for having me. 330 00:31:10,480 --> 00:31:12,280 - Thanks to Jan for coming on the show 331 00:31:12,280 --> 00:31:16,800 his weather station, its architecture, and how CircuitPython and Adafruit I/O+ have helped 332 00:31:16,880 --> 00:31:17,460 his project. 333 00:31:17,980 --> 00:31:21,720 And remember what Jan said - if you have any feedback after listening or looking at the 334 00:31:21,780 --> 00:31:23,740 project on the Adafruit Playground, let him know! 335 00:31:24,580 --> 00:31:28,940 For show notes, transcripts, and more, visit www.circuitpythonshow.com. 336 00:31:29,440 --> 00:31:31,060 Until next time, stay positive. 337 00:31:31,200 --> 00:31:32,280 (electronic music)