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 37
37
board :
38
38
- fqbn : " esp32:esp32:esp32"
39
39
type : esp32
40
+ - fqbn : " arduino:esp32:nano_nora"
41
+ type : arduino_esp32
40
42
41
43
include :
42
44
- board :
46
48
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
47
49
libraries : |
48
50
- 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
49
63
50
64
steps :
51
65
- name : Checkout
66
80
- source-path: ./
67
81
${{ matrix.libraries }}
68
82
sketch-paths : |
69
- - examples
83
+ ${{ matrix.sketch-paths }}
70
84
enable-deltas-report : true
71
85
sketches-report-path : ${{ env.SKETCHES_REPORTS_PATH }}
72
86
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 36
36
static char const SSID[] = SECRET_SSID; /* your network SSID (name) */
37
37
static char const PASS[] = SECRET_PASS; /* your network password (use for WPA, or use as key for WEP) */
38
38
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
39
43
static char const OTA_FILE_LOCATION[] = " https://downloads.arduino.cc/ota/LOLIN_32_Blink.ino.ota" ;
44
+ #endif
40
45
41
46
/* *****************************************************************************
42
47
* SETUP/LOOP
@@ -95,7 +100,11 @@ void setup()
95
100
}
96
101
97
102
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
98
106
Serial.println (" Hint: LOLIN32 will blink Blue." );
107
+ #endif
99
108
delay (1000 ); /* Make sure the serial message gets out before the reset. */
100
109
ota.reset ();
101
110
}
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ int Arduino_ESP32_OTA::download(const char * ota_url)
189
189
return static_cast <int >(Error::OtaHeaderLength);
190
190
}
191
191
192
- if (_ota_header.header .magic_number != 0x45535033 )
192
+ if (_ota_header.header .magic_number != ARDUINO_ESP32_OTA_MAGIC )
193
193
{
194
194
return static_cast <int >(Error::OtaHeaterMagicNumber);
195
195
}
Original file line number Diff line number Diff line change 26
26
#include < WiFiClientSecure.h>
27
27
#include " decompress/utility.h"
28
28
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
29
37
/* *****************************************************************************
30
38
CONSTANTS
31
39
******************************************************************************/
You can’t perform that action at this time.
0 commit comments