forked from espressif/arduino-esp32
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
ff90778173 | |||
4e9d1ee237 | |||
c1a94b5326 | |||
3e160587f3 | |||
79010b6498 | |||
9925772db0 | |||
c77aed4ac4 | |||
901a341949 | |||
9f6d0d2958 | |||
9efecc1be0 | |||
b0c6991bcf | |||
8afdd71b3a | |||
871dd183d8 | |||
05111bbde7 | |||
bad53905e8 | |||
95b87545e7 | |||
9f8f05735b | |||
a835bb26c4 | |||
5e46c9bae6 | |||
659c8ad528 | |||
2fe965259a | |||
0161e28614 | |||
4e5cbdaa7f | |||
12ca9e8b52 |
@ -28,6 +28,7 @@ Most of the framework is implemented. Most noticable is the missing analogWrite.
|
||||
- [Using PlatformIO](docs/platformio.md)
|
||||
- [Building with make](docs/make.md)
|
||||
- [Using as ESP-IDF component](docs/esp-idf_component.md)
|
||||
- [Using OTAWebUpdater](docs/OTAWebUpdate/OTAWebUpdate.md)
|
||||
|
||||
#### Decoding exceptions
|
||||
|
||||
|
198
boards.txt
198
boards.txt
@ -4,6 +4,7 @@ menu.FlashMode=Flash Mode
|
||||
menu.FlashSize=Flash Size
|
||||
menu.PartitionScheme=Partition Scheme
|
||||
menu.DebugLevel=Core Debug Level
|
||||
menu.PSRAM=PSRAM
|
||||
|
||||
##############################################################
|
||||
|
||||
@ -28,6 +29,12 @@ esp32.build.flash_freq=40m
|
||||
esp32.build.flash_mode=dio
|
||||
esp32.build.boot=dio
|
||||
esp32.build.partitions=default
|
||||
esp32.build.defines=
|
||||
|
||||
esp32.menu.PSRAM.disabled=Disabled
|
||||
esp32.menu.PSRAM.disabled.build.defines=
|
||||
esp32.menu.PSRAM.enabled=Enabled
|
||||
esp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
|
||||
|
||||
esp32.menu.PartitionScheme.default=Default
|
||||
esp32.menu.PartitionScheme.default.build.partitions=default
|
||||
@ -94,6 +101,164 @@ esp32.menu.DebugLevel.verbose.build.code_debug=5
|
||||
|
||||
##############################################################
|
||||
|
||||
cw02.name=XinaBox CW02
|
||||
|
||||
cw02.upload.tool=esptool
|
||||
cw02.upload.maximum_size=1310720
|
||||
cw02.upload.maximum_data_size=294912
|
||||
cw02.upload.wait_for_upload_port=true
|
||||
|
||||
cw02.serial.disableDTR=true
|
||||
cw02.serial.disableRTS=true
|
||||
|
||||
cw02.build.mcu=esp32
|
||||
cw02.build.core=esp32
|
||||
cw02.build.variant=xinabox
|
||||
cw02.build.board=ESP32_DEV
|
||||
|
||||
cw02.build.f_cpu=240000000L
|
||||
cw02.build.flash_size=4MB
|
||||
cw02.build.flash_freq=40m
|
||||
cw02.build.flash_mode=dio
|
||||
cw02.build.boot=dio
|
||||
cw02.build.partitions=default
|
||||
|
||||
cw02.menu.FlashMode.qio=QIO
|
||||
cw02.menu.FlashMode.qio.build.flash_mode=dio
|
||||
cw02.menu.FlashMode.qio.build.boot=qio
|
||||
cw02.menu.FlashMode.dio=DIO
|
||||
cw02.menu.FlashMode.dio.build.flash_mode=dio
|
||||
cw02.menu.FlashMode.dio.build.boot=dio
|
||||
cw02.menu.FlashMode.qout=QOUT
|
||||
cw02.menu.FlashMode.qout.build.flash_mode=dout
|
||||
cw02.menu.FlashMode.qout.build.boot=qout
|
||||
cw02.menu.FlashMode.dout=DOUT
|
||||
cw02.menu.FlashMode.dout.build.flash_mode=dout
|
||||
cw02.menu.FlashMode.dout.build.boot=dout
|
||||
|
||||
cw02.menu.FlashFreq.80=80MHz
|
||||
cw02.menu.FlashFreq.80.build.flash_freq=80m
|
||||
cw02.menu.FlashFreq.40=40MHz
|
||||
cw02.menu.FlashFreq.40.build.flash_freq=40m
|
||||
|
||||
cw02.menu.FlashSize.4M=4MB (32Mb)
|
||||
cw02.menu.FlashSize.4M.build.flash_size=4MB
|
||||
cw02.menu.FlashSize.2M=2MB (16Mb)
|
||||
cw02.menu.FlashSize.2M.build.flash_size=2MB
|
||||
cw02.menu.FlashSize.2M.build.partitions=minimal
|
||||
|
||||
cw02.menu.UploadSpeed.921600=921600
|
||||
cw02.menu.UploadSpeed.921600.upload.speed=921600
|
||||
cw02.menu.UploadSpeed.115200=115200
|
||||
cw02.menu.UploadSpeed.115200.upload.speed=115200
|
||||
cw02.menu.UploadSpeed.256000.windows=256000
|
||||
cw02.menu.UploadSpeed.256000.upload.speed=256000
|
||||
cw02.menu.UploadSpeed.230400.windows.upload.speed=256000
|
||||
cw02.menu.UploadSpeed.230400=230400
|
||||
cw02.menu.UploadSpeed.230400.upload.speed=230400
|
||||
cw02.menu.UploadSpeed.460800.linux=460800
|
||||
cw02.menu.UploadSpeed.460800.macosx=460800
|
||||
cw02.menu.UploadSpeed.460800.upload.speed=460800
|
||||
cw02.menu.UploadSpeed.512000.windows=512000
|
||||
cw02.menu.UploadSpeed.512000.upload.speed=512000
|
||||
|
||||
cw02.menu.DebugLevel.none=None
|
||||
cw02.menu.DebugLevel.none.build.code_debug=0
|
||||
cw02.menu.DebugLevel.error=Error
|
||||
cw02.menu.DebugLevel.error.build.code_debug=1
|
||||
cw02.menu.DebugLevel.warn=Warn
|
||||
cw02.menu.DebugLevel.warn.build.code_debug=2
|
||||
cw02.menu.DebugLevel.info=Info
|
||||
cw02.menu.DebugLevel.info.build.code_debug=3
|
||||
cw02.menu.DebugLevel.debug=Debug
|
||||
cw02.menu.DebugLevel.debug.build.code_debug=4
|
||||
cw02.menu.DebugLevel.verbose=Verbose
|
||||
cw02.menu.DebugLevel.verbose.build.code_debug=5
|
||||
|
||||
##############################################################
|
||||
|
||||
esp32wrover.name=ESP32 Wrover Module
|
||||
|
||||
esp32wrover.upload.tool=esptool
|
||||
esp32wrover.upload.maximum_size=1310720
|
||||
esp32wrover.upload.maximum_data_size=327680
|
||||
esp32wrover.upload.wait_for_upload_port=true
|
||||
|
||||
esp32wrover.serial.disableDTR=true
|
||||
esp32wrover.serial.disableRTS=true
|
||||
|
||||
esp32wrover.build.mcu=esp32
|
||||
esp32wrover.build.core=esp32
|
||||
esp32wrover.build.variant=esp32
|
||||
esp32wrover.build.board=ESP32_DEV
|
||||
|
||||
esp32wrover.build.f_cpu=240000000L
|
||||
esp32wrover.build.flash_size=4MB
|
||||
esp32wrover.build.flash_freq=40m
|
||||
esp32wrover.build.flash_mode=dio
|
||||
esp32wrover.build.boot=dio
|
||||
esp32wrover.build.partitions=default
|
||||
esp32wrover.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
|
||||
|
||||
esp32wrover.menu.PartitionScheme.default=Default
|
||||
esp32wrover.menu.PartitionScheme.default.build.partitions=default
|
||||
esp32wrover.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
|
||||
esp32wrover.menu.PartitionScheme.minimal.build.partitions=minimal
|
||||
esp32wrover.menu.PartitionScheme.no_ota=No OTA (Large APP)
|
||||
esp32wrover.menu.PartitionScheme.no_ota.build.partitions=no_ota
|
||||
esp32wrover.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
|
||||
esp32wrover.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
|
||||
esp32wrover.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
|
||||
esp32wrover.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
|
||||
|
||||
esp32wrover.menu.FlashMode.qio=QIO
|
||||
esp32wrover.menu.FlashMode.qio.build.flash_mode=dio
|
||||
esp32wrover.menu.FlashMode.qio.build.boot=qio
|
||||
esp32wrover.menu.FlashMode.dio=DIO
|
||||
esp32wrover.menu.FlashMode.dio.build.flash_mode=dio
|
||||
esp32wrover.menu.FlashMode.dio.build.boot=dio
|
||||
esp32wrover.menu.FlashMode.qout=QOUT
|
||||
esp32wrover.menu.FlashMode.qout.build.flash_mode=dout
|
||||
esp32wrover.menu.FlashMode.qout.build.boot=qout
|
||||
esp32wrover.menu.FlashMode.dout=DOUT
|
||||
esp32wrover.menu.FlashMode.dout.build.flash_mode=dout
|
||||
esp32wrover.menu.FlashMode.dout.build.boot=dout
|
||||
|
||||
esp32wrover.menu.FlashFreq.80=80MHz
|
||||
esp32wrover.menu.FlashFreq.80.build.flash_freq=80m
|
||||
esp32wrover.menu.FlashFreq.40=40MHz
|
||||
esp32wrover.menu.FlashFreq.40.build.flash_freq=40m
|
||||
|
||||
esp32wrover.menu.UploadSpeed.921600=921600
|
||||
esp32wrover.menu.UploadSpeed.921600.upload.speed=921600
|
||||
esp32wrover.menu.UploadSpeed.115200=115200
|
||||
esp32wrover.menu.UploadSpeed.115200.upload.speed=115200
|
||||
esp32wrover.menu.UploadSpeed.256000.windows=256000
|
||||
esp32wrover.menu.UploadSpeed.256000.upload.speed=256000
|
||||
esp32wrover.menu.UploadSpeed.230400.windows.upload.speed=256000
|
||||
esp32wrover.menu.UploadSpeed.230400=230400
|
||||
esp32wrover.menu.UploadSpeed.230400.upload.speed=230400
|
||||
esp32wrover.menu.UploadSpeed.460800.linux=460800
|
||||
esp32wrover.menu.UploadSpeed.460800.macosx=460800
|
||||
esp32wrover.menu.UploadSpeed.460800.upload.speed=460800
|
||||
esp32wrover.menu.UploadSpeed.512000.windows=512000
|
||||
esp32wrover.menu.UploadSpeed.512000.upload.speed=512000
|
||||
|
||||
esp32wrover.menu.DebugLevel.none=None
|
||||
esp32wrover.menu.DebugLevel.none.build.code_debug=0
|
||||
esp32wrover.menu.DebugLevel.error=Error
|
||||
esp32wrover.menu.DebugLevel.error.build.code_debug=1
|
||||
esp32wrover.menu.DebugLevel.warn=Warn
|
||||
esp32wrover.menu.DebugLevel.warn.build.code_debug=2
|
||||
esp32wrover.menu.DebugLevel.info=Info
|
||||
esp32wrover.menu.DebugLevel.info.build.code_debug=3
|
||||
esp32wrover.menu.DebugLevel.debug=Debug
|
||||
esp32wrover.menu.DebugLevel.debug.build.code_debug=4
|
||||
esp32wrover.menu.DebugLevel.verbose=Verbose
|
||||
esp32wrover.menu.DebugLevel.verbose.build.code_debug=5
|
||||
|
||||
##############################################################
|
||||
|
||||
pico32.name=ESP32 Pico Kit
|
||||
|
||||
pico32.upload.tool=esptool
|
||||
@ -115,6 +280,7 @@ pico32.build.flash_freq=80m
|
||||
pico32.build.flash_mode=dio
|
||||
pico32.build.boot=dio
|
||||
pico32.build.partitions=default
|
||||
pico32.build.defines=
|
||||
|
||||
pico32.menu.UploadSpeed.921600=921600
|
||||
pico32.menu.UploadSpeed.921600.upload.speed=921600
|
||||
@ -166,6 +332,7 @@ esp32thing.build.flash_mode=dio
|
||||
esp32thing.build.flash_size=4MB
|
||||
esp32thing.build.boot=dio
|
||||
esp32thing.build.partitions=default
|
||||
esp32thing.build.defines=
|
||||
|
||||
esp32thing.menu.FlashFreq.80=80MHz
|
||||
esp32thing.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -209,6 +376,7 @@ nina_w10.build.partitions=minimal
|
||||
nina_w10.build.flash_mode=dio
|
||||
nina_w10.build.flash_size=2MB
|
||||
nina_w10.build.flash_freq=40m
|
||||
nina_w10.build.defines=
|
||||
|
||||
nina_w10.menu.UploadSpeed.921600=921600
|
||||
nina_w10.menu.UploadSpeed.921600.upload.speed=921600
|
||||
@ -247,6 +415,7 @@ widora-air.build.flash_mode=dio
|
||||
widora-air.build.flash_size=16MB
|
||||
widora-air.build.boot=dio
|
||||
widora-air.build.partitions=default
|
||||
widora-air.build.defines=
|
||||
|
||||
widora-air.menu.FlashFreq.80=80MHz
|
||||
widora-air.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -290,6 +459,7 @@ esp320.build.flash_mode=qio
|
||||
esp320.build.flash_size=4MB
|
||||
esp320.build.boot=dio
|
||||
esp320.build.partitions=default
|
||||
esp320.build.defines=
|
||||
|
||||
esp320.menu.FlashFreq.80=80MHz
|
||||
esp320.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -333,6 +503,7 @@ nano32.build.flash_mode=dio
|
||||
nano32.build.flash_size=4MB
|
||||
nano32.build.boot=dio
|
||||
nano32.build.partitions=default
|
||||
nano32.build.defines=
|
||||
|
||||
nano32.menu.FlashFreq.80=80MHz
|
||||
nano32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -376,6 +547,7 @@ lolin32.build.flash_mode=dio
|
||||
lolin32.build.flash_size=4MB
|
||||
lolin32.build.boot=dio
|
||||
lolin32.build.partitions=default
|
||||
lolin32.build.defines=
|
||||
|
||||
lolin32.menu.FlashFreq.80=80MHz
|
||||
lolin32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -428,6 +600,7 @@ pocket_32.build.flash_mode=dio
|
||||
pocket_32.build.flash_size=4MB
|
||||
pocket_32.build.boot=dio
|
||||
pocket_32.build.partitions=default
|
||||
pocket_32.build.defines=
|
||||
|
||||
pocket_32.menu.FlashFreq.80=80MHz
|
||||
pocket_32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -471,6 +644,7 @@ WeMosBat.build.flash_mode=dio
|
||||
WeMosBat.build.flash_size=4MB
|
||||
WeMosBat.build.boot=dio
|
||||
WeMosBat.build.partitions=default
|
||||
WeMosBat.build.defines=
|
||||
|
||||
WeMosBat.menu.FlashFreq.80=80MHz
|
||||
WeMosBat.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -527,6 +701,7 @@ espea32.build.flash_mode=dio
|
||||
espea32.build.flash_size=4MB
|
||||
espea32.build.boot=dio
|
||||
espea32.build.partitions=default
|
||||
espea32.build.defines=
|
||||
|
||||
espea32.menu.FlashFreq.80=80MHz
|
||||
espea32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -570,6 +745,7 @@ quantum.build.flash_mode=qio
|
||||
quantum.build.flash_size=16MB
|
||||
quantum.build.boot=dio
|
||||
quantum.build.partitions=default
|
||||
quantum.build.defines=
|
||||
|
||||
quantum.menu.FlashFreq.80=80MHz
|
||||
quantum.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -613,6 +789,7 @@ node32s.build.flash_mode=dio
|
||||
node32s.build.flash_size=4MB
|
||||
node32s.build.boot=dio
|
||||
node32s.build.partitions=default
|
||||
node32s.build.defines=
|
||||
|
||||
node32s.menu.FlashFreq.80=80MHz
|
||||
node32s.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -656,6 +833,7 @@ hornbill32dev.build.flash_mode=dio
|
||||
hornbill32dev.build.flash_size=4MB
|
||||
hornbill32dev.build.boot=dio
|
||||
hornbill32dev.build.partitions=default
|
||||
hornbill32dev.build.defines=
|
||||
|
||||
hornbill32dev.menu.FlashFreq.80=80MHz
|
||||
hornbill32dev.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -698,6 +876,7 @@ hornbill32minima.build.flash_mode=dio
|
||||
hornbill32minima.build.flash_size=4MB
|
||||
hornbill32minima.build.boot=dio
|
||||
hornbill32minima.build.partitions=default
|
||||
hornbill32minima.build.defines=
|
||||
|
||||
hornbill32minima.menu.FlashFreq.80=80MHz
|
||||
hornbill32minima.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -741,6 +920,7 @@ firebeetle32.build.flash_mode=dio
|
||||
firebeetle32.build.flash_size=4MB
|
||||
firebeetle32.build.boot=dio
|
||||
firebeetle32.build.partitions=default
|
||||
firebeetle32.build.defines=
|
||||
|
||||
firebeetle32.menu.FlashFreq.80=80MHz
|
||||
firebeetle32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -784,6 +964,7 @@ intorobot-fig.build.flash_mode=dio
|
||||
intorobot-fig.build.flash_size=4MB
|
||||
intorobot-fig.build.boot=dio
|
||||
intorobot-fig.build.partitions=default
|
||||
intorobot-fig.build.defines=
|
||||
|
||||
intorobot-fig.menu.FlashFreq.80=80MHz
|
||||
intorobot-fig.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -827,6 +1008,7 @@ onehorse32dev.build.flash_mode=dout
|
||||
onehorse32dev.build.flash_size=4MB
|
||||
onehorse32dev.build.boot=dio
|
||||
onehorse32dev.build.partitions=default
|
||||
onehorse32dev.build.defines=
|
||||
|
||||
onehorse32dev.menu.FlashFreq.80=80MHz
|
||||
onehorse32dev.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -870,6 +1052,7 @@ featheresp32.build.flash_mode=dio
|
||||
featheresp32.build.flash_size=4MB
|
||||
featheresp32.build.boot=dio
|
||||
featheresp32.build.partitions=default
|
||||
featheresp32.build.defines=
|
||||
|
||||
featheresp32.menu.FlashFreq.80=80MHz
|
||||
featheresp32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -926,6 +1109,7 @@ nodemcu-32s.build.flash_mode=dio
|
||||
nodemcu-32s.build.flash_size=4MB
|
||||
nodemcu-32s.build.boot=dio
|
||||
nodemcu-32s.build.partitions=default
|
||||
nodemcu-32s.build.defines=
|
||||
|
||||
nodemcu-32s.menu.FlashFreq.80=80MHz
|
||||
nodemcu-32s.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -969,6 +1153,7 @@ mhetesp32devkit.build.flash_mode=dio
|
||||
mhetesp32devkit.build.flash_size=4MB
|
||||
mhetesp32devkit.build.boot=dio
|
||||
mhetesp32devkit.build.partitions=default
|
||||
mhetesp32devkit.build.defines=
|
||||
|
||||
mhetesp32devkit.menu.FlashFreq.80=80MHz
|
||||
mhetesp32devkit.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1034,6 +1219,7 @@ mhetesp32minikit.build.flash_mode=dio
|
||||
mhetesp32minikit.build.flash_size=4MB
|
||||
mhetesp32minikit.build.boot=dio
|
||||
mhetesp32minikit.build.partitions=default
|
||||
mhetesp32minikit.build.defines=
|
||||
|
||||
mhetesp32minikit.menu.FlashFreq.80=80MHz
|
||||
mhetesp32minikit.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1099,6 +1285,7 @@ esp32vn-iot-uno.build.flash_mode=dio
|
||||
esp32vn-iot-uno.build.flash_size=4MB
|
||||
esp32vn-iot-uno.build.boot=dio
|
||||
esp32vn-iot-uno.build.partitions=default
|
||||
esp32vn-iot-uno.build.defines=
|
||||
|
||||
esp32vn-iot-uno.menu.FlashFreq.80=80MHz
|
||||
esp32vn-iot-uno.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1142,6 +1329,7 @@ esp32doit-devkit-v1.build.flash_mode=dio
|
||||
esp32doit-devkit-v1.build.flash_size=4MB
|
||||
esp32doit-devkit-v1.build.boot=dio
|
||||
esp32doit-devkit-v1.build.partitions=default
|
||||
esp32doit-devkit-v1.build.defines=
|
||||
|
||||
esp32doit-devkit-v1.menu.FlashFreq.80=80MHz
|
||||
esp32doit-devkit-v1.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1196,6 +1384,7 @@ esp32-evb.build.flash_mode=dio
|
||||
esp32-evb.build.flash_size=4MB
|
||||
esp32-evb.build.boot=dio
|
||||
esp32-evb.build.partitions=default
|
||||
esp32-evb.build.defines=
|
||||
|
||||
esp32-evb.menu.FlashFreq.80=80MHz
|
||||
esp32-evb.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1228,6 +1417,7 @@ esp32-gateway.build.flash_mode=dio
|
||||
esp32-gateway.build.flash_size=4MB
|
||||
esp32-gateway.build.boot=dio
|
||||
esp32-gateway.build.partitions=default
|
||||
esp32-gateway.build.defines=
|
||||
|
||||
esp32-gateway.menu.FlashFreq.80=80MHz
|
||||
esp32-gateway.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1260,6 +1450,7 @@ espino32.build.flash_mode=dio
|
||||
espino32.build.flash_size=4MB
|
||||
espino32.build.boot=dio
|
||||
espino32.build.partitions=default
|
||||
espino32.build.defines=
|
||||
|
||||
espino32.menu.FlashFreq.80=80MHz
|
||||
espino32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1303,6 +1494,7 @@ m5stack-core-esp32.build.flash_size=4MB
|
||||
m5stack-core-esp32.build.flash_mode=dio
|
||||
m5stack-core-esp32.build.boot=dio
|
||||
m5stack-core-esp32.build.partitions=default
|
||||
m5stack-core-esp32.build.defines=
|
||||
|
||||
m5stack-core-esp32.menu.FlashMode.qio=QIO
|
||||
m5stack-core-esp32.menu.FlashMode.qio.build.flash_mode=dio
|
||||
@ -1381,6 +1573,7 @@ odroid_esp32.build.flash_size=16MB
|
||||
odroid_esp32.build.flash_mode=dio
|
||||
odroid_esp32.build.boot=dio
|
||||
odroid_esp32.build.partitions=default
|
||||
odroid_esp32.build.defines=
|
||||
|
||||
odroid_esp32.menu.FlashMode.qio=QIO
|
||||
odroid_esp32.menu.FlashMode.qio.build.flash_mode=dio
|
||||
@ -1459,6 +1652,7 @@ heltec_wifi_kit_32.build.flash_mode=dio
|
||||
heltec_wifi_kit_32.build.flash_size=4MB
|
||||
heltec_wifi_kit_32.build.boot=dio
|
||||
heltec_wifi_kit_32.build.partitions=default
|
||||
heltec_wifi_kit_32.build.defines=
|
||||
|
||||
heltec_wifi_kit_32.menu.FlashFreq.80=80MHz
|
||||
heltec_wifi_kit_32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1502,6 +1696,7 @@ heltec_wifi_lora_32.build.flash_mode=dio
|
||||
heltec_wifi_lora_32.build.flash_size=4MB
|
||||
heltec_wifi_lora_32.build.boot=dio
|
||||
heltec_wifi_lora_32.build.partitions=default
|
||||
heltec_wifi_lora_32.build.defines=
|
||||
|
||||
heltec_wifi_lora_32.menu.FlashFreq.80=80MHz
|
||||
heltec_wifi_lora_32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1545,6 +1740,7 @@ espectro32.build.flash_size=4MB
|
||||
espectro32.build.flash_mode=dio
|
||||
espectro32.build.boot=dio
|
||||
espectro32.build.partitions=default
|
||||
espectro32.build.defines=
|
||||
|
||||
espectro32.menu.FlashMode.qio=QIO
|
||||
espectro32.menu.FlashMode.qio.build.flash_mode=dio
|
||||
@ -1620,6 +1816,7 @@ CoreESP32.build.flash_mode=dio
|
||||
CoreESP32.build.flash_size=4MB
|
||||
CoreESP32.build.boot=dio
|
||||
CoreESP32.build.partitions=default
|
||||
CoreESP32.build.defines=
|
||||
|
||||
CoreESP32.menu.FlashFreq.80=80MHz
|
||||
CoreESP32.menu.FlashFreq.80.build.flash_freq=80m
|
||||
@ -1663,6 +1860,7 @@ wipy3.build.flash_mode=dio
|
||||
wipy3.build.flash_size=8MB
|
||||
wipy3.build.boot=dio
|
||||
wipy3.build.partitions=default
|
||||
wipy3.build.defines=
|
||||
|
||||
wipy3.menu.FlashFreq.80=80MHz
|
||||
wipy3.menu.FlashFreq.80.build.flash_freq=80m
|
||||
|
@ -1,4 +1,4 @@
|
||||
ARDUINO_CORE_LIBS := $(patsubst $(COMPONENT_PATH)/%,%,$(sort $(dir $(wildcard $(COMPONENT_PATH)/libraries/*/*/))))
|
||||
ARDUINO_CORE_LIBS := $(patsubst $(COMPONENT_PATH)/%,%,$(sort $(dir $(wildcard $(COMPONENT_PATH)/libraries/*/*/)) $(dir $(wildcard $(COMPONENT_PATH)/libraries/*/*/*/))))
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS := cores/esp32 variants/esp32 $(ARDUINO_CORE_LIBS)
|
||||
COMPONENT_PRIV_INCLUDEDIRS := cores/esp32/libb64
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
|
||||
HardwareSerial Serial(0);
|
||||
HardwareSerial Serial1(1);
|
||||
HardwareSerial Serial2(2);
|
||||
#endif
|
||||
|
||||
HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {}
|
||||
|
@ -79,6 +79,8 @@ protected:
|
||||
|
||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
|
||||
extern HardwareSerial Serial;
|
||||
extern HardwareSerial Serial1;
|
||||
extern HardwareSerial Serial2;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -70,7 +70,12 @@ const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT]={
|
||||
};
|
||||
|
||||
typedef void (*voidFuncPtr)(void);
|
||||
static voidFuncPtr __pinInterruptHandlers[GPIO_PIN_COUNT] = {0,};
|
||||
typedef void (*voidFuncPtrArg)(void*);
|
||||
typedef struct {
|
||||
voidFuncPtr fn;
|
||||
void* arg;
|
||||
} InterruptHandle_t;
|
||||
static InterruptHandle_t __pinInterruptHandlers[GPIO_PIN_COUNT] = {0,};
|
||||
|
||||
#include "driver/rtc_io.h"
|
||||
|
||||
@ -193,7 +198,7 @@ extern int IRAM_ATTR __digitalRead(uint8_t pin)
|
||||
|
||||
static intr_handle_t gpio_intr_handle = NULL;
|
||||
|
||||
static void IRAM_ATTR __onPinInterrupt(void *arg)
|
||||
static void IRAM_ATTR __onPinInterrupt()
|
||||
{
|
||||
uint32_t gpio_intr_status_l=0;
|
||||
uint32_t gpio_intr_status_h=0;
|
||||
@ -207,8 +212,12 @@ static void IRAM_ATTR __onPinInterrupt(void *arg)
|
||||
if(gpio_intr_status_l) {
|
||||
do {
|
||||
if(gpio_intr_status_l & ((uint32_t)1 << pin)) {
|
||||
if(__pinInterruptHandlers[pin]) {
|
||||
__pinInterruptHandlers[pin]();
|
||||
if(__pinInterruptHandlers[pin].fn) {
|
||||
if(__pinInterruptHandlers[pin].arg){
|
||||
((voidFuncPtrArg)__pinInterruptHandlers[pin].fn)(__pinInterruptHandlers[pin].arg);
|
||||
} else {
|
||||
__pinInterruptHandlers[pin].fn();
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(++pin<32);
|
||||
@ -217,15 +226,19 @@ static void IRAM_ATTR __onPinInterrupt(void *arg)
|
||||
pin=32;
|
||||
do {
|
||||
if(gpio_intr_status_h & ((uint32_t)1 << (pin - 32))) {
|
||||
if(__pinInterruptHandlers[pin]) {
|
||||
__pinInterruptHandlers[pin]();
|
||||
if(__pinInterruptHandlers[pin].fn) {
|
||||
if(__pinInterruptHandlers[pin].arg){
|
||||
((voidFuncPtrArg)__pinInterruptHandlers[pin].fn)(__pinInterruptHandlers[pin].arg);
|
||||
} else {
|
||||
__pinInterruptHandlers[pin].fn();
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(++pin<GPIO_PIN_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
|
||||
extern void __attachInterruptArg(uint8_t pin, voidFuncPtrArg userFunc, void * arg, int intr_type)
|
||||
{
|
||||
static bool interrupt_initialized = false;
|
||||
|
||||
@ -233,7 +246,8 @@ extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
|
||||
interrupt_initialized = true;
|
||||
esp_intr_alloc(ETS_GPIO_INTR_SOURCE, (int)ESP_INTR_FLAG_IRAM, __onPinInterrupt, NULL, &gpio_intr_handle);
|
||||
}
|
||||
__pinInterruptHandlers[pin] = userFunc;
|
||||
__pinInterruptHandlers[pin].fn = (voidFuncPtr)userFunc;
|
||||
__pinInterruptHandlers[pin].arg = arg;
|
||||
esp_intr_disable(gpio_intr_handle);
|
||||
if(esp_intr_get_cpu(gpio_intr_handle)) { //APP_CPU
|
||||
GPIO.pin[pin].int_ena = 1;
|
||||
@ -244,10 +258,15 @@ extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
|
||||
esp_intr_enable(gpio_intr_handle);
|
||||
}
|
||||
|
||||
extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type) {
|
||||
__attachInterruptArg(pin, (voidFuncPtrArg)userFunc, NULL, intr_type);
|
||||
}
|
||||
|
||||
extern void __detachInterrupt(uint8_t pin)
|
||||
{
|
||||
esp_intr_disable(gpio_intr_handle);
|
||||
__pinInterruptHandlers[pin] = NULL;
|
||||
__pinInterruptHandlers[pin].fn = NULL;
|
||||
__pinInterruptHandlers[pin].arg = NULL;
|
||||
GPIO.pin[pin].int_ena = 0;
|
||||
GPIO.pin[pin].int_type = 0;
|
||||
esp_intr_enable(gpio_intr_handle);
|
||||
@ -258,5 +277,6 @@ extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pi
|
||||
extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("__digitalWrite")));
|
||||
extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")));
|
||||
extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
|
||||
extern void attachInterruptArg(uint8_t pin, voidFuncPtr handler, void * arg, int mode) __attribute__ ((weak, alias("__attachInterruptArg")));
|
||||
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
|
||||
|
||||
|
@ -79,6 +79,7 @@ void digitalWrite(uint8_t pin, uint8_t val);
|
||||
int digitalRead(uint8_t pin);
|
||||
|
||||
void attachInterrupt(uint8_t pin, void (*)(void), int mode);
|
||||
void attachInterruptArg(uint8_t pin, void (*)(void), void * arg, int mode);
|
||||
void detachInterrupt(uint8_t pin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -12,7 +12,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "esp32-hal.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
@ -24,6 +23,7 @@
|
||||
#include "esp_timer.h"
|
||||
#include "esp_bt.h"
|
||||
#include <sys/time.h>
|
||||
#include "esp32-hal.h"
|
||||
|
||||
//Undocumented!!! Get chip temperature in Farenheit
|
||||
//Source: https://github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchbook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
#include "esp32-hal.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#if CONFIG_SPIRAM_SUPPORT
|
||||
#include "esp_spiram.h"
|
||||
|
@ -15,6 +15,10 @@
|
||||
#ifndef _ESP32_HAL_PSRAM_H_
|
||||
#define _ESP32_HAL_PSRAM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool psramInit();
|
||||
bool psramFound();
|
||||
|
||||
@ -22,4 +26,8 @@ void *ps_malloc(size_t size);
|
||||
void *ps_calloc(size_t n, size_t size);
|
||||
void *ps_realloc(void *ptr, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ESP32_HAL_PSRAM_H_ */
|
||||
|
@ -315,11 +315,14 @@ void uartFlush(uart_t* uart)
|
||||
UART_MUTEX_LOCK();
|
||||
while(uart->dev->status.txfifo_cnt);
|
||||
|
||||
uart->dev->conf0.txfifo_rst = 1;
|
||||
uart->dev->conf0.txfifo_rst = 0;
|
||||
//Due to hardware issue, we can not use fifo_rst to reset uart fifo.
|
||||
//See description about UART_TXFIFO_RST and UART_RXFIFO_RST in <<esp32_technical_reference_manual>> v2.6 or later.
|
||||
|
||||
// we read the data out and make `fifo_len == 0 && rd_addr == wr_addr`.
|
||||
while(uart->dev->status.rxfifo_cnt != 0 || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) {
|
||||
READ_PERI_REG(UART_FIFO_REG(uart->num));
|
||||
}
|
||||
|
||||
uart->dev->conf0.rxfifo_rst = 1;
|
||||
uart->dev->conf0.rxfifo_rst = 0;
|
||||
UART_MUTEX_UNLOCK();
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ extern "C" {
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_system.h"
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU (CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000U)
|
||||
@ -60,7 +61,12 @@ void yield(void);
|
||||
#include "esp32-hal-timer.h"
|
||||
#include "esp32-hal-bt.h"
|
||||
#include "esp32-hal-psram.h"
|
||||
#include "esp_system.h"
|
||||
|
||||
#ifndef BOARD_HAS_PSRAM
|
||||
#ifdef CONFIG_SPIRAM_SUPPORT
|
||||
#undef CONFIG_SPIRAM_SUPPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//returns chip temperature in Celsius
|
||||
float temperatureRead();
|
||||
|
59
docs/OTAWebUpdate/OTAWebUpdate.md
Normal file
59
docs/OTAWebUpdate/OTAWebUpdate.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Over the Air through Web browser
|
||||
OTAWebUpdate is done with a web browser that can be useful in the following typical scenarios:
|
||||
- Once the application developed and loading directly from Arduino IDE is inconvenient or not possible
|
||||
- after deployment if user is unable to expose Firmware for OTA from external update server
|
||||
- provide updates after deployment to small quantity of modules when setting an update server is not practicable
|
||||
|
||||
## Requirements
|
||||
- The ESP and the computer must be connected to the same network
|
||||
|
||||
## Implementation
|
||||
The sample implementation has been done using:
|
||||
- example sketch OTAWebUpdater.ino
|
||||
- ESP32 (Dev Module)
|
||||
|
||||
You can use another module also if it meets Flash chip size of the sketch
|
||||
|
||||
1-Before you begin, please make sure that you have the following software installed:
|
||||
- Arduino IDE
|
||||
- Host software depending on O/S you use:
|
||||
- Avahi http://avahi.org/ for Linux
|
||||
- Bonjour http://www.apple.com/support/bonjour/ for Windows
|
||||
- Mac OSX and iOS - support is already built in / no any extra s/w is required
|
||||
|
||||
Prepare the sketch and configuration for initial upload with a serial port
|
||||
- Start Arduino IDE and load sketch OTAWebUpdater.ino available under File > Examples > OTAWebUpdater.ino
|
||||
- Update ssid and pass in the sketch so the module can join your Wi-Fi network
|
||||
- Open File > Preferences, look for “Show verbose output during:” and check out “compilation” option
|
||||
|
||||

|
||||
|
||||
- Upload sketch (Ctrl+U)
|
||||
- Now open web browser and enter the url, i.e. http://esp32.local. Once entered, browser should display a form
|
||||
|
||||

|
||||
|
||||
> username= admin
|
||||
|
||||
> password= admin
|
||||
|
||||
**Note**-*If entering “http://ESP32.local” does not work, try replacing “ESP32” with module’s IP address.This workaround is useful in case the host software installed does not work*.
|
||||
|
||||
Now click on Login button and browser will display a upload form
|
||||
|
||||

|
||||
|
||||
For Uploading the New Firmware you need to provide the Binary File of your Code.
|
||||
|
||||
Exporting Binary file of the Firmware (Code)
|
||||
- Open up the Arduino IDE
|
||||
- Open up the Code, for Exporting up Binary file
|
||||
- Now go to Sketch > export compiled Binary
|
||||

|
||||
|
||||
- Binary file is exported to the same Directory where your code is present
|
||||
|
||||
Once you are comfortable with this procedure go ahead and modify OTAWebUpdater.ino sketch to print some additional messages, compile it, Export new binary file and upload it using web browser to see entered changes on a Serial Monitor
|
||||
|
||||
|
||||
|
BIN
docs/OTAWebUpdate/esp32login.PNG
Normal file
BIN
docs/OTAWebUpdate/esp32login.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
docs/OTAWebUpdate/esp32upload.PNG
Normal file
BIN
docs/OTAWebUpdate/esp32upload.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
BIN
docs/OTAWebUpdate/esp32verbose.PNG
Normal file
BIN
docs/OTAWebUpdate/esp32verbose.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
docs/OTAWebUpdate/exportTobinary.PNG
Normal file
BIN
docs/OTAWebUpdate/exportTobinary.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -4,93 +4,101 @@
|
||||
#include <ESPmDNS.h>
|
||||
#include <Update.h>
|
||||
|
||||
const char* host = "ESP32";
|
||||
const char* host = "esp32";
|
||||
const char* ssid = "xxx";
|
||||
const char* password = "xxxx";
|
||||
|
||||
WebServer server(80);
|
||||
|
||||
const char* loginIndex = "<form name='loginForm'>"
|
||||
"<table width='20%' bgcolor='A09F9F' align='center'>"
|
||||
"<tr>"
|
||||
"<td colspan=2><center><font size=4><b>ESP32 Login Page</b></font></center>"
|
||||
"<br>"
|
||||
/*
|
||||
* Login page
|
||||
*/
|
||||
|
||||
"</td>"
|
||||
"<br>"
|
||||
"<br>"
|
||||
"</tr>"
|
||||
"<td>Username:</td>"
|
||||
"<td><input type='text' size=25 name='userid'><br></td>"
|
||||
"</tr>"
|
||||
"<br>"
|
||||
"<br>"
|
||||
"<tr>"
|
||||
"<td>Password:</td>"
|
||||
"<td><input type='Password' size=25 name='pwd'><br></td>"
|
||||
"<br>"
|
||||
"<br>"
|
||||
"</tr>"
|
||||
const char* loginIndex =
|
||||
"<form name='loginForm'>"
|
||||
"<table width='20%' bgcolor='A09F9F' align='center'>"
|
||||
"<tr>"
|
||||
"<td colspan=2>"
|
||||
"<center><font size=4><b>ESP32 Login Page</b></font></center>"
|
||||
"<br>"
|
||||
"</td>"
|
||||
"<br>"
|
||||
"<br>"
|
||||
"</tr>"
|
||||
"<td>Username:</td>"
|
||||
"<td><input type='text' size=25 name='userid'><br></td>"
|
||||
"</tr>"
|
||||
"<br>"
|
||||
"<br>"
|
||||
"<tr>"
|
||||
"<td>Password:</td>"
|
||||
"<td><input type='Password' size=25 name='pwd'><br></td>"
|
||||
"<br>"
|
||||
"<br>"
|
||||
"</tr>"
|
||||
"<tr>"
|
||||
"<td><input type='submit' onclick='check(this.form)' value='Login'></td>"
|
||||
"</tr>"
|
||||
"</table>"
|
||||
"</form>"
|
||||
"<script>"
|
||||
"function check(form)"
|
||||
"{"
|
||||
"if(form.userid.value=='admin' && form.pwd.value=='admin')"
|
||||
"{"
|
||||
"window.open('/serverIndex')"
|
||||
"}"
|
||||
"else"
|
||||
"{"
|
||||
" alert('Error Password or Username')/*displays error message*/"
|
||||
"}"
|
||||
"}"
|
||||
"</script>";
|
||||
|
||||
/*
|
||||
* Server Index Page
|
||||
*/
|
||||
|
||||
const char* serverIndex =
|
||||
"<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>"
|
||||
"<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
|
||||
"<input type='file' name='update'>"
|
||||
"<input type='submit' value='Update'>"
|
||||
"</form>"
|
||||
"<div id='prg'>progress: 0%</div>"
|
||||
"<script>"
|
||||
"$('form').submit(function(e){"
|
||||
"e.preventDefault();"
|
||||
"var form = $('#upload_form')[0];"
|
||||
"var data = new FormData(form);"
|
||||
" $.ajax({"
|
||||
"url: '/update',"
|
||||
"type: 'POST',"
|
||||
"data: data,"
|
||||
"contentType: false,"
|
||||
"processData:false,"
|
||||
"xhr: function() {"
|
||||
"var xhr = new window.XMLHttpRequest();"
|
||||
"xhr.upload.addEventListener('progress', function(evt) {"
|
||||
"if (evt.lengthComputable) {"
|
||||
"var per = evt.loaded / evt.total;"
|
||||
"$('#prg').html('progress: ' + Math.round(per*100) + '%');"
|
||||
"}"
|
||||
"}, false);"
|
||||
"return xhr;"
|
||||
"},"
|
||||
"success:function(d, s) {"
|
||||
"console.log('success!')"
|
||||
"},"
|
||||
"error: function (a, b, c) {"
|
||||
"}"
|
||||
"});"
|
||||
"});"
|
||||
"</script>";
|
||||
|
||||
"<tr>"
|
||||
"<td><input type='submit' onclick='check(this.form)' value='Login'></td>"
|
||||
"</tr>"
|
||||
"</table>"
|
||||
"</form>"
|
||||
"<script>"
|
||||
"function check(form)"
|
||||
"{"
|
||||
"if(form.userid.value=='admin' && form.pwd.value=='admin')"
|
||||
"{"
|
||||
"window.open('/serverIndex')"
|
||||
"}"
|
||||
"else"
|
||||
"{"
|
||||
" alert('Error Password or Username')/*displays error message*/"
|
||||
|
||||
"}"
|
||||
"}"
|
||||
"</script>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* serverIndex = "<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>"
|
||||
"<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
|
||||
"<input type='file' name='update'>"
|
||||
"<input type='submit' value='Update'>"
|
||||
"</form>"
|
||||
"<div id='prg'>progress: 0%</div>"
|
||||
"<script>"
|
||||
"$('form').submit(function(e){"
|
||||
"e.preventDefault();"
|
||||
"var form = $('#upload_form')[0];"
|
||||
"var data = new FormData(form);"
|
||||
" $.ajax({"
|
||||
"url: '/update',"
|
||||
"type: 'POST',"
|
||||
"data: data,"
|
||||
"contentType: false,"
|
||||
"processData:false,"
|
||||
"xhr: function() {"
|
||||
"var xhr = new window.XMLHttpRequest();"
|
||||
"xhr.upload.addEventListener('progress', function(evt) {"
|
||||
"if (evt.lengthComputable) {"
|
||||
"var per = evt.loaded / evt.total;"
|
||||
"$('#prg').html('progress: ' + Math.round(per*100) + '%');"
|
||||
"}"
|
||||
"}, false);"
|
||||
"return xhr;"
|
||||
"},"
|
||||
"success:function(d, s) {"
|
||||
"console.log('success!')"
|
||||
"},"
|
||||
"error: function (a, b, c) {"
|
||||
"}"
|
||||
"});"
|
||||
"});"
|
||||
"</script>";
|
||||
/*
|
||||
* setup function
|
||||
*/
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
@ -110,7 +118,7 @@ void setup(void) {
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
/*use mdns for host name resolution*/
|
||||
if (!MDNS.begin(host)) { //http://esp32.local
|
||||
if (!MDNS.begin(host)) { //http://esp32.local
|
||||
Serial.println("Error setting up MDNS responder!");
|
||||
while (1) {
|
||||
delay(1000);
|
||||
|
@ -136,6 +136,16 @@ static bool _init_bt(const char *deviceName)
|
||||
}
|
||||
esp_bt_dev_set_device_name(deviceName);
|
||||
|
||||
// the default BTA_DM_COD_LOUDSPEAKER does not work with the macOS BT stack
|
||||
esp_bt_cod_t cod;
|
||||
cod.major = 0b00001;
|
||||
cod.minor = 0b000100;
|
||||
cod.service = 0b00000010110;
|
||||
if (esp_bt_gap_set_cod(cod, ESP_BT_INIT_COD) != ESP_OK) {
|
||||
log_e("%s set cod failed\n", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -296,9 +296,9 @@ String EEPROMClass::readString (int address)
|
||||
if (address + len > _size)
|
||||
return String(0);
|
||||
|
||||
char value[len + 1];
|
||||
char value[len];
|
||||
memcpy((uint8_t*) value, _data + address, len);
|
||||
value[len + 1] = 0;
|
||||
value[len] = 0;
|
||||
return String(value);
|
||||
}
|
||||
|
||||
|
45
libraries/ESP32/examples/GPIOInterrupt/GPIOInterrupt.ino
Normal file
45
libraries/ESP32/examples/GPIOInterrupt/GPIOInterrupt.ino
Normal file
@ -0,0 +1,45 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
struct Button {
|
||||
const uint8_t PIN;
|
||||
uint32_t numberKeyPresses;
|
||||
bool pressed;
|
||||
};
|
||||
|
||||
Button button1 = {23, 0, false};
|
||||
Button button2 = {18, 0, false};
|
||||
|
||||
void IRAM_ATTR isr(void* arg) {
|
||||
Button* s = static_cast<Button*>(arg);
|
||||
s->numberKeyPresses += 1;
|
||||
s->pressed = true;
|
||||
}
|
||||
|
||||
void IRAM_ATTR isr() {
|
||||
button2.numberKeyPresses += 1;
|
||||
button2.pressed = true;
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
pinMode(button1.PIN, INPUT_PULLUP);
|
||||
attachInterruptArg(button1.PIN, isr, &button1, FALLING);
|
||||
pinMode(button2.PIN, INPUT_PULLUP);
|
||||
attachInterrupt(button2.PIN, isr, FALLING);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (button1.pressed) {
|
||||
Serial.printf("Button 1 has been pressed %u times\n", button1.numberKeyPresses);
|
||||
button1.pressed = false;
|
||||
}
|
||||
if (button2.pressed) {
|
||||
Serial.printf("Button 2 has been pressed %u times\n", button2.numberKeyPresses);
|
||||
button2.pressed = false;
|
||||
}
|
||||
static uint32_t lastMillis = 0;
|
||||
if (millis() - lastMillis > 10000) {
|
||||
lastMillis = millis();
|
||||
detachInterrupt(button1.PIN);
|
||||
}
|
||||
}
|
@ -47,7 +47,9 @@ enum SeekMode {
|
||||
class File : public Stream
|
||||
{
|
||||
public:
|
||||
File(FileImplPtr p = FileImplPtr()) : _p(p) {}
|
||||
File(FileImplPtr p = FileImplPtr()) : _p(p) {
|
||||
_timeout = 0;
|
||||
}
|
||||
|
||||
size_t write(uint8_t) override;
|
||||
size_t write(const uint8_t *buf, size_t size) override;
|
||||
|
@ -252,7 +252,7 @@ void HTTPClient::end(void)
|
||||
bool HTTPClient::connected()
|
||||
{
|
||||
if(_tcp) {
|
||||
return (_tcp->connected() || (_tcp->available() > 0));
|
||||
return ((_tcp->available() > 0) || _tcp->connected());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ uint8_t WebServer::_uploadReadByte(WiFiClient& client){
|
||||
int res = client.read();
|
||||
if(res == -1){
|
||||
while(!client.available() && client.connected())
|
||||
yield();
|
||||
delay(2);
|
||||
res = client.read();
|
||||
}
|
||||
return (uint8_t)res;
|
||||
|
@ -94,11 +94,13 @@ WebServer::~WebServer() {
|
||||
void WebServer::begin() {
|
||||
close();
|
||||
_server.begin();
|
||||
_server.setNoDelay(true);
|
||||
}
|
||||
|
||||
void WebServer::begin(uint16_t port) {
|
||||
close();
|
||||
_server.begin(port);
|
||||
_server.setNoDelay(true);
|
||||
}
|
||||
|
||||
String WebServer::_extractParam(String& authReq,const String& param,const char delimit){
|
||||
|
@ -34,10 +34,10 @@ enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END,
|
||||
enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };
|
||||
enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
|
||||
|
||||
#define HTTP_DOWNLOAD_UNIT_SIZE 1460
|
||||
#define HTTP_DOWNLOAD_UNIT_SIZE 1436
|
||||
|
||||
#ifndef HTTP_UPLOAD_BUFLEN
|
||||
#define HTTP_UPLOAD_BUFLEN 2048
|
||||
#define HTTP_UPLOAD_BUFLEN 1436
|
||||
#endif
|
||||
|
||||
#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request
|
||||
|
@ -31,8 +31,6 @@ const char* password = "**********";
|
||||
WiFiServer server(23);
|
||||
WiFiClient serverClients[MAX_SRV_CLIENTS];
|
||||
|
||||
HardwareSerial Serial1(2); // UART1/Serial1 pins 16,17
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println("\nConnecting");
|
||||
@ -62,7 +60,7 @@ void setup() {
|
||||
}
|
||||
|
||||
//start UART and the server
|
||||
Serial1.begin(9600);
|
||||
Serial2.begin(9600);
|
||||
server.begin();
|
||||
server.setNoDelay(true);
|
||||
|
||||
@ -98,7 +96,7 @@ void loop() {
|
||||
if (serverClients[i] && serverClients[i].connected()){
|
||||
if(serverClients[i].available()){
|
||||
//get data from the telnet client and push it to the UART
|
||||
while(serverClients[i].available()) Serial1.write(serverClients[i].read());
|
||||
while(serverClients[i].available()) Serial2.write(serverClients[i].read());
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -108,10 +106,10 @@ void loop() {
|
||||
}
|
||||
}
|
||||
//check UART for data
|
||||
if(Serial1.available()){
|
||||
size_t len = Serial1.available();
|
||||
if(Serial2.available()){
|
||||
size_t len = Serial2.available();
|
||||
uint8_t sbuf[len];
|
||||
Serial1.readBytes(sbuf, len);
|
||||
Serial2.readBytes(sbuf, len);
|
||||
//push UART data to all connected telnet clients
|
||||
for(i = 0; i < MAX_SRV_CLIENTS; i++){
|
||||
if (serverClients[i] && serverClients[i].connected()){
|
||||
|
@ -184,6 +184,11 @@ bool WiFiAPClass::softAPdisconnect(bool wifioff)
|
||||
{
|
||||
bool ret;
|
||||
wifi_config_t conf;
|
||||
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
*conf.ap.ssid = 0;
|
||||
*conf.ap.password = 0;
|
||||
conf.ap.authmode = WIFI_AUTH_OPEN; // auth must be open if pass=0
|
||||
@ -204,6 +209,9 @@ bool WiFiAPClass::softAPdisconnect(bool wifioff)
|
||||
uint8_t WiFiAPClass::softAPgetStationNum()
|
||||
{
|
||||
wifi_sta_list_t clients;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return 0;
|
||||
}
|
||||
if(esp_wifi_ap_get_sta_list(&clients) == ESP_OK) {
|
||||
return clients.num;
|
||||
}
|
||||
@ -217,6 +225,9 @@ uint8_t WiFiAPClass::softAPgetStationNum()
|
||||
IPAddress WiFiAPClass::softAPIP()
|
||||
{
|
||||
tcpip_adapter_ip_info_t ip;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPAddress();
|
||||
}
|
||||
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip);
|
||||
return IPAddress(ip.ip.addr);
|
||||
}
|
||||
@ -229,7 +240,9 @@ IPAddress WiFiAPClass::softAPIP()
|
||||
*/
|
||||
uint8_t* WiFiAPClass::softAPmacAddress(uint8_t* mac)
|
||||
{
|
||||
esp_wifi_get_mac(WIFI_IF_AP, mac);
|
||||
if(WiFiGenericClass::getMode() != WIFI_MODE_NULL){
|
||||
esp_wifi_get_mac(WIFI_IF_AP, mac);
|
||||
}
|
||||
return mac;
|
||||
}
|
||||
|
||||
@ -241,6 +254,9 @@ String WiFiAPClass::softAPmacAddress(void)
|
||||
{
|
||||
uint8_t mac[6];
|
||||
char macStr[18] = { 0 };
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return String();
|
||||
}
|
||||
esp_wifi_get_mac(WIFI_IF_AP, mac);
|
||||
|
||||
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
@ -253,9 +269,12 @@ String WiFiAPClass::softAPmacAddress(void)
|
||||
*/
|
||||
const char * WiFiAPClass::softAPgetHostname()
|
||||
{
|
||||
const char * hostname;
|
||||
const char * hostname = NULL;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return hostname;
|
||||
}
|
||||
if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_AP, &hostname)) {
|
||||
return NULL;
|
||||
return hostname;
|
||||
}
|
||||
return hostname;
|
||||
}
|
||||
@ -267,6 +286,9 @@ const char * WiFiAPClass::softAPgetHostname()
|
||||
*/
|
||||
bool WiFiAPClass::softAPsetHostname(const char * hostname)
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return false;
|
||||
}
|
||||
return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, hostname) == ESP_OK;
|
||||
}
|
||||
|
||||
@ -276,6 +298,9 @@ bool WiFiAPClass::softAPsetHostname(const char * hostname)
|
||||
*/
|
||||
bool WiFiAPClass::softAPenableIpV6()
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return false;
|
||||
}
|
||||
return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP) == ESP_OK;
|
||||
}
|
||||
|
||||
@ -286,6 +311,9 @@ bool WiFiAPClass::softAPenableIpV6()
|
||||
IPv6Address WiFiAPClass::softAPIPv6()
|
||||
{
|
||||
static ip6_addr_t addr;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPv6Address();
|
||||
}
|
||||
if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_AP, &addr)) {
|
||||
return IPv6Address();
|
||||
}
|
||||
|
@ -31,6 +31,118 @@
|
||||
#undef write
|
||||
#undef read
|
||||
|
||||
class WiFiClientRxBuffer {
|
||||
private:
|
||||
size_t _size;
|
||||
uint8_t *_buffer;
|
||||
size_t _pos;
|
||||
size_t _fill;
|
||||
int _fd;
|
||||
bool _failed;
|
||||
|
||||
size_t r_available()
|
||||
{
|
||||
if(_fd < 0){
|
||||
return 0;
|
||||
}
|
||||
int count;
|
||||
int res = lwip_ioctl_r(_fd, FIONREAD, &count);
|
||||
if(res < 0) {
|
||||
_failed = true;
|
||||
return 0;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t fillBuffer()
|
||||
{
|
||||
if(!_buffer){
|
||||
_buffer = (uint8_t *)malloc(_size);
|
||||
}
|
||||
if(_fill && _pos == _fill){
|
||||
_fill = 0;
|
||||
_pos = 0;
|
||||
}
|
||||
if(!_buffer || _size <= _fill || !r_available()) {
|
||||
return 0;
|
||||
}
|
||||
int res = recv(_fd, _buffer + _fill, _size - _fill, MSG_DONTWAIT);
|
||||
if(res < 0 && errno != EWOULDBLOCK) {
|
||||
_failed = true;
|
||||
return 0;
|
||||
}
|
||||
_fill += res;
|
||||
return res;
|
||||
}
|
||||
|
||||
public:
|
||||
WiFiClientRxBuffer(int fd, size_t size=1436)
|
||||
:_size(size)
|
||||
,_buffer(NULL)
|
||||
,_pos(0)
|
||||
,_fill(0)
|
||||
,_fd(fd)
|
||||
,_failed(false)
|
||||
{
|
||||
//_buffer = (uint8_t *)malloc(_size);
|
||||
}
|
||||
|
||||
~WiFiClientRxBuffer()
|
||||
{
|
||||
free(_buffer);
|
||||
}
|
||||
|
||||
bool failed(){
|
||||
return _failed;
|
||||
}
|
||||
|
||||
int read(uint8_t * dst, size_t len){
|
||||
if(!dst || !len || (_pos == _fill && !fillBuffer())){
|
||||
return -1;
|
||||
}
|
||||
size_t a = _fill - _pos;
|
||||
if(len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))){
|
||||
if(len == 1){
|
||||
*dst = _buffer[_pos];
|
||||
} else {
|
||||
memcpy(dst, _buffer + _pos, len);
|
||||
}
|
||||
_pos += len;
|
||||
return len;
|
||||
}
|
||||
size_t left = len;
|
||||
size_t toRead = a;
|
||||
uint8_t * buf = dst;
|
||||
memcpy(buf, _buffer + _pos, toRead);
|
||||
_pos += toRead;
|
||||
left -= toRead;
|
||||
buf += toRead;
|
||||
while(left){
|
||||
if(!fillBuffer()){
|
||||
return len - left;
|
||||
}
|
||||
a = _fill - _pos;
|
||||
toRead = (a > left)?left:a;
|
||||
memcpy(buf, _buffer + _pos, toRead);
|
||||
_pos += toRead;
|
||||
left -= toRead;
|
||||
buf += toRead;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
int peek(){
|
||||
if(_pos == _fill && !fillBuffer()){
|
||||
return -1;
|
||||
}
|
||||
return _buffer[_pos];
|
||||
}
|
||||
|
||||
size_t available(){
|
||||
return _fill - _pos + r_available();
|
||||
}
|
||||
};
|
||||
|
||||
class WiFiClientSocketHandle {
|
||||
private:
|
||||
int sockfd;
|
||||
@ -58,6 +170,7 @@ WiFiClient::WiFiClient():_connected(false),next(NULL)
|
||||
WiFiClient::WiFiClient(int fd):_connected(true),next(NULL)
|
||||
{
|
||||
clientSocketHandle.reset(new WiFiClientSocketHandle(fd));
|
||||
_rxBuffer.reset(new WiFiClientRxBuffer(fd));
|
||||
}
|
||||
|
||||
WiFiClient::~WiFiClient()
|
||||
@ -69,6 +182,7 @@ WiFiClient & WiFiClient::operator=(const WiFiClient &other)
|
||||
{
|
||||
stop();
|
||||
clientSocketHandle = other.clientSocketHandle;
|
||||
_rxBuffer = other._rxBuffer;
|
||||
_connected = other._connected;
|
||||
return *this;
|
||||
}
|
||||
@ -76,6 +190,7 @@ WiFiClient & WiFiClient::operator=(const WiFiClient &other)
|
||||
void WiFiClient::stop()
|
||||
{
|
||||
clientSocketHandle = NULL;
|
||||
_rxBuffer = NULL;
|
||||
_connected = false;
|
||||
}
|
||||
|
||||
@ -100,6 +215,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port)
|
||||
return 0;
|
||||
}
|
||||
clientSocketHandle.reset(new WiFiClientSocketHandle(sockfd));
|
||||
_rxBuffer.reset(new WiFiClientRxBuffer(sockfd));
|
||||
_connected = true;
|
||||
return 1;
|
||||
}
|
||||
@ -260,11 +376,9 @@ size_t WiFiClient::write(Stream &stream)
|
||||
|
||||
int WiFiClient::read(uint8_t *buf, size_t size)
|
||||
{
|
||||
if(!available()) {
|
||||
return -1;
|
||||
}
|
||||
int res = recv(fd(), buf, size, MSG_DONTWAIT);
|
||||
if(res < 0 && errno != EWOULDBLOCK) {
|
||||
int res = -1;
|
||||
res = _rxBuffer->read(buf, size);
|
||||
if(_rxBuffer->failed()) {
|
||||
log_e("%d", errno);
|
||||
stop();
|
||||
}
|
||||
@ -273,16 +387,12 @@ int WiFiClient::read(uint8_t *buf, size_t size)
|
||||
|
||||
int WiFiClient::peek()
|
||||
{
|
||||
if(!available()) {
|
||||
return -1;
|
||||
}
|
||||
uint8_t data = 0;
|
||||
int res = recv(fd(), &data, 1, MSG_PEEK);
|
||||
if(res < 0 && errno != EWOULDBLOCK) {
|
||||
int res = _rxBuffer->peek();
|
||||
if(_rxBuffer->failed()) {
|
||||
log_e("%d", errno);
|
||||
stop();
|
||||
}
|
||||
return data;
|
||||
return res;
|
||||
}
|
||||
|
||||
int WiFiClient::available()
|
||||
@ -290,14 +400,12 @@ int WiFiClient::available()
|
||||
if(!_connected) {
|
||||
return 0;
|
||||
}
|
||||
int count;
|
||||
int res = lwip_ioctl_r(fd(), FIONREAD, &count);
|
||||
if(res < 0) {
|
||||
int res = _rxBuffer->available();
|
||||
if(_rxBuffer->failed()) {
|
||||
log_e("%d", errno);
|
||||
stop();
|
||||
return 0;
|
||||
}
|
||||
return count;
|
||||
return res;
|
||||
}
|
||||
|
||||
// Though flushing means to send all pending data,
|
||||
@ -330,22 +438,9 @@ uint8_t WiFiClient::connected()
|
||||
if (_connected) {
|
||||
uint8_t dummy;
|
||||
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
|
||||
if (res < 0) {
|
||||
switch (errno) {
|
||||
case ENOTCONN:
|
||||
case EPIPE:
|
||||
case ECONNRESET:
|
||||
case ECONNREFUSED:
|
||||
case ECONNABORTED:
|
||||
_connected = false;
|
||||
break;
|
||||
default:
|
||||
_connected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_connected = true;
|
||||
if (res <= 0 && errno != EWOULDBLOCK) {
|
||||
_connected = false;
|
||||
log_i("Disconnected: RES: %d, ERR: %d", res, errno);
|
||||
}
|
||||
}
|
||||
return _connected;
|
||||
|
@ -28,11 +28,13 @@
|
||||
#include <memory>
|
||||
|
||||
class WiFiClientSocketHandle;
|
||||
class WiFiClientRxBuffer;
|
||||
|
||||
class WiFiClient : public Client
|
||||
{
|
||||
protected:
|
||||
std::shared_ptr<WiFiClientSocketHandle> clientSocketHandle;
|
||||
std::shared_ptr<WiFiClientRxBuffer> _rxBuffer;
|
||||
bool _connected;
|
||||
|
||||
public:
|
||||
|
@ -334,7 +334,7 @@ void WiFiGenericClass::removeEvent(wifi_event_id_t id)
|
||||
* @param arg
|
||||
*/
|
||||
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
|
||||
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
|
||||
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_STAIPASSIGNED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
|
||||
#endif
|
||||
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN
|
||||
const char * system_event_reasons[] = { "UNSPECIFIED", "AUTH_EXPIRE", "AUTH_LEAVE", "ASSOC_EXPIRE", "ASSOC_TOOMANY", "NOT_AUTHED", "NOT_ASSOCED", "ASSOC_LEAVE", "ASSOC_NOT_AUTHED", "DISASSOC_PWRCAP_BAD", "DISASSOC_SUPCHAN_BAD", "UNSPECIFIED", "IE_INVALID", "MIC_FAILURE", "4WAY_HANDSHAKE_TIMEOUT", "GROUP_KEY_UPDATE_TIMEOUT", "IE_IN_4WAY_DIFFERS", "GROUP_CIPHER_INVALID", "PAIRWISE_CIPHER_INVALID", "AKMP_INVALID", "UNSUPP_RSN_IE_VERSION", "INVALID_RSN_IE_CAP", "802_1X_AUTH_FAILED", "CIPHER_SUITE_REJECTED", "BEACON_TIMEOUT", "NO_AP_FOUND", "AUTH_FAIL", "ASSOC_FAIL", "HANDSHAKE_TIMEOUT" };
|
||||
@ -376,6 +376,15 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
|
||||
WiFi.begin();
|
||||
}
|
||||
} else if(event->event_id == SYSTEM_EVENT_STA_GOT_IP) {
|
||||
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
|
||||
uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr);
|
||||
uint8_t * mask = (uint8_t *)&(event->event_info.got_ip.ip_info.netmask.addr);
|
||||
uint8_t * gw = (uint8_t *)&(event->event_info.got_ip.ip_info.gw.addr);
|
||||
log_d("STA IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u",
|
||||
ip[0], ip[1], ip[2], ip[3],
|
||||
mask[0], mask[1], mask[2], mask[3],
|
||||
gw[0], gw[1], gw[2], gw[3]);
|
||||
#endif
|
||||
WiFiSTAClass::_setStatus(WL_CONNECTED);
|
||||
setStatusBits(STA_HAS_IP_BIT | STA_CONNECTED_BIT);
|
||||
} else if(event->event_id == SYSTEM_EVENT_STA_LOST_IP) {
|
||||
@ -403,6 +412,15 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
|
||||
} else if(event->event_id == SYSTEM_EVENT_ETH_DISCONNECTED) {
|
||||
clearStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP_BIT | ETH_HAS_IP6_BIT);
|
||||
} else if(event->event_id == SYSTEM_EVENT_ETH_GOT_IP) {
|
||||
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
|
||||
uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr);
|
||||
uint8_t * mask = (uint8_t *)&(event->event_info.got_ip.ip_info.netmask.addr);
|
||||
uint8_t * gw = (uint8_t *)&(event->event_info.got_ip.ip_info.gw.addr);
|
||||
log_d("ETH IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u",
|
||||
ip[0], ip[1], ip[2], ip[3],
|
||||
mask[0], mask[1], mask[2], mask[3],
|
||||
gw[0], gw[1], gw[2], gw[3]);
|
||||
#endif
|
||||
setStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP_BIT);
|
||||
|
||||
} else if(event->event_id == SYSTEM_EVENT_GOT_IP6) {
|
||||
|
@ -399,6 +399,9 @@ uint8_t WiFiSTAClass::waitForConnectResult()
|
||||
*/
|
||||
IPAddress WiFiSTAClass::localIP()
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPAddress();
|
||||
}
|
||||
tcpip_adapter_ip_info_t ip;
|
||||
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip);
|
||||
return IPAddress(ip.ip.addr);
|
||||
@ -412,7 +415,9 @@ IPAddress WiFiSTAClass::localIP()
|
||||
*/
|
||||
uint8_t* WiFiSTAClass::macAddress(uint8_t* mac)
|
||||
{
|
||||
esp_wifi_get_mac(WIFI_IF_STA, mac);
|
||||
if(WiFiGenericClass::getMode() != WIFI_MODE_NULL){
|
||||
esp_wifi_get_mac(WIFI_IF_STA, mac);
|
||||
}
|
||||
return mac;
|
||||
}
|
||||
|
||||
@ -424,6 +429,9 @@ String WiFiSTAClass::macAddress(void)
|
||||
{
|
||||
uint8_t mac[6];
|
||||
char macStr[18] = { 0 };
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return String();
|
||||
}
|
||||
esp_wifi_get_mac(WIFI_IF_STA, mac);
|
||||
|
||||
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
@ -436,6 +444,9 @@ String WiFiSTAClass::macAddress(void)
|
||||
*/
|
||||
IPAddress WiFiSTAClass::subnetMask()
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPAddress();
|
||||
}
|
||||
tcpip_adapter_ip_info_t ip;
|
||||
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip);
|
||||
return IPAddress(ip.netmask.addr);
|
||||
@ -447,6 +458,9 @@ IPAddress WiFiSTAClass::subnetMask()
|
||||
*/
|
||||
IPAddress WiFiSTAClass::gatewayIP()
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPAddress();
|
||||
}
|
||||
tcpip_adapter_ip_info_t ip;
|
||||
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip);
|
||||
return IPAddress(ip.gw.addr);
|
||||
@ -459,6 +473,9 @@ IPAddress WiFiSTAClass::gatewayIP()
|
||||
*/
|
||||
IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPAddress();
|
||||
}
|
||||
ip_addr_t dns_ip = dns_getserver(dns_no);
|
||||
return IPAddress(dns_ip.u_addr.ip4.addr);
|
||||
}
|
||||
@ -469,6 +486,9 @@ IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
|
||||
*/
|
||||
String WiFiSTAClass::SSID() const
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return String();
|
||||
}
|
||||
wifi_ap_record_t info;
|
||||
if(!esp_wifi_sta_get_ap_info(&info)) {
|
||||
return String(reinterpret_cast<char*>(info.ssid));
|
||||
@ -482,6 +502,9 @@ String WiFiSTAClass::SSID() const
|
||||
*/
|
||||
String WiFiSTAClass::psk() const
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return String();
|
||||
}
|
||||
wifi_config_t conf;
|
||||
esp_wifi_get_config(WIFI_IF_STA, &conf);
|
||||
return String(reinterpret_cast<char*>(conf.sta.password));
|
||||
@ -495,6 +518,9 @@ uint8_t* WiFiSTAClass::BSSID(void)
|
||||
{
|
||||
static uint8_t bssid[6];
|
||||
wifi_ap_record_t info;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return NULL;
|
||||
}
|
||||
if(!esp_wifi_sta_get_ap_info(&info)) {
|
||||
memcpy(bssid, info.bssid, 6);
|
||||
return reinterpret_cast<uint8_t*>(bssid);
|
||||
@ -523,6 +549,9 @@ String WiFiSTAClass::BSSIDstr(void)
|
||||
*/
|
||||
int8_t WiFiSTAClass::RSSI(void)
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return 0;
|
||||
}
|
||||
wifi_ap_record_t info;
|
||||
if(!esp_wifi_sta_get_ap_info(&info)) {
|
||||
return info.rssi;
|
||||
@ -536,7 +565,10 @@ int8_t WiFiSTAClass::RSSI(void)
|
||||
*/
|
||||
const char * WiFiSTAClass::getHostname()
|
||||
{
|
||||
const char * hostname;
|
||||
const char * hostname = NULL;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return hostname;
|
||||
}
|
||||
if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_STA, &hostname)){
|
||||
return NULL;
|
||||
}
|
||||
@ -550,6 +582,9 @@ const char * WiFiSTAClass::getHostname()
|
||||
*/
|
||||
bool WiFiSTAClass::setHostname(const char * hostname)
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return false;
|
||||
}
|
||||
return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, hostname) == 0;
|
||||
}
|
||||
|
||||
@ -559,6 +594,9 @@ bool WiFiSTAClass::setHostname(const char * hostname)
|
||||
*/
|
||||
bool WiFiSTAClass::enableIpV6()
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return false;
|
||||
}
|
||||
return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_STA) == 0;
|
||||
}
|
||||
|
||||
@ -569,6 +607,9 @@ bool WiFiSTAClass::enableIpV6()
|
||||
IPv6Address WiFiSTAClass::localIPv6()
|
||||
{
|
||||
static ip6_addr_t addr;
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return IPv6Address();
|
||||
}
|
||||
if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_STA, &addr)){
|
||||
return IPv6Address();
|
||||
}
|
||||
|
@ -364,3 +364,4 @@ void TwoWire::dumpI2C()
|
||||
}
|
||||
|
||||
TwoWire Wire = TwoWire(0);
|
||||
TwoWire Wire1 = TwoWire(1);
|
||||
|
@ -134,6 +134,7 @@ public:
|
||||
};
|
||||
|
||||
extern TwoWire Wire;
|
||||
extern TwoWire Wire1;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -49,7 +49,8 @@ build.flash_size=4MB
|
||||
build.flash_mode=dio
|
||||
build.boot=bootloader
|
||||
build.code_debug=0
|
||||
build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug}
|
||||
build.defines=
|
||||
build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.defines}
|
||||
|
||||
# These can be overridden in platform.local.txt
|
||||
compiler.c.extra_flags=
|
||||
|
@ -36,6 +36,8 @@ function downloadAndMergePackageJSON()
|
||||
|
||||
#curl --verbose -sH "Authorization: token $curlAuthToken" -L -o "$old_json" "$jsonLink"
|
||||
curl -L -o "$old_json" "$jsonLink?access_token=$curlAuthToken"
|
||||
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
|
||||
|
||||
|
||||
#curl -L -o "$old_json" "$jsonLink"
|
||||
|
||||
@ -227,6 +229,7 @@ find $outdir -name '*.DS_Store' -exec rm -f {} \;
|
||||
# handles tool paths differently when package is installed in hardware folder
|
||||
echo " - updating platform.txt..."
|
||||
cat $srcdir/platform.txt | \
|
||||
sed "s/version=.*/version=$ver$extent/g" | \
|
||||
sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \
|
||||
sed 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' \
|
||||
> $outdir/platform.txt
|
||||
@ -255,10 +258,7 @@ echo " - creating package ZIP archive (${package_name_zip})..."
|
||||
pushd $releaseDir >/dev/null
|
||||
|
||||
zip -qr $package_name_zip $package_name
|
||||
if [ $? -ne 0 ]; then
|
||||
echo " !error: failed to create ${package_name_zip} (ZIP errno: $?) => aborting"
|
||||
exit 1
|
||||
fi
|
||||
if [ $? -ne 0 ]; then echo " !error: failed to create ${package_name_zip} (ZIP errno: $?) => aborting"; exit 1; fi
|
||||
|
||||
# Calculate SHA sum and size of ZIP archive
|
||||
sha=`shasum -a 256 $package_name_zip | cut -f 1 -d ' '`
|
||||
@ -296,6 +296,7 @@ set +e
|
||||
|
||||
releasesJson=$releaseDir/releases.json
|
||||
curl -sH "Authorization: token $curlAuth" https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases > $releasesJson
|
||||
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
|
||||
|
||||
prev_release=$(jq -e -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
|
||||
prev_any_release=$(jq -e -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
|
||||
|
@ -77,6 +77,10 @@ shopt -u nocasematch
|
||||
# other lines: converted to bullets
|
||||
# empty lines ignored
|
||||
# if '* ' found as a first char pair, it's converted to '- ' to keep bulleting unified
|
||||
echo Preparing release notes
|
||||
echo -----------------------
|
||||
echo "Tag's message:"
|
||||
|
||||
relNotesRaw=`git show -s --format=%b $varTagName`
|
||||
readarray -t msgArray <<<"$relNotesRaw"
|
||||
|
||||
@ -93,12 +97,19 @@ if [ $arrLen > 3 ]; then
|
||||
if [ "${oneLine:0:2}" == "* " ]; then oneLine=$(echo ${oneLine/\*/-}); fi
|
||||
if [ "${oneLine:0:2}" != "- " ]; then releaseNotes+="- "; fi
|
||||
releaseNotes+="$oneLine\\n"
|
||||
|
||||
#debug output
|
||||
echo " ${oneLine}"
|
||||
fi
|
||||
fi
|
||||
let ind=$ind+1
|
||||
done
|
||||
echo "<tag's message end>"
|
||||
else
|
||||
releaseNotes="#### Release of $varTagName\\n"
|
||||
|
||||
#debug output
|
||||
echo " Release of $varTagName"
|
||||
fi
|
||||
|
||||
# - list of commits (commits.txt must exit in the output dir)
|
||||
@ -107,11 +118,18 @@ if [ -e "$commitFile" ]; then
|
||||
|
||||
releaseNotes+="\\n##### Commits\\n"
|
||||
|
||||
#debug output
|
||||
echo
|
||||
echo "Commits:"
|
||||
|
||||
IFS=$'\n'
|
||||
for next in `cat $commitFile`
|
||||
do
|
||||
IFS=' ' read -r commitId commitMsg <<< "$next"
|
||||
releaseNotes+="- [$commitId](https://github.com/$varRepoSlug/commit/$commitId) $commitMsg\\n"
|
||||
|
||||
#debug output
|
||||
echo " - [$commitId](https://github.com/$varRepoSlug/commit/$commitId) $commitMsg"
|
||||
done
|
||||
rm -f $commitFile
|
||||
fi
|
||||
@ -124,19 +142,32 @@ echo "Checking for possible releases of current tag $varTagName..."
|
||||
HTTP_RESPONSE=$(curl -L --silent --write-out "HTTPSTATUS:%{http_code}" https://api.github.com/repos/$varRepoSlug/releases/tags/$varTagName?access_token=$varAccessToken)
|
||||
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
|
||||
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
|
||||
|
||||
echo " HTTP server response code: $HTTP_STATUS"
|
||||
|
||||
# if the release exists, append/update recent files to its assets vector
|
||||
if [ $HTTP_STATUS -eq 200 ]; then
|
||||
releaseId=$(echo $HTTP_BODY | jq -r '.id')
|
||||
echo " - $varTagName release found (id $releaseId)"
|
||||
|
||||
#merge release notes and overwrite pre-release flag. all other attributes remain unchanged
|
||||
releaseNotesGH=$(echo $HTTP_BODY | jq -r '.body')
|
||||
releaseNotes="$releaseNotesGH\\n$releaseNotes"
|
||||
|
||||
echo " ... updating release notes and pre-release flag"
|
||||
|
||||
curlData="{\"body\": \"$releaseNotes\",\"prerelease\": $varPrerelease}"
|
||||
curl --data "$curlData" https://api.github.com/repos/$varRepoSlug/releases/$releaseId?access_token=$varAccessToken
|
||||
|
||||
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
|
||||
|
||||
#... or create a new release record
|
||||
else
|
||||
curlData="{\"tag_name\": \"$varTagName\",\"target_commitish\": \"master\",\"name\": \"v$varTagName\",\"body\": \"$releaseNotes\",\"draft\": false,\"prerelease\": $varPrerelease}"
|
||||
#echo "DEBUG: curl --data \"${curlData}\" https://api.github.com/repos/${varRepoSlug}/releases?access_token=$varAccessToken | jq -r '.id'"
|
||||
releaseId=$(curl --data "$curlData" https://api.github.com/repos/$varRepoSlug/releases?access_token=$varAccessToken | jq -r '.id')
|
||||
echo " - new release created for $varTagName (id $releaseId)"
|
||||
|
||||
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
|
||||
fi
|
||||
|
||||
# Assets defined by dir contents
|
||||
@ -154,13 +185,22 @@ echo varAssets: $varAssets
|
||||
|
||||
#Upload additional assets
|
||||
if [ ! -z $varAssets ]; then
|
||||
echo
|
||||
echo "Uploading assets:"
|
||||
echo "-----------------"
|
||||
|
||||
curlAuth="Authorization: token $varAccessToken"
|
||||
for filename in $(echo $varAssets | tr ";" "\n")
|
||||
do
|
||||
echo
|
||||
echo Uploading $filename...
|
||||
|
||||
echo " - ${filename}..."
|
||||
curl -X POST -sH "$curlAuth" -H "Content-Type: application/octet-stream" --data-binary @"$filename" https://uploads.github.com/repos/$varRepoSlug/releases/$releaseId/assets?name=$(basename $filename)
|
||||
|
||||
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
|
||||
|
||||
echo
|
||||
echo "OK"
|
||||
echo
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
|
28
variants/xinabox/pins_arduino.h
Normal file
28
variants/xinabox/pins_arduino.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define EXTERNAL_NUM_INTERRUPTS 16
|
||||
#define NUM_DIGITAL_PINS 40
|
||||
#define NUM_ANALOG_INPUTS 16
|
||||
|
||||
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
|
||||
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
|
||||
#define digitalPinHasPWM(p) (p < 34)
|
||||
|
||||
static const uint8_t LED_BUILTIN = 27;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
|
||||
static const uint8_t SS = 5;
|
||||
static const uint8_t MOSI = 23;
|
||||
static const uint8_t MISO = 19;
|
||||
static const uint8_t SCK = 18;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
Reference in New Issue
Block a user