When in doubt - rebuild everything
/I’ve spent the last week trying to get an ESP8266 device to host a configuration web site for my Connected Little Boxes. It’s proved to be quite a challenge (see Monday). I had the worst possible fault. One that only appears every now and then. And causes the whole thing to just crash.
In the end I decided to go back to first principles and run one of the example applications in a brand new project. And it worked a treat. That’s good because I now know that what I’m trying to do is possible (always useful knowledge) but bad because my code still doesn’t work. In the end I migrated all my code into the working example and went from there. In the process I discovered that, for whatever reason, the code I had been using was based on very old driver code for the device. Early versions of the ESP8266 libraries were known to be a bit buggy and unreliable. I thought that mine had been updated as part of the normal behaviour of PlatformIO (which I’m using to build and mange the app). This turned out not to be the case.
So - if you’ve got problems that you don’t think are your fault, it might be worth checking to see if you are using the latest version of the libraries for your product. Of course, new versions also bring new bugs of their own, so make sure that you keep copies of the old version too…..