51 |
52 |
53 | )rawliteral";
54 |
--------------------------------------------------------------------------------
/06_async_web_led/async_web_led/main.cpp:
--------------------------------------------------------------------------------
1 | // Main module of async_web_led PlatformIO/Arduino sketch
2 | // Copyright: see notice in async_web_led.ino
3 |
4 | #include
5 | #include
6 | #include // See: Note on Location of Async Libraries
7 | #include // See: Note on Location of Async Libraries
8 | #include "html.h"
9 | #include "secrets.h"
10 |
11 | #ifndef PLATFORMIO
12 | // WiFi.setTxPower(TX_POWER) may be needed for some SuperMini C3 boards
13 | // If using Arduino define TX_POWER here if needed:
14 | #define TX_POWER WIFI_POWER_11dBm
15 | // For PlatformIO, TX_POWER is defined in the platformio.ini config file.
16 | // Similarly
17 | //#define LED_ON LOW
18 | #endif
19 |
20 | #if defined(ARDUINO_MAKERGO_C3_SUPERMINI)
21 | #define TITLE "MakerGO C3 SuperMini WEB SERVER"
22 | //static const uint8_t BOOT_BUILTIN = 9; // defined in pins_arduino.h
23 | #define BOOT_BUILTIN BOOT_BUILTIN
24 | #elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
25 | #define TITLE "Nologo ESP32C3 Super Mini WEB SERVER"
26 | static const uint8_t BOOT_BUILTIN = 9;
27 | #define BOOT_BUILTIN BOOT_BUILTIN
28 | #elif defined(ARDUINO_SUPER_MINI_C3)
29 | #define TITLE "DfRobot Beetle ESP32-C3 WEB SERVER" //"Modified ESP32 C3 DEVKITC 02"
30 | static const uint8_t BOOT_BUILTIN = 9;
31 | #define BOOT_BUILTIN BOOT_BUILTIN
32 | #elif defined(ARDUINO_SUPER_MINI_ESP32C3)
33 | #define TITLE "Custom ESP32C3 Super Mini WEB SERVER"
34 | //static const uint8_t BOOT_BUILTIN = 9; //defined in pins_arduino.h
35 | //#define BOOT_BUILTIN BOOT_BUILTIN //defined in pins_arduino.h
36 | #elif defined(ARDUINO_ESP32C3_DEV)
37 | #define TITLE "ESP32-C3 Dev Module WEB SERVER"
38 | static const uint8_t BOOT_BUILTIN = 9; // defined in pins_arduino.h
39 | #define BOOT_BUILTIN BOOT_BUILTIN
40 | #elif defined(ARDUINO_XIAO_ESP32C3)
41 | #define TITLE "Seeed XIAO ESP32C3 WEB SERVER"
42 | static const uint8_t BOOT_BUILTIN = 9; // defined in pins_arduino.h
43 | #define BOOT_BUILTIN BOOT_BUILTIN
44 | #else
45 | #error "Unknown device"
46 | #endif
47 |
48 | #if defined(ARDUINO_SUPER_MINI_ESP32C3)
49 | static uint8_t ledPin = BUILTIN_LED;
50 | static uint8_t ledOn = LOW;
51 | #elif not defined(ARDUINO_XIAO_ESP32C3)
52 | static uint8_t ledPin = 8;
53 | static uint8_t ledOn = LOW;
54 | #else
55 | static uint8_t ledPin = LED_PIN;
56 | static uint8_t ledOn = LED_ON;
57 | #endif
58 |
59 | int ledState = 0;
60 | String ledStatus = "OFF";
61 |
62 | void setLed(int value) {
63 | digitalWrite(ledPin, (value)? ledOn : 1-ledOn);
64 | ledState = value;
65 | ledStatus = ((digitalRead(ledPin) == ledOn) ? "ON" : "OFF");
66 | Serial.printf("LED now %s.\n", ledStatus.c_str());
67 | }
68 |
69 | void toggleLed(void) {
70 | setLed(1-ledState);
71 | }
72 |
73 | // Webserver instance using default HTTP port 80
74 | AsyncWebServer server(80);
75 |
76 | // Template substitution function
77 | String processor(const String& var){
78 | if (var == "LEDSTATUS") return String(default_envs = seeed_xiao_esp32c3edStatus);
79 | if (var == "SERVERNAME") return String(TITLE);
80 | return String(); // empty string
81 | }
82 |
83 | // 404 error handler
84 | void notFound(AsyncWebServerRequest *request) {
85 | request->send_P(404, "text/html", html_404, processor);
86 | }
87 |
88 | void setup() {
89 | // Set the digital pin connected to the LED as an output
90 | pinMode(ledPin, OUTPUT);
91 |
92 | Serial.begin();
93 | delay(1000); // 1 second delay should be sufficient
94 |
95 | setLed(0);
96 |
97 | WiFi.mode(WIFI_STA);
98 |
99 | #ifdef TX_POWER
100 | WiFi.setTxPower(TX_POWER);
101 | Serial.printf("Setting Wi-Fi Tx power to %d\n", TX_POWER);
102 | #endif
103 |
104 | // Connect to Wi-Fi network with SSID and password
105 | Serial.print("Connecting to ");
106 | Serial.println(ssid);
107 |
108 | WiFi.begin(ssid, password);
109 | while (WiFi.status() != WL_CONNECTED) {
110 | delay(100);
111 | Serial.print(".");
112 | }
113 | // Print local IP address and start web server
114 | Serial.println("");
115 | Serial.println("WiFi connected.");
116 | Serial.println("IP address: ");
117 | Serial.println(WiFi.localIP());
118 |
119 | // Setup and start Web server
120 | server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
121 | Serial.println("Index page requested");
122 | request->send_P(200, "text/html", html_index, processor);
123 | });
124 | server.on("/led", HTTP_GET, [](AsyncWebServerRequest *request){
125 | Serial.println("Web button pressed");
126 | toggleLed();
127 | request->send_P(200, "text/html", html_index, processor); // updates the client making the request only
128 | });
129 | server.onNotFound(notFound);
130 | server.begin();
131 |
132 | setLed(0);
133 | Serial.println("setup completed.");
134 | }
135 |
136 | void loop() {
137 | }
138 |
--------------------------------------------------------------------------------
/06_async_web_led/async_web_led/secrets.h.template:
--------------------------------------------------------------------------------
1 | // Replace with the correct network credentials
2 | const char* ssid = "***Wi-Fi***Network***Name***";
3 | const char* password = "***Wi-Fi***Network***Password***";
4 |
--------------------------------------------------------------------------------
/06_async_web_led/include/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for project header files.
3 |
4 | A header file is a file containing C declarations and macro definitions
5 | to be shared between several project source files. You request the use of a
6 | header file in your project source file (C, C++, etc) located in `src` folder
7 | by including it, with the C preprocessing directive `#include'.
8 |
9 | ```src/main.c
10 |
11 | #include "header.h"
12 |
13 | int main (void)
14 | {
15 | ...
16 | }
17 | ```
18 |
19 | Including a header file produces the same results as copying the header file
20 | into each source file that needs it. Such copying would be time-consuming
21 | and error-prone. With a header file, the related declarations appear
22 | in only one place. If they need to be changed, they can be changed in one
23 | place, and programs that include the header file will automatically use the
24 | new version when next recompiled. The header file eliminates the labor of
25 | finding and changing all the copies as well as the risk that a failure to
26 | find one copy will result in inconsistencies within a program.
27 |
28 | In C, the usual convention is to give header files names that end with `.h'.
29 | It is most portable to use only letters, digits, dashes, and underscores in
30 | header file names, and at most one dot.
31 |
32 | Read more about using header files in official GCC documentation:
33 |
34 | * Include Syntax
35 | * Include Operation
36 | * Once-Only Headers
37 | * Computed Includes
38 |
39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
40 |
--------------------------------------------------------------------------------
/06_async_web_led/platformio.ini:
--------------------------------------------------------------------------------
1 | ; PlatformIO Project Configuration File
2 | ;
3 | ; Build options: build flags, source filter
4 | ; Upload options: custom upload port, speed and extra flags
5 | ; Library options: dependencies, extra library storages
6 | ; Advanced options: extra scripting
7 | ;
8 | ; Please visit documentation for the other options and examples
9 | ; https://docs.platformio.org/page/projectconf.html
10 |
11 | [platformio]
12 | ; Make the Arduino IDE happy (.INO file must be in a directory of the same name)
13 | src_dir = async_web_led
14 | ;default_envs = super_mini_c3
15 | default_envs = super_mini_esp32c3
16 | ;default_envs = seeed_xiao_esp32c3
17 |
18 | [extra]
19 | baud=460800
20 |
21 | [env]
22 | platform = espressif32
23 | framework = arduino
24 | ;upload_port = /dev/ttyACM0
25 | ;monitor_port = /dev/ttyACM0
26 | monitor_speed = ${extra.baud}
27 | lib_deps = esphome/ESPAsyncWebServer-esphome@^3.2.2
28 |
29 | ; using a "near enough" board definition
30 | [env:super_mini_c3]
31 | board = dfrobot_beetle_esp32c3
32 | build_flags =
33 | -D ARDUINO_SUPER_MINI_C3
34 | -D TX_POWER=WIFI_POWER_11dBm
35 | -D LED_ON=LOW
36 |
37 | ; using a custom added board definition
38 | [env:super_mini_esp32c3]
39 | board = super_mini_esp32c3
40 | build_flags =
41 | -D TX_POWER=WIFI_POWER_11dBm
42 | -D LED_ON=LOW
43 |
44 | [env:seeed_xiao_esp32c3]
45 | board = seeed_xiao_esp32c3
46 | ; Connecting an external LED:
47 | ; The diode's cathode (-, usually the short lead on the flat side of the LED) is connected to GND.
48 | ; The diode's anode (+, usually the long lead on the round side of the LED) is connected to a
49 | ; current limiting 240 ohm resistor. The other lead of the resistor is connected to an I/O pin.
50 | ; If the pins are inverted, then set LED_ON to LOW.
51 | -D LED_PIN=D4
52 | -D LED_ON=HIGH
53 |
--------------------------------------------------------------------------------
/07_ble_led/.gitignore:
--------------------------------------------------------------------------------
1 | .pio
2 | .vscode/.browse.c_cpp.db*
3 | .vscode/c_cpp_properties.json
4 | .vscode/launch.json
5 | .vscode/ipch
6 |
--------------------------------------------------------------------------------
/07_ble_led/ble_led/ble_led.ino:
--------------------------------------------------------------------------------
1 | /*
2 | * ble_led.ino
3 | *
4 | * Toggle an external LED on and off an app using Bluetooth LE
5 | *
6 | * This is a stub to satisfy the Arduino IDE, the source code is in
7 | * the file main.cpp in the same directory.
8 | *
9 | * This sketch will compile in the Arduino IDE
10 | *
11 | * 1- Add https://espressif.github.io/arduino-esp32/package_esp32_index.json
12 | * in the Additional Boards Manager URLS in the Preferences window.
13 | * 2- Install platform esp32 by Espressif version 3.0.1 or newer with the Boards Manager
14 | * 3- Select the MakerGO ESP32 C3 SuperMini board
15 | * 4- Install the ArduinoBLE (1.3.6 or newer) library with the Library Manager
16 | * 5- Temporarily move the directory ~/.arduino15/packages/esp32/hardware/esp32/3.0.1/libraries/BLE
17 | * outside of the ~/.arduino15/ tree to avoid name conflicts
18 | *
19 | * This sketch will also compile in PlatformIO with platform espressif32 v6.6.0 or newer
20 | *
21 | * Use the following platformio.ini configuration file
22 | * [env:dfrobot_beetle_esp32c3]
23 | * platform = espressif32
24 | * board = dfrobot_beetle_esp32c3
25 | * framework = arduino
26 | * lib_deps = arduino-libraries/ArduinoBLE@^1.3.2
27 | *
28 | * or use
29 | * [env:super_mini_esp32c3]
30 | * platform = espressif32
31 | * board = super_mini_esp32c3
32 | * framework = arduino
33 | * lib_deps = arduino-libraries/ArduinoBLE@^1.3.2
34 | * if the the board definition file super_mini_esp32c3.json and the variant pin
35 | * definition file pins_arduino.h have been added as explained in
36 | * https://github.com/sigmdel/supermini_esp32c3_sketches/tree/main/resources
37 | *
38 | * Michel Deslierres
39 | * May 10, 2024
40 | *
41 | * Copyright 2024, Michel Deslierres. No rights reserved, this code is in the public domain.
42 | * In those jurisdictions where this may be a problem, the BSD Zero Clause License applies.
43 | *
44 |
45 | // SPDX-License-Identifier: 0BSD
46 |
--------------------------------------------------------------------------------
/07_ble_led/ble_led/main.cpp:
--------------------------------------------------------------------------------
1 | // Main module of ble_led PlatformIO/Arduino sketch
2 | // Copyright: see notice in ble_led.ino
3 |
4 | /*
5 | * Bluetooth (LE) controled LED sketch for XIAO ESP32C3 in platformIO
6 | * Based on
7 | * XIAO ESP32C3 Bluetooth Tutorial, Range test, and Home Automation
8 | * @ https://www.electroniclinic.com/xiao-esp32c3-bluetooth-tutorial-range-test-and-home-automation/#XIAO_ESP32C3_Home_Automation
9 | * by Shahzada Fahad (Engr)
10 | *
11 | * Turn LED on/off with either of the following Androi/IOS app:
12 | * nRF Connect for Mobile
13 | * Android: https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&gl=US
14 | * IOS: https://apps.apple.com/us/app/nrf-connect-for-mobile/id1054362403
15 | * or
16 | * LightBlue
17 | * Android: https://play.google.com/store/apps/details?id=com.punchthrough.lightblueexplorer&gl=US
18 | * IOS: https://apps.apple.com/us/app/lightblue/id557428110
19 | */
20 |
21 | #include // Needed in PlatformIO
22 | #include
23 |
24 | #ifndef PlatformIO
25 | #define LED_PIN 8
26 | #define LED_ON LOW
27 | #endif
28 |
29 | #if defined(LED_PIN)
30 | static uint8_t ledPin = LED_PIN;
31 | #elif defined(BUILTIN_LED)
32 | static uint8_t ledPin = BUILTIN_LED;
33 | #else
34 | #error "Unkown LED pin"
35 | #endif
36 |
37 | #if defined(LED_ON)
38 | static uint8_t ledOn = LED_ON;
39 | #else
40 | static uint8_t ledOn = HIGH;
41 | #endif
42 |
43 | int ledState = 0;
44 | String ledStatus = "OFF";
45 |
46 | void setLed(int value) {
47 | digitalWrite(ledPin, (value)? ledOn : 1-ledOn);
48 | ledState = value;
49 | ledStatus = ((digitalRead(ledPin) == ledOn) ? "ON" : "OFF");
50 | Serial.printf("LED now %s.\n", ledStatus.c_str());
51 | }
52 |
53 | // Bluetooth® Low Energy LED Service
54 | BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214");
55 |
56 | // Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, readable and writable by central
57 | BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
58 |
59 | void setup() {
60 | // Set the digital pin connected to the LED as an output
61 | pinMode(ledPin, OUTPUT);
62 | digitalWrite(ledPin, 1-ledOn);
63 |
64 | Serial.begin();
65 | delay(2000); // 2 second delay should be sufficient
66 |
67 |
68 | // begin initialization
69 | if (!BLE.begin()) {
70 | Serial.println("Could not start Bluetooth® Low Energy module!");
71 | while (1);
72 | }
73 |
74 | Serial.println("Bluetooth® Low Energy (BLE) module started.");
75 | Serial.print("Local address: ");
76 | Serial.println(BLE.address());
77 |
78 | // set advertised local name and service UUID:
79 | BLE.setLocalName("HOME Automation"); // this will appear in the App search result.
80 | BLE.setAdvertisedService(ledService);
81 |
82 | // add the characteristic to the service
83 | ledService.addCharacteristic(switchCharacteristic);
84 |
85 | // add service
86 | BLE.addService(ledService);
87 | // set the initial value for the characeristic, i.e. LED off
88 | switchCharacteristic.writeValue(0);
89 | Serial.println("LED service added.");
90 |
91 | BLE.advertise();
92 | Serial.println("\"HOME Automation\" device now being advertised");
93 | Serial.println("Setup completed.");
94 | }
95 |
96 |
97 | void loop() {
98 | // listen for Bluetooth® Low Energy peripherals to connect:
99 | BLEDevice central = BLE.central();
100 |
101 | // if a central is connected to peripheral:
102 | if (central) {
103 | String dName = central.deviceName();
104 | if (!dName.length())
105 | dName = central.localName();
106 | if (!dName.length())
107 | dName = "device"; // default if no name is found for the newly connected device
108 | dName += ": " + central.address(); // add the latter's MAC address
109 | Serial.print("Connected to ");
110 | Serial.println(dName);
111 |
112 | while (central.connected()) {
113 | if (switchCharacteristic.written()) {
114 | int Rvalue=switchCharacteristic.value();
115 | Serial.printf("Received switchCharacteristic = %02x.\n", Rvalue);
116 |
117 | if ((Rvalue == 0) || (Rvalue == 1)) {
118 | setLed(Rvalue);
119 | } else {
120 | Serial.println("Ignored, expected 00 or 01.\n");
121 | }
122 |
123 | }
124 | }
125 |
126 | Serial.print("Disconnected from ");
127 | Serial.println(dName);
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/07_ble_led/include/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for project header files.
3 |
4 | A header file is a file containing C declarations and macro definitions
5 | to be shared between several project source files. You request the use of a
6 | header file in your project source file (C, C++, etc) located in `src` folder
7 | by including it, with the C preprocessing directive `#include'.
8 |
9 | ```src/main.c
10 |
11 | #include "header.h"
12 |
13 | int main (void)
14 | {
15 | ...
16 | }
17 | ```
18 |
19 | Including a header file produces the same results as copying the header file
20 | into each source file that needs it. Such copying would be time-consuming
21 | and error-prone. With a header file, the related declarations appear
22 | in only one place. If they need to be changed, they can be changed in one
23 | place, and programs that include the header file will automatically use the
24 | new version when next recompiled. The header file eliminates the labor of
25 | finding and changing all the copies as well as the risk that a failure to
26 | find one copy will result in inconsistencies within a program.
27 |
28 | In C, the usual convention is to give header files names that end with `.h'.
29 | It is most portable to use only letters, digits, dashes, and underscores in
30 | header file names, and at most one dot.
31 |
32 | Read more about using header files in official GCC documentation:
33 |
34 | * Include Syntax
35 | * Include Operation
36 | * Once-Only Headers
37 | * Computed Includes
38 |
39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
40 |
--------------------------------------------------------------------------------
/07_ble_led/platformio.ini:
--------------------------------------------------------------------------------
1 | ; PlatformIO Project Configuration File
2 | ;
3 | ; Build options: build flags, source filter
4 | ; Upload options: custom upload port, speed and extra flags
5 | ; Library options: dependencies, extra library storages
6 | ; Advanced options: extra scripting
7 | ;
8 | ; Please visit documentation for the other options and examples
9 | ; https://docs.platformio.org/page/projectconf.html
10 |
11 | [platformio]
12 | ; Make the Arduino IDE happy (.INO file must be in a directory of the same name)
13 | src_dir = ble_led
14 | ;default_envs = super_mini_c3
15 | default_envs = super_mini_esp32c3
16 | ;default_envs = seeed_xiao_esp32c3
17 |
18 | [extra]
19 | baud=460800
20 |
21 | [env]
22 | platform = espressif32
23 | framework = arduino
24 | ;upload_port = /dev/ttyACM0
25 | ;monitor_port = /dev/ttyACM0
26 | monitor_speed = ${extra.baud}
27 | lib_deps =
28 | arduino-libraries/ArduinoBLE@^1.3.2 ; https://github.com/arduino-libraries/ArduinoBLE.git
29 |
30 | ; using a "near enough" board definition
31 | [env:super_mini_c3]
32 | board = dfrobot_beetle_esp32c3
33 | build_flags =
34 | -D ARDUINO_SUPER_MINI_C3
35 | -D TX_POWER=WIFI_POWER_11dBm
36 | -D LED_ON=LOW
37 |
38 | ; using a custom added board definition
39 | [env:super_mini_esp32c3]
40 | board = super_mini_esp32c3
41 | build_flags =
42 | -D TX_POWER=WIFI_POWER_11dBm
43 | -D LED_ON=LOW
44 |
45 | [env:seeed_xiao_esp32c3]
46 | board = seeed_xiao_esp32c3
47 | ; Connecting an external LED:
48 | ; The diode's cathode (-, usually the short lead on the flat side of the LED) is connected to GND.
49 | ; The diode's anode (+, usually the long lead on the round side of the LED) is connected to a
50 | ; current limiting 240 ohm resistor. The other lead of the resistor is connected to an I/O pin.
51 | ; If the pins are inverted, then set LED_ON to LOW.
52 | build_flags =
53 | -D LED_PIN=D4
54 | -D LED_ON=HIGH
55 |
--------------------------------------------------------------------------------
/08_ble_led2/ble_led2/ble_led2.ino:
--------------------------------------------------------------------------------
1 | /*
2 | * ble_led2.ino
3 | * Turn on or off the builtin LED with a Bluetooth LE app
4 | * with included macro to set BLE power level.
5 | *
6 | * This is a stub to satisfy the Arduino IDE, the source code is in
7 | * the file main.cpp in the same directory.
8 | *
9 | * This sketch will compile in the Arduino IDE
10 | *
11 | * 1- Add https://espressif.github.io/arduino-esp32/package_esp32_index.json
12 | * in the Additional Boards Manager URLS in the Preferences window.
13 | * 2- Install platform esp32 by Espressif version 3.0.2 or newer with the Boards Manager
14 | * 3- Select the MakerGO ESP32 C3 SuperMini board
15 | *
16 | * Michel Deslierres
17 | * July 4, 2024
18 | *
19 | * Copyright 2024, Michel Deslierres. No rights reserved, this code is in the public domain.
20 | * In those jurisdictions where this may be a problem, the BSD Zero Clause License applies.
21 | * */
22 | // SPDX-License-Identifier: 0BSD
23 |
--------------------------------------------------------------------------------
/08_ble_led2/ble_led2/main.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 |
6 | // This is a simplified example which can use custom UUIDs in which case
7 | // the client will probably show the UUID for the service and characteristic
8 | // or it can use some more or less valid reserved UUID from the Bluetooth(R)
9 | // Assigned Numbers document https://www.bluetooth.com/specifications/assigned-numbers/
10 | //
11 | #define USE_CUSTOM_UUIDS
12 |
13 | #define BLUETOOTH_NAME "BLE_LED2"
14 |
15 | #ifdef USE_CUSTOM_UUIDS
16 | // Custom UUID for service and characteristic must not conflict with a reserved UUID
17 | // that is no number in the XXXXXXXX-0000-1000-8000-00805F9B34FB range
18 | // Generated at https://www.guidgenerator.com/
19 | // https://novelbits.io/uuid-for-custom-services-and-characteristics/
20 | #define SERVICE_UUID "57a81fc3-3c5f-4d29-80e7-8b074e34888c"
21 | #define CHARACTERISTIC_UUID "2eeae074-8955-47f7-9470-73f85112974f"
22 | #else
23 | #define SERVICE_UUID "1815" //"00001815-0000-1000-8000-00805F9B34FB" // Automation IO Service
24 | //"1812" //"00001812-0000-1000-8000-00805F9B34FB" // Human Interface Device Service
25 | //"181c" //"0000181c-0000-1000-8000-00805F9B34FB" // User Data Service
26 | #define CHARACTERISTIC_UUID "2BE2" //"00002BE2-0000-1000-8000-00805F9B34FB" // Light Output
27 | //"2BO5" //"00002B05-0000-1000-8000-00805F9B34FB" // Power
28 | #endif
29 |
30 | #if defined(BUILTIN_LED)
31 | const uint8_t ledPin = BUILTIN_LED;
32 | const uint8_t ledOn = LOW;
33 | #else
34 | #error "ledPin not defined"
35 | #endif
36 |
37 | const char* ESP_PWR_LEVELS[] = {
38 | "ESP_PWR_LVL_N24", // 0, -24dbm
39 | "ESP_PWR_LVL_N21", // 1, -21dbm
40 | "ESP_PWR_LVL_N18", // 2, -18dbm
41 | "ESP_PWR_LVL_N15", // 3, -15dbm
42 | "ESP_PWR_LVL_N12", // 4, -12dbm
43 | "ESP_PWR_LVL_N9 ", // 5, -9dbm
44 | "ESP_PWR_LVL_N6 ", // 6, -6dbm
45 | "ESP_PWR_LVL_N3 ", // 7, -3dbm
46 | "ESP_PWR_LVL_N0 ", // 8, 0dbm
47 | "ESP_PWR_LVL_P3 ", // 9, +3dbm
48 | "ESP_PWR_LVL_P6 ", // 10, +6dbm
49 | "ESP_PWR_LVL_P9 ", // 11, +9dbm
50 | "ESP_PWR_LVL_P12", // 12, +12dbm
51 | "ESP_PWR_LVL_P15", // 13, +15dbm
52 | "ESP_PWR_LVL_P18", // 14, +18dbm
53 | "ESP_PWR_LVL_P21" // 15, +21dbm
54 | };
55 |
56 | String PWR_LEVEL_STR(esp_power_level_t level) {
57 | if ((level < ESP_PWR_LVL_N24) || (level > ESP_PWR_LVL_P21)) {
58 | return String("ESP_PWR_LVL_INVALID");
59 | } else {
60 | return String(ESP_PWR_LEVELS[level]);
61 | }
62 | }
63 |
64 | // leave undefined to use default BLE power level
65 | #define BLE_PWR_LEVEL ESP_PWR_LVL_N21
66 |
67 | BLEServer *pServer = nullptr;
68 | BLECharacteristic *pCharacteristic = nullptr;
69 |
70 | bool deviceConnected = false;
71 |
72 | class MyServerCallbacks: public BLEServerCallbacks {
73 | void onConnect(BLEServer* pServer) {
74 | deviceConnected = true;
75 | Serial.println("Device connected");
76 | };
77 |
78 | void onDisconnect(BLEServer* pServer) {
79 | deviceConnected = false;
80 | Serial.println("Device disconnected");
81 | Serial.println("Restart advertising");
82 | BLEDevice::startAdvertising();
83 | }
84 | };
85 |
86 | class WriteCallbacks : public BLECharacteristicCallbacks {
87 | void onWrite(BLECharacteristic *pCharacteristic) {
88 | String value = pCharacteristic->getValue().c_str();
89 | if (value == "on") {
90 | digitalWrite(ledPin, ledOn);
91 | Serial.println("Received \"on\" value");
92 | } else if(value == "off"){
93 | digitalWrite(ledPin, 1-ledOn);
94 | Serial.println("Received \"off\" value");
95 | } else {
96 | Serial.printf("Received non valid \"%s\" value \n", value.c_str());
97 | }
98 | }
99 | };
100 |
101 |
102 | void setup() {
103 | #if defined(ARDUINO_MAKERGO_C3_SUPERMINI)
104 | Serial.begin();
105 | delay(1000); // should be enough for the USB CDC to initialize
106 | #else
107 | Serial.begin(115200);
108 | while (!Serial) delay(10);
109 | #endif
110 |
111 | Serial.println("Setup");
112 |
113 | Serial.println("Initializing LED");
114 | pinMode(ledPin, OUTPUT);
115 | digitalWrite(ledPin, 1-ledOn);
116 |
117 | Serial.println("Initializing BLEDevice");
118 | BLEDevice::init(BLUETOOTH_NAME);
119 |
120 | // defined in
121 | esp_power_level_t esp_ble_tx_power = esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_DEFAULT);
122 | Serial.print("Default BLE power level ");
123 | Serial.println(PWR_LEVEL_STR(esp_ble_tx_power));
124 |
125 | #if defined(BLE_PWR_LEVEL)
126 | // https://github.com/nkolban/esp32-snippets/issues/197#issuecomment-344115566
127 | // http://esp-idf.readthedocs.io/en/latest/api-reference/bluetooth/controller_vhci.html?highlight=esp_ble_tx_power_set#_CPPv220esp_ble_tx_power_set20esp_ble_power_type_t17esp_power_level_t
128 |
129 | BLEDevice::setPower(BLE_PWR_LEVEL);
130 | delay(10);
131 | esp_ble_tx_power = esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_DEFAULT);
132 | Serial.print("BLE power level set to ");
133 | Serial.print(PWR_LEVEL_STR(esp_ble_tx_power));
134 | Serial.print(" wanted ");
135 | Serial.println(PWR_LEVEL_STR(BLE_PWR_LEVEL));
136 | #endif
137 |
138 | Serial.println("Creating a BLE server");
139 | pServer = BLEDevice::createServer();
140 | pServer->setCallbacks(new MyServerCallbacks());
141 |
142 | Serial.println("Adding a BLE service");
143 | BLEService *pService = pServer->createService(SERVICE_UUID);
144 |
145 | Serial.println("Adding a BLE characteristic");
146 | pCharacteristic = pService->createCharacteristic(
147 | CHARACTERISTIC_UUID,
148 | BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE);
149 | pCharacteristic->setCallbacks(new WriteCallbacks);
150 |
151 | Serial.println("Starting BLE service");
152 | pService->start();
153 |
154 | Serial.println("Add advertiser");
155 | BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
156 | pAdvertising->addServiceUUID(pService->getUUID());
157 | pAdvertising->setScanResponse(true);
158 |
159 | Serial.println("Start BLE advertising");
160 | BLEDevice::startAdvertising();
161 |
162 | Serial.print("\nSetup completed, connect to ");
163 | Serial.println(BLUETOOTH_NAME);
164 | Serial.print("Address: ");
165 | Serial.println(BLEDevice::getAddress().toString().c_str());
166 | }
167 |
168 | unsigned long timer = 0;
169 |
170 | void loop() {
171 | if (millis() - timer > 5000) {
172 | Serial.println(" - loop busy work");
173 | timer = millis();
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | Copyright (C) 2023, Michel Deslierres
2 |
3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
4 |
5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Super Mini ESP32C3 Arduino Sketches / PlatformIO Projects
2 |
3 | **Source code that accompanies [First Look at the Super Mini ESP32-C3](https://sigmdel.ca/michel/ha/esp8266/super_mini_esp32c3_en.html).**
4 |
5 | ---
6 |
7 | **Code source qui accompagne [Coup d'oeil sur la carte de développement Super Mini ESP32-C3](https://sigmdel.ca/michel/ha/esp8266/super_mini_esp32c3_en.html).**
8 |
9 | ---
10 |
11 | 
12 |
13 | ---
14 |
15 | **Table of Content**
16 |
17 |
18 |
19 | - [1. Introduction](#1-introduction)
20 | - [2. Arduino IDE Notes](#2-arduino-ide-notes)
21 | - [3. PlatformIO Notes](#3-platformio-notes)
22 | - [4. List of Projects](#4-list-of-projects)
23 |
24 | **Hello world! sketches:**
25 | - [01_pin_names](#01_pin_names)
26 | - [02_blink_pulse_led](#02_blink_pulse_led)
27 |
28 | **Wi-Fi connectivity sketches:**
29 | - [03_scan_wifi](#03_scan_wifi)
30 | - [04_wifi_connect](#04_wifi_connect)
31 | - [05_wifi_tx_power](#05_wifi_tx_power)
32 |
33 | **Bluetooth connectivity sketches**
34 | - [07_ble_led](#07_ble_led)
35 | - [08_ble_led2](#08_ble_led2)
36 |
37 | **Working example:**
38 | - [06_async_web_led](#06_async_web_led)
39 |
40 | [5. Licence](#5-licence)
41 |
42 |
43 |
44 | ## 1. Introduction
45 |
46 | The Super Mini ESP32C3 boards are small simplified versions of the original Espressif development boards for the ESP32-C3 microcontroller. Unlike older Espressif microcontrollers, the C3 has a RISC-V core.
47 |
48 | It seems that there is more than one manufacturer of these boards that differ in more or less subtle ways. The pin diagram above shows the markings on four boards purchased from a Chinese vendor in late April 2024. There are no labels identifying the red power LED to the left of the USB connector and the blue LED under the reset (RST) button. There are no other components near the single component between the ESP32-C3 chip and the red ceramic antenna labelled C3. Other boards and the [schematic](https://wiki.icbbuy.com/doku.php?id=developmentboard:esp32-c3mini#schematic) have other components which may explain the problems encountered with Wi-Fi connectivity.
49 |
50 | It should be possible to compile these projects in the Arduino IDE or in PlatformIO, although there are difficulties in a couple of cases if using the Arduino IDE.
51 |
52 | ## 2. Arduino IDE Notes
53 |
54 | Arduino sketches must have an `.ino` file name extension and must be contained in a directory that has the same name as the Arduino sketch (excluding the extension). Consequently the `01_pin_names` project contains a directory named `pin_names` that in turn contains the Arduino sketch `pin_names.ino`. That file is only a long comment. This is not a problem because the Arduino IDE will import all source files found in the sketch directory. The actual code is in `main.cpp` which is the default name of a PlatformIO project.
55 |
56 | 
57 |
58 | To compile and then upload the sketch in the Arduino IDE, click on the **File** top menu, click on **Open...**, then navigate to the `pin_names.ino` file and open it with the system file manager.
59 |
60 | Following the instructions in [Installing using Arduino IDE](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide) the latest release of the Arduino-ESP32 framework was installed by entering the following URL
61 | ```
62 | https://espressif.github.io/arduino-esp32/package_esp32_index.json
63 | ```
64 | into the `Additional Board Manager URLs` field of the Arduino Preferences. Using the board manager install the Espressif Arduino core `esp32 version 3.0.1` or newer. It should then be possible to select `MakerGO ESP32 C3 SuperMini` as the board.
65 |
66 | ## 3. PlatformIO Notes
67 |
68 | Because of the Arduino sketch naming constraints, the `main.cpp` file of a project is not stored in the default `src` directory. A `src_dir` entry in the `platformio.ini` configuration file provides the name of the directory in which `main.cpp` is found. That will be the name of the Arduino sketch as shown below for the `01_pin_names` project.
69 |
70 | ```ini
71 | [platformio]
72 | ; Make the Arduino IDE happysupermini_esp32c3_sketches (github)% (.INO file must be in a directory of the same name)
73 | src_dir = pin_names
74 | ```
75 |
76 | PlatformIO will "convert" the sketch `.ino` file, but that is of no consequence since it contains only comments.
77 |
78 | ## 4. List of Projects
79 |
80 | The projects can be grouped in three categories.
81 |
82 | **Hello world! sketches:**
83 | ---
84 |
85 | ### 01_pin_names
86 | Lists the I/O pin names and numbers of the Super Mini ESP32-C3 board.
87 |
88 | ### 02_blink_pulse_led
89 | Alternately blinks (heartbeat) and pulses the on-board LED of the Super Mini board.
90 |
91 | **Wi-Fi connectivity sketches:**
92 | ---
93 |
94 | ### 03_scan_wifi
95 | Prints a list of available Wi-Fi networks every five seconds. The Super Mini does not manage to find as many networks as the XIAO ESP32C3. Edit `secrets.h.template` and save as `secrets.h` before compiling.
96 |
97 | ### 04_wifi_connect
98 | Wi-Fi connection example. The Super Mini may very well fail to connect. Define the TRY_TX_POWER macro to see if that solves the problem. It may be necessary to change the value of the TX_POWER macro. Edit `secrets.h.template` and save as `secrets.h` before compiling.
99 |
100 | ### 05_wifi_tx_power
101 | Tests each predefined value for the Wi-Fi TX (transmit) power and records the time required to connect to the Wi-Fi network. Edit `secrets.h.template` and save as `secrets.h` before compiling.
102 |
103 | The table shows times needed to connect to a Wi-Fi network in milliseconds as a function of the radio TX power setting. The tests were run only once on a XIAO ESP32C3 and once on each of four different Super Mini boards. The `-` signifies that a connection was not made within two minutes.
104 |
105 | | | XIAO | SM 1 | SM 2 | SM 3 | SM 4 |
106 | | --- | :---: | :---:| :---: | :---:| :---:|
107 | | WIFI_POWER_default | 1143 | - | - | - | - |
108 | | WIFI_POWER_19_5dBm | 443 | - | 1230 | - | - |
109 | | WIFI_POWER_19dBm | 430 | 477 | - | - | - |
110 | | WIFI_POWER_18_5dBm | 440 | 546 | 961 | - | - |
111 | | WIFI_POWER_17dBm | 391 | 443 | 389 | 532 | - |
112 | | WIFI_POWER_15dBm | 404 | 410 | 425 | 422 | - |
113 | | WIFI_POWER_13dBm | 376 | 729 | 684 | 469 | 1440 |
114 | | WIFI_POWER_11dBm | 429 | 423 | 399 | 409 | 484 |
115 | | WIFI_POWER_8_5dBm | 729 | 1929 | 414 | 425 | 443 |
116 | | WIFI_POWER_7dBm | 1923 | 718 | 413 | 430 | 399 |
117 | | WIFI_POWER_5dBm | 904 | 388 | 427 | 546 | 442 |
118 | | WIFI_POWER_2dBm | 678 | 507 | 390 | 937 | 408 |
119 |
120 | Three conclusions can be drawn.
121 |
122 | 1. The XIAO connected with the Wi-Fi router no matter the TX power setting. That may not be all that significant since the router was 1 metre away.
123 |
124 | 2. Not one of the four Super Mini boards was able to connect to the Wi-Fi network with the default TX power setting.
125 |
126 | 3. There is significant variation between the Super Mini boards.
127 |
128 | 4. The Chinese vendor supplied ESP32-C3 Super Mini boards have a 3.3V regulator with a peak current rating of 250 mA (SMD LLVB). This is insufficient to power everything given that the [official datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf) (page 52). specifies Wi-Fi current consumption @18.5dbm as 276mA or greater.
129 |
130 | When deploying a board, it may be necessary to test it multiple times in the position it will be used to find the proper TX power setting.
131 |
132 | **Bluetooth connectivity sketches:**
133 | ---
134 |
135 | ### 07_ble_led
136 |
137 | A rudimentary example of the Bluetooth® Low Energy (BLE) capabilities of the ESP32-C3. The microcontroller is set up as a BLE peripheral with a LED service and as switch characteristic. Any central (client) device can turn the LED on or off by sending a proper message. [Bluetooth Controlled LED](https://sigmdel.ca/michel/ha/xiao/xiao_esp32c3_intro_en.html#ble) explains how to use **LightBlue**, an Android and presumably IOS application, to do that.
138 |
139 | The Super Mini C3 boards that were tested did not do well. Sometimes the connection between the microcontroller and the Android tablet would require a considerable amount of time. At other times, the tablet had to be almost touching the microcontroller for the connection to be made. It happened that a connection could not be established at all even if **LightBlue** had found the Super Mini when it scanned for devices. By contrast, the XIAO-ESP32C3 was dependable.
140 |
141 | This project is basically the same as **06_ble_led** in [xiao_esp32c3_sketches](https://github.com/sigmdel/xiao_esp32c3_sketches). Contrary what is stated in the documentation for that previous version, the project can be compiled in the Arduino IDE. It's definitely not properly set up for that. The `ble_led.ino` file has details on how to do it.
142 |
143 | ### 08_ble_led2
144 |
145 | This project is similar to the previous one except for the use of the BLE library instead of the ArduinoBLE library. The [BLE library](https://github.com/espressif/arduino-esp32/tree/master/libraries/BLE) included in the ESP32 core for Arduino was the creation of [Neil Kolban](https://github.com/nkolban/ESP32_BLE_Arduino). This makes it possible to set the BLE power level. Unlike setting Wi-Fi TX (transmit) power, setting the BLE power level did not result in obvious improvements in Bluetooth connectivity. Only BLE power type `ESP_BLE_PWR_TYPE_DEFAULT` with power levels -21dbm, -15dbm, -9dbm, -3dbm, +3dbm + 9dbm, +15dbm and +21dbm, were tested. BLE power settings are more complex than Wi-Fi transmit power settings, so there may be something to gain in investigating this further.
146 |
147 | Perhaps this test was done incorrectly. Any help on this subject would be appreciated.
148 |
149 |
150 | **Working example:**
151 | ---
152 |
153 | ### 0.6_async_web_led
154 |
155 | Toggles the built-in LED on and off with a Web interface. It may be necessary to specify a valid Wi-Fi tx power as determined with the previous sketch. Edit `secrets.h.template` and save as `secrets.h` before compiling.
156 |
157 | Aside from setting the radio TX power and handling the fact that the built-in LED is active LOW, this project is the same as **05_async_web_led** in [xiao_esp32c3_sketches](https://github.com/sigmdel/xiao_esp32c3_sketches).
158 |
159 | This project cannot easily be compiled in the Arduino IDE:
160 |
161 | > The project uses the `esphome/ESPAsyncWebServer-esphome@^3.2.0` library which in turns depends on the `AsyncTCP` library. The latter depends on `IPv6Address.h` which is no longer included in the esp32 v3.0.1 core used in Arduino. So the `esphome` libraries cannot be copied to a private library directory for use in Arduino unless esp32 v2.0.17 were used (see [ptillisch](https://forum.arduino.cc/t/ide-2-3-2-ip46address-h-error/1272197/4)). If the older esp32 core were used, the `MakerGO ESP32 C3 SuperMini board` would not be defined. If we use v3.0.1, it seems that the `ESPAsyncWebServer` library loaded by the Arduino library manager which presumably does not require `IPv6Address.h` does not seem to support the ESP32-C3.
162 |
163 | ## 5. Licence
164 |
165 | Copyright 2024, Michel Deslierres. No rights reserved.
166 |
167 | While the copyright pertaining to included libraries must be respected, all the code by Michel Deslierres in this repository is in the public domain. In those jurisdictions where this may be a problem, the [BSD Zero Clause License](https://spdx.org/licenses/0BSD.html) applies.
168 |
--------------------------------------------------------------------------------
/images/dir_tree.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmdel/supermini_esp32c3_sketches/ff45329251c85df2658aa8f8df2a4aa70507ba01/images/dir_tree.jpg
--------------------------------------------------------------------------------
/images/pinout_top_big_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmdel/supermini_esp32c3_sketches/ff45329251c85df2658aa8f8df2a4aa70507ba01/images/pinout_top_big_logo.png
--------------------------------------------------------------------------------
/resources/README.md:
--------------------------------------------------------------------------------
1 | # Adding a Super Mini Board Definition in PlatformIO
2 |
3 | Two files need to be added to define the Super Mini ESP32-C3 development board described in [First Look at the Super Mini ESP32-C3](https://sigmdel.ca/michel/ha/esp8266/super_mini_esp32c3_en.html). They are contained in this directory.
4 |
5 | 1. `super_mini_esp32c3.json` is the board definition file. It references the next file.
6 |
7 | 2. `pins_arduino.h` is the variant pin definition file.
8 |
9 | They should be copied to the correct subdirectory of the `platformio` directory. The location of the latter depends on the operating system and where PlatformIO was initially installed. The *default* locations are as follows.
10 |
11 | Linux:
12 | 1. `~/.platformio/platforms/espressif32/boards/super_mini_esp32c3.json`
13 |
14 | 2. `~/.platformio/packages/framework-arduinoespressif32/variants/super_mini_esp32c3/pins_arduino.h`
15 |
16 | In practice this means: `home//.platformio/...`.
17 |
18 | Windows:
19 |
20 | 1. `%HOMEPATH%\.platformio\platforms\espressif32\boards\super_mini_esp32c3.json`
21 |
22 | 2. `%HOMEPATH%\.platformio\packages/framework-arduinoespressif32/variants/super_mini_esp32c3/pins_arduino.h`
23 |
24 | In practice this means: `C:\Users\\.platformio\...`.
25 |
26 |
27 | Note that in the second case, the `super_mini_esp32c3` directory in which `pins_arduino.h` is saved will have to be created.
28 |
29 | **NOTE:**
30 |
31 | The above will work, in the sense that the new board will show up in the Project Wizard. However, the two additional files will be deleted when the `espressif32` platform is updated or reinstalled.
32 |
33 | There is a simple way to add a locally defined custom board definition to a project. See [Custom Embedded Boards](https://docs.platformio.org/en/latest/platforms/creating_board.html#installation) and [boards_dir](https://docs.platformio.org/en/latest/projectconf/sections/platformio/options/directory/boards_dir.html#projectconf-pio-boards-dir). However adding the variant `pins_arduino.h` file is not that easy. See [Custom board missing file: pins_arduino.h: No such file or directory](https://community.platformio.org/t/custom-board-missing-file-pins-arduino-h-no-such-file-or-directory/36622).
34 |
35 | Hopefully, a future release of the `espressif32` platform will include a correct Super Mini dev board definition and the problem will become moot.
36 |
--------------------------------------------------------------------------------
/resources/pins_arduino.h:
--------------------------------------------------------------------------------
1 | #ifndef Pins_Arduino_h
2 | #define Pins_Arduino_h
3 |
4 | #include
5 |
6 | static const uint8_t LED_BUILTIN = 8;
7 | #define BUILTIN_LED LED_BUILTIN // backward compatibility
8 | #define LED_BUILTIN LED_BUILTIN
9 |
10 | static const uint8_t BOOT_BUILTIN = 9; // boot button
11 | #define BOOT_BUILTIN BOOT_BUILTIN
12 |
13 | #define TX1 0
14 | #define RX1 1
15 |
16 | static const uint8_t TX = 21;
17 | static const uint8_t RX = 20;
18 |
19 | static const uint8_t SDA = 8;
20 | static const uint8_t SCL = 9;
21 |
22 | static const uint8_t SS = 7;
23 | static const uint8_t MOSI = 6;
24 | static const uint8_t MISO = 5;
25 | static const uint8_t SCK = 4;
26 |
27 | static const uint8_t A0 = 0;
28 | static const uint8_t A1 = 1;
29 | static const uint8_t A2 = 2;
30 | static const uint8_t A3 = 3;
31 | static const uint8_t A4 = 4;
32 | static const uint8_t A5 = 5;
33 |
34 | #endif /* Pins_Arduino_h */
35 |
--------------------------------------------------------------------------------
/resources/super_mini_esp32c3.json:
--------------------------------------------------------------------------------
1 | {
2 | "build": {
3 | "arduino": {
4 | "ldscript": "esp32c3_out.ld"
5 | },
6 | "core": "esp32",
7 | "extra_flags": [
8 | "-DARDUINO_SUPER_MINI_ESP32C3",
9 | "-DARDUINO_USB_MODE=1",
10 | "-DARDUINO_USB_CDC_ON_BOOT=1"
11 | ],
12 | "f_cpu": "160000000L",
13 | "f_flash": "80000000L",
14 | "flash_mode": "qio",
15 | "hwids": [
16 | [
17 | "0x303a",
18 | "0x1001"
19 | ]
20 | ],
21 | "mcu": "esp32c3",
22 | "variant": "super_mini_esp32c3"
23 | },
24 | "connectivity": [
25 | "wifi"
26 | ],
27 | "debug": {
28 | "openocd_target": "esp32c3.cfg"
29 | },
30 | "frameworks": [
31 | "arduino",
32 | "espidf"
33 | ],
34 | "name": "ESP32C3-SuperMini",
35 | "upload": {
36 | "flash_size": "4MB",
37 | "maximum_ram_size": 327680,
38 | "maximum_size": 4194304,
39 | "require_upload_port": true,
40 | "speed": 460800
41 | },
42 | "url": "https://wiki.icbbuy.com/doku.php?id=developmentboard:esp32-c3mini#esp32-c3mini",
43 | "vendor": "ICBbuy"
44 | }
45 |
--------------------------------------------------------------------------------