ESP8266/OTA: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
(Memory probe #ff6600)
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Exploring Over The Air (OTA) updates.
Exploring Over The Air (OTA) updates.


There is an OTA option in the Arduino IDE, however there doesn't seem to be much on how to use it.
* https://harizanov.com/2015/06/firmware-over-the-air-fota-for-esp8266-soc/
 
There is an OTA option in the Arduino IDE.
 
<span style="color:#ff6600;font-family:courier;font-size:24pt">'''UPDATED'''</span>
 
This now actually works with Arduino IDE 1.6.5 r5
 
Freshly updated documentation
 
* https://github.com/esp8266/Arduino/blob/master/doc/ota_updates.md
 
Verified this working with DNS_SD_Arduino_OTA Example sketch using ESP-01 & ESP-12e with 1MB memory.


It's also important to know the flash memory size, ESP.getFlashChipSize() may be useful.
The "Network ports" option seemed to require restarting the IDE after uploading the initial firmware via serial.
 
 
It's also important to know the flash memory size, ESP.getFreeSketchSpace() may be useful, free space must be greater than sketch size.


<pre>
<pre>
void setup() {
void setup() {
  // put your setup code here, to run once:
   Serial.begin(115200);
   Serial.begin(115200);
   Serial.println("Flash Memory Stuff");
   Serial.println("Flash Memory Stuff");


   Serial.println("ESP ID: ");
   Serial.println("ESP ID: ");
   Serial.println(ESP.getChipId());
   Serial.println(ESP.getChipId(), HEX);
   
   
   Serial.println("Flash ID: ");
   Serial.println("Flash ID: ");
   Serial.println(ESP.getFlashChipId());
   Serial.println(ESP.getFlashChipId(), HEX);
   Serial.println("Flash Size: ");
   Serial.println("Flash Size: ");
   Serial.println(ESP.getFlashChipSize());
 
   Serial.println("Flash Speed: ");
   Serial.printf("Sketch size: %u\n", ESP.getSketchSize());
  Serial.println(ESP.getFlashChipSpeed());
   Serial.printf("Free size: %u\n", ESP.getFreeSketchSpace());
}
}
</pre>
</pre>


Serial output from an ESP-01
Serial output from an ESP-01
<pre>
<pre>
Flash Memory Stuff
ESP ID:  
ESP ID:  
14478709
DCED75
Flash ID:  
Flash ID:  
1327328
1440E0
Flash Size:  
Sketch size: 304716
524288
Free size: 655360
Flash Speed:  
40000000
</pre>
</pre>
 
''Note: Updated to HEX formatting of Flash ID.
 
* https://harizanov.com/2015/06/firmware-over-the-air-fota-for-esp8266-soc/

Latest revision as of 18:51, 10 November 2015

Exploring Over The Air (OTA) updates.

There is an OTA option in the Arduino IDE.

UPDATED

This now actually works with Arduino IDE 1.6.5 r5

Freshly updated documentation

Verified this working with DNS_SD_Arduino_OTA Example sketch using ESP-01 & ESP-12e with 1MB memory.

The "Network ports" option seemed to require restarting the IDE after uploading the initial firmware via serial.


It's also important to know the flash memory size, ESP.getFreeSketchSpace() may be useful, free space must be greater than sketch size.

void setup() {
  Serial.begin(115200);
  Serial.println("Flash Memory Stuff");

  Serial.println("ESP ID: ");
  Serial.println(ESP.getChipId(), HEX);
 
  Serial.println("Flash ID: ");
  Serial.println(ESP.getFlashChipId(), HEX);
  Serial.println("Flash Size: ");

  Serial.printf("Sketch size: %u\n", ESP.getSketchSize());
  Serial.printf("Free size: %u\n", ESP.getFreeSketchSpace());
}

Serial output from an ESP-01

ESP ID: 
DCED75
Flash ID: 
1440E0
Sketch size: 304716
Free size: 655360

Note: Updated to HEX formatting of Flash ID.