I have 10 ESP8266 nodeMCUs installed. I run a standard sketch in them. All the same other than a bit of board specific configs. When I find a problem or develop a new function that all boards should use, it was a real pain to go to each location and update the board. Sometimes I would bring it back to the bench and sometimes I would take my laptop to the location for updating. Either way, the process sometimes justified not keeping them all up to date.
I found out about being able to update the ESP8266 across wifi. It has been implemented in my basic sketch and I'm starting the process of updating all the boards with the hope I won't have to do this nearly as often.
If you are using the API sketch for the ESP8266, below are the changes required to enable OTA. I'm assuming that you know your way around the sketch and the IDE.
You will need to install python ver. 2.7.13. It is used to do the actual wireless upload. There is a newer version but the doc I found said to use 2.7.13 and it worked for me so that is what I am passing along. I actually had installed it a while back in relation to testing the ESP32 so I thought I was good to go. Turns out no. There was a question during installation that I remember thinking no which was to add it to the path. Should have taken it. I had to add the python folder to my global path. Then all was good. If you install it, opt in for adding to the path.
https://www.python.org/downloads/
Next, look in the examples for the ESP8266 for File/Examples/nodeMCU/ArduinoOTA/BasicOTA. Make sure you can get a clean compile. That will make sure you have the libraries you need. Play around with it a bit to get familiar with how OTA works. Add some blinking code to the sketch. On the nodeMCU, the built in LED is pin 2. Upload the sketch.
This next step is important. When you add a new board to OTA, you have to exit the IDE and re-enter for it to be seen by the IDE. Once you do that, you should be able to go into Tools/Port in the IDE and see your new node. The naming convention in the code that follows is "Arduino API Board:xx" where xx is the board number. Select that as you would have the comm port before and it should upload to it. You will see a difference in the way the dots are shown during upload so you will know it is the new OTA loader.
Once you've got that working, the rest is pretty much cut and paste into your sketch.
I found out about being able to update the ESP8266 across wifi. It has been implemented in my basic sketch and I'm starting the process of updating all the boards with the hope I won't have to do this nearly as often.
If you are using the API sketch for the ESP8266, below are the changes required to enable OTA. I'm assuming that you know your way around the sketch and the IDE.
You will need to install python ver. 2.7.13. It is used to do the actual wireless upload. There is a newer version but the doc I found said to use 2.7.13 and it worked for me so that is what I am passing along. I actually had installed it a while back in relation to testing the ESP32 so I thought I was good to go. Turns out no. There was a question during installation that I remember thinking no which was to add it to the path. Should have taken it. I had to add the python folder to my global path. Then all was good. If you install it, opt in for adding to the path.
https://www.python.org/downloads/
Next, look in the examples for the ESP8266 for File/Examples/nodeMCU/ArduinoOTA/BasicOTA. Make sure you can get a clean compile. That will make sure you have the libraries you need. Play around with it a bit to get familiar with how OTA works. Add some blinking code to the sketch. On the nodeMCU, the built in LED is pin 2. Upload the sketch.
This next step is important. When you add a new board to OTA, you have to exit the IDE and re-enter for it to be seen by the IDE. Once you do that, you should be able to go into Tools/Port in the IDE and see your new node. The naming convention in the code that follows is "Arduino API Board:xx" where xx is the board number. Select that as you would have the comm port before and it should upload to it. You will see a difference in the way the dots are shown during upload so you will know it is the new OTA loader.
Once you've got that working, the rest is pretty much cut and paste into your sketch.
Comment