Saturday, February 04, 2017

ESP8266 and OTA upgrades

An OTA (Over The Air) upgrade is not really a new idea. I've worked with Cisco routers for a long time and when we started getting flash file systems we were able to upgrade the firmware and keep a backup copy in case the new version caused too many issues. We'd update the firmware while the router ran and reboot at a convenient time to minimize downtime. While that's not OTA it was as remote as you could get. I had no idea where the equipment was but I could perform the upgrade from the comfort of my laptop at 3 AM. If we add WiFi to the mix it's now what I'm referring to as OTA. Similarly OTA upgrades on the ESP8266 will allow you to have 2 copies of the firmware. You can upgrade without having to physically remove the device from service. Which could be difficult if the ESP8266 is embedded into your house electrical or an appliance such as a dishwasher or garage door opener. I haven't attempted an OTA upgrade yet so I don't know if the device performs its normal functions while it's downloading. That might be a function of the device's firmware. It should be possible but this is still a micro-controller and it does have other limited resources (such as RAM). I'll need to take a look at that.

The reason for the interest in the OTA updates is that I have a bunch of the ESP8266 boards (Adafruit's Huzzah board, ESP01, ESP12, etc.) and they're in a number of devices I've found such as the Sonoff products, a couple of WiFi outlets I picked up at Walmart's and the loose ESP01s which I intend to use for serial to WiFi converters. The Adafruit Huzzah boards have the larger 4MB/32Mb chip (it's shielded so I can't see it). Many of the older devices have the 25Q40 SPI Flash chip (512KB = 4Mb). This is just large enough to support firmware with OTA, flash file system and the firmware image with MQTT support. Not much room there for a second firmware image. But by upgrading to something like a 25Q32 (4MB = 32Mb) there's more than enough room for even 2 copies of large firmware images. I've also poked around found someone using a 25Q128 chip (16MB = 128Mb). For now I'll stick with what I know works, the 25Q32 and keep an eye on the rest. I've also found a nice ESP8266 Memory Map. And finally one interesting note I found. It appears the on board SPI flash needs to support QIO mode and not SPI for the processor to run. Not sure why that is but I'll keep digging.

One thing not mentioned above is security. We'll we need to work on that. But as I understand it the MQTT support also supports secure protocols and login. I'll work with that and see where that takes me. The ESP8266's processor is 32bit so it has more than enough power to handle all the tasks I've listed so far. I'm really looking forward to using the ESP8266's to monitor and control my home. Having control via MQTT will make things easier and with the OTA updates it should make it pretty easy to build a device that's very easily added to a smart home with minimal configuration by the end user. I'll need to put further work into that but we'll were that takes us. It really looks like we've got all the parts that will make Smart Technology easy to use and secure. We'll see.

Wednesday, January 18, 2017

I love the smell of solder in the morning

I've probably used that title before but it's true. Well I actually don't breath in the stuff but I do enjoy soldering and working with electronics. It brings me back to my electronics background (my first degree and main interest). This weekend I was supposed to go to InfoAge and do a VCF repair workshop to work on my Atari 600xl and my PiDP8. I don't have a working TV setup to hook up the 600xl and the 600xl doesn't have a monitor interface. Which means converters won't work either. So my intention is to first determine that the 600xl works (it does, more later), then add the parts needed and to upgrade it to a monitor interface and improve the video output. I have gathered all my notes together for the 600xl. I did my homework and ordered all the parts so I now have everything I need. I made sure to order the correct parts for the upgrades such as better inductors (beads, lower DC resistance) and the correct sets of resistors to do impedance matching on the video outputs. I've also organized my notes for things like determining the EBC on a transistor (don't be trusting), Color NTSC signal and the 600xl schematics. I worked on the 600xl on Monday night at IXR and found that I had a nice NTSC signal coming off the video out of the 600xl (yea!). Unfortunately the scope was acting up (bump the lead and I'd lose the sync argh). I spent a lot of time with that (I'll need to service that). I also spent the rest of the night discussing Raspberry Pis, Arduinos, MQTT, Node-Red, HA and IoT.

I also started putting together the PiDP8, I didn't exactly start in the correct order. I started with the switches and I probably should have left them until last. Well it might be inconvenient but putting it together won't be impossible. I'm looking forward to having the PiDP8 running and playing Colossal Caverns on it. It's definitely a throwback to my past when I spent my EE programming course playing Colossal Caverns instead of writing BASIC programs. I do recall getting an easy A in the course so I must have done all the work and I recall being constantly interrupted by other students needing help with their programs. I guess I did okay. ;-)

I love the A8 because it was my first computer and my friends and I had them. My first was the Atari 800xl, which I upgraded to 256K DRAM and Omnimon XL. So some time this week I'll fix up the 600xl and modifiy it. I want it running by next week. Then it's time for the DRAM upgrade (16K to 64K), upgrade the ROM to include Omnimon XL and BASIC version C. Then I have a 65C816 and I'll add some more static memory and flash. I want to get a version of Omnimon that will work with the 65C816. This will be a fun side project. But don't expect the 65C816 upgrade for a while. I need to design a nice daughter board to add to the 600xl so I can add the features without damaging the original motherboard.