File tree Expand file tree Collapse file tree 5 files changed +89
-2
lines changed
Expand file tree Collapse file tree 5 files changed +89
-2
lines changed Original file line number Diff line number Diff line change 3737 board :
3838 - fqbn : " esp32:esp32:esp32"
3939 type : esp32
40+ - fqbn : " arduino:esp32:nano_nora"
41+ type : arduino_esp32
4042
4143 include :
4244 - board :
4648 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
4749 libraries : |
4850 - name: Arduino_DebugUtils
51+ sketch-paths : |
52+ - examples/OTA
53+ - examples/LOLIN_32_Blink
54+ - board :
55+ type : arduino_esp32
56+ platforms : |
57+ - name: arduino:esp32
58+ libraries : |
59+ - name: Arduino_DebugUtils
60+ sketch-paths : |
61+ - examples/OTA
62+ - examples/NANO_ESP32_Blink
4963
5064 steps :
5165 - name : Checkout
6680 - source-path: ./
6781 ${{ matrix.libraries }}
6882 sketch-paths : |
69- - examples
83+ ${{ matrix.sketch-paths }}
7084 enable-deltas-report : true
7185 sketches-report-path : ${{ env.SKETCHES_REPORTS_PATH }}
7286
Original file line number Diff line number Diff line change 1+ /*
2+ * Blink for Arduino NANO ESP32 board
3+ *
4+ * This sketch can be used to generate an example binary that can be uploaded to ESP32 via OTA.
5+ * It needs to be used together with OTA.ino
6+ *
7+ * Steps to test OTA:
8+ * 1) Upload this sketch or any other sketch (this one this one lights up the RGB LED with different colours).
9+ * 2) In the IDE select: Sketch -> Export compiled Binary
10+ * 3) Upload the exported binary to a server
11+ * 4) Open the related OTA.ino sketch and eventually update the OTA_FILE_LOCATION
12+ * 5) Upload the sketch OTA.ino to perform OTA
13+ */
14+
15+ void setLed (int blue, int gree, int red) {
16+ if (blue == 1 ) {
17+ digitalWrite (LED_BLUE, LOW);
18+ }
19+ else {
20+ digitalWrite (LED_BLUE, HIGH);
21+ }
22+
23+ if (gree == 1 ) {
24+ digitalWrite (LED_GREEN, LOW);
25+ }
26+ else {
27+ digitalWrite (LED_GREEN, HIGH);
28+ }
29+
30+ if (red == 1 ) {
31+ digitalWrite (LED_RED, LOW);
32+ }
33+ else {
34+ digitalWrite (LED_RED, HIGH);
35+ }
36+ }
37+
38+
39+ void setup ()
40+ {
41+ pinMode (LED_BLUE, OUTPUT);
42+ pinMode (LED_GREEN, OUTPUT);
43+ pinMode (LED_RED, OUTPUT);
44+ }
45+
46+ void loop ()
47+ { // Blue LED on
48+ setLed (1 , 0 , 0 );
49+ delay (1000 );
50+ // Green LED on
51+ setLed (0 , 1 , 0 );
52+ delay (1000 );
53+ // Red LED on
54+ setLed (0 , 0 , 1 );
55+ delay (1000 );
56+ }
Original file line number Diff line number Diff line change 3636static char const SSID[] = SECRET_SSID; /* your network SSID (name) */
3737static char const PASS[] = SECRET_PASS; /* your network password (use for WPA, or use as key for WEP) */
3838
39+
40+ #if defined(ARDUINO_NANO_ESP32)
41+ static char const OTA_FILE_LOCATION[] = " https://downloads.arduino.cc/ota/NANO_ESP32_Blink.ino.ota" ;
42+ #else
3943static char const OTA_FILE_LOCATION[] = " https://downloads.arduino.cc/ota/LOLIN_32_Blink.ino.ota" ;
44+ #endif
4045
4146/* *****************************************************************************
4247 * SETUP/LOOP
@@ -95,7 +100,11 @@ void setup()
95100 }
96101
97102 Serial.println (" Performing a reset after which the bootloader will start the new firmware." );
103+ #if defined(ARDUINO_NANO_ESP32)
104+ Serial.println (" Hint: Arduino NANO ESP32 will blink Red Green and Blue." );
105+ #else
98106 Serial.println (" Hint: LOLIN32 will blink Blue." );
107+ #endif
99108 delay (1000 ); /* Make sure the serial message gets out before the reset. */
100109 ota.reset ();
101110}
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ int Arduino_ESP32_OTA::download(const char * ota_url)
189189 return static_cast <int >(Error::OtaHeaderLength);
190190 }
191191
192- if (_ota_header.header .magic_number != 0x45535033 )
192+ if (_ota_header.header .magic_number != ARDUINO_ESP32_OTA_MAGIC )
193193 {
194194 return static_cast <int >(Error::OtaHeaterMagicNumber);
195195 }
Original file line number Diff line number Diff line change 2626#include < WiFiClientSecure.h>
2727#include " decompress/utility.h"
2828
29+ /* *****************************************************************************
30+ DEFINES
31+ ******************************************************************************/
32+ #if defined (ARDUINO_NANO_ESP32)
33+ #define ARDUINO_ESP32_OTA_MAGIC 0x23410070
34+ #else
35+ #define ARDUINO_ESP32_OTA_MAGIC 0x45535033
36+ #endif
2937/* *****************************************************************************
3038 CONSTANTS
3139 ******************************************************************************/
You can’t perform that action at this time.
0 commit comments