ESP32
ESP32¶
Building with idf.py¶
Build and Flash:
>>> sudo esptool.py -p /dev/ttyACM0 -b 115200 chip_id
esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting....
Detecting chip type... ESP32-C3
Chip is ESP32-C3 (QFN32) (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 48:31:b7:03:c0:04
Uploading stub...
Running stub...
Stub running...
Warning: ESP32-C3 has no Chip ID. Reading MAC instead.
MAC: 48:31:b7:03:c0:04
Hard resetting via RTS pin...
>>> idf.py --list-targets
esp32
esp32s2
esp32c3
esp32s3
esp32c2
esp32c6
esp32h2
>>> idf.py set-target esp32c3
Adding set-target dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Executing action: set-target
[...]
>>> idf.py build
Executing action: all (aliases: build)
Running ninja in directory /tmp/esp32-wifi-penetration-tool/build
Executing "ninja all"...
[15/890] Generating ../../partition_table/partition-table.binPartition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
[...]
Project build complete. To flash, run this command:
/home/generalzero/.espressif/python_env/idf5.1_py3.11_env/bin/python ../../opt/esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32c3 write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/esp32-wifi-penetration-tool.bin
or run 'idf.py -p (PORT) flash'
>>> /home/generalzero/.espressif/python_env/idf5.1_py3.11_env/bin/python ../../opt/esp-idf/components/esptool_py/esptool/esptool.py -p /dev/ttyACM0 -b 460800 --before default_reset --after hard_reset --chip esp32c3 write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/esp32-wifi-penetration-tool.bin
Building and flashing ESP32¶
https://github.com/hackgnar/ble_ctf/blob/master/docs/setup.md#build-from-docker
Building the :
#Use the Docker file in the ble_ctf to build
sudo docker build -t blectf .
sudo docker run -it -v ./:/ble_ctf --name blectf blectf
#When in the container
cd /ble_ctf
idf.py set-target esp32-c3
idf.py menuconfig
# Enable Component_config -> Bluetooth
# Enable Component_config -> Bluetooth -> Bluedroid Options -> Enable BLE 4.2 features
idf.py build
#Exit Container
Flash the Binaries onto the ESP32-C3:
>>> sudo esptool.py -p /dev/ttyACM0 -b 460800 --before default_reset --after hard_reset --chip esp32c3 write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/ble_ctf.bin
esptool.py v4.6.2
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-C3 (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 64:e8:33:82:af:68
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x000d8fff...
Compressed 20240 bytes to 12424...
Wrote 20240 bytes (12424 compressed) at 0x00000000 in 0.2 seconds (effective 658.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 635.9 kbit/s)...
Hash of data verified.
Compressed 822240 bytes to 419104...
Wrote 822240 bytes (419104 compressed) at 0x00010000 in 6.1 seconds (effective 1086.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
ESP32-c3 Maurder¶
Build from scratch:
1. Install Libraries from arduino Library Manager
- Install specifically https://github.com/bigbrodude6119/ESPAsyncWebServer
2. Install Esp32 boards from arduino Board Manager
3. Change config.h
board target #define GENERIC_ESP32
4. Change %User%\Documents\Arduino\libraries\ESP_Async_WebServer\src\AsyncWebSocket.cpp
in ESPAsyncWebServer. IPAddress(0U)
to return IPAddress((uint32_t)0);
5. Add Adafruit_NeoPixel strip;
into LedInterface.cpp
. Comment out extern Adafruit_NeoPixel strip;
from LedInterface.h
6. Change the