parent
e3b51aeb09
commit
93ea08309b
|
|
@ -84,11 +84,14 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
||||||
arduino-cli core install esp32:esp32
|
arduino-cli core install esp32:esp32
|
||||||
arduino-cli lib install "ArduinoJson"
|
|
||||||
|
|
||||||
mkdir -p ~/Arduino/libraries
|
mkdir -p ~/Arduino/libraries
|
||||||
|
|
||||||
# Cached repository check
|
# Cached repository check
|
||||||
|
if [ ! -d ~/Arduino/libraries/ArduinoJson ]; then
|
||||||
|
git clone --depth=1 https://github.com/bblanchon/ArduinoJson.git ~/Arduino/libraries/Json
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d ~/Arduino/libraries/ESPAsyncWebServer ]; then
|
if [ ! -d ~/Arduino/libraries/ESPAsyncWebServer ]; then
|
||||||
git clone --depth=1 https://github.com/ESP32Async/ESPAsyncWebServer ~/Arduino/libraries/ESPAsyncWebServer
|
git clone --depth=1 https://github.com/ESP32Async/ESPAsyncWebServer ~/Arduino/libraries/ESPAsyncWebServer
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
57
README.md
57
README.md
|
|
@ -1,9 +1,9 @@
|
||||||
[](https://github.com/derdoktor667/DShotRMT/actions/workflows/ci.yml)
|
[](https://github.com/derdoktor667/DShotRMT/actions/workflows/ci.yml)
|
||||||
|
|
||||||
# DShotRMT - ESP32 Library (Rewrite for ESP-IDF 5)
|
# DShotRMT - ESP32 Library (Rewrite for ESP-IDF 5)
|
||||||
|
|
||||||
A modern, robust C++ library for generating DShot signals on the ESP32 using the new ESP-IDF 5 RMT encoder API (`rmt_tx.h` / `rmt_rx.h`).
|
A simple Arduino IDE / C++ library for generating DShot signals on the ESP32 (`fqbn: esp32:esp32:esp32`) using the ESP-IDF 5 RMT encoder API (`rmt_tx.h` / `rmt_rx.h`).
|
||||||
Supports all standard DShot modes (150, 300, 600, 1200) and features continuous frame transmission with configurable timing.
|
Supports all standard DShot modes (150, 300, 600, 1200) and features signal generation and frame transmission with configurable timing.
|
||||||
|
|
||||||
**Now with BiDirectional DShot support, advanced command management, and modern web control interface!**
|
**Now with BiDirectional DShot support, advanced command management, and modern web control interface!**
|
||||||
|
|
||||||
|
|
@ -43,6 +43,9 @@ Add to your `platformio.ini`:
|
||||||
```ini
|
```ini
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/derdoktor667/DShotRMT.git
|
https://github.com/derdoktor667/DShotRMT.git
|
||||||
|
https://github.com/bblanchon/ArduinoJson
|
||||||
|
https://github.com/ESP32Async/ESPAsyncWebServer
|
||||||
|
https://github.com/ESP32Async/AsyncTCP
|
||||||
```
|
```
|
||||||
|
|
||||||
### Manual Installation
|
### Manual Installation
|
||||||
|
|
@ -52,12 +55,10 @@ git clone https://github.com/derdoktor667/DShotRMT.git
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
The library requires these additional libraries for full functionality:
|
There are no dependencies for the main library. The extended
|
||||||
|
example sketches are using these libraries:
|
||||||
|
|
||||||
**Core DShotRMT (always required):**
|
**Web Interface Examples (web_control.ino / web_client.ino):**
|
||||||
- ESP32 Arduino Core
|
|
||||||
|
|
||||||
**Web Interface Example (web_control.ino / web_client.ino):**
|
|
||||||
```ini
|
```ini
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/derdoktor667/DShotRMT
|
https://github.com/derdoktor667/DShotRMT
|
||||||
|
|
@ -66,9 +67,6 @@ lib_deps =
|
||||||
https://github.com/ESP32Async/AsyncTCP
|
https://github.com/ESP32Async/AsyncTCP
|
||||||
```
|
```
|
||||||
|
|
||||||
**Command Manager Example:**
|
|
||||||
- No additional dependencies required
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ⚡ Quick Start
|
## ⚡ Quick Start
|
||||||
|
|
@ -76,30 +74,7 @@ lib_deps =
|
||||||
### Basic Usage (DShotRMT)
|
### Basic Usage (DShotRMT)
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <DShotRMT.h>
|
// Generate "dshot300" example sketch with Arduino IDE / CLI.
|
||||||
|
|
||||||
// Create motor instance (GPIO 17, DSHOT300, non-bidirectional)
|
|
||||||
DShotRMT motor(17, DSHOT300, false);
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
Serial.begin(115200);
|
|
||||||
|
|
||||||
// Initialize the motor
|
|
||||||
dshot_result_t result = motor.begin();
|
|
||||||
if (result.success) {
|
|
||||||
Serial.println("Motor initialized successfully");
|
|
||||||
} else {
|
|
||||||
Serial.printf("Motor init failed: %s\n", result.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Send throttle value (48-2047)
|
|
||||||
dshot_result_t result = motor.sendThrottle(1000);
|
|
||||||
if (!result.success) {
|
|
||||||
Serial.printf("Throttle command failed: %s\n", result.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -120,6 +95,11 @@ The DShotRMT library now includes a modern web interface for wireless motor cont
|
||||||
2. Password: **12345678**
|
2. Password: **12345678**
|
||||||
3. Open browser and navigate to: **http://10.10.10.1**
|
3. Open browser and navigate to: **http://10.10.10.1**
|
||||||
|
|
||||||
|
### Web Client Mode
|
||||||
|
1. Setup SSID and Password in web_client.ino
|
||||||
|
2. Open serial for IP
|
||||||
|
3. Open browser, http://IP
|
||||||
|
|
||||||
### Safety Features
|
### Safety Features
|
||||||
- Motor control is **disabled by default** (disarmed state)
|
- Motor control is **disabled by default** (disarmed state)
|
||||||
- Toggle the **ARMING SWITCH** to enable motor control
|
- Toggle the **ARMING SWITCH** to enable motor control
|
||||||
|
|
@ -185,7 +165,7 @@ Advanced Commands:
|
||||||
| DSHOT | Bitrate | TH1 | TH0 | Bit Time (µs) | Frame Time (µs) |
|
| DSHOT | Bitrate | TH1 | TH0 | Bit Time (µs) | Frame Time (µs) |
|
||||||
|-------|-------------|-------|--------|---------------|-----------------|
|
|-------|-------------|-------|--------|---------------|-----------------|
|
||||||
| 150 | 150 kbit/s | 5.00 | 2.50 | 6.67 | ~106.72 |
|
| 150 | 150 kbit/s | 5.00 | 2.50 | 6.67 | ~106.72 |
|
||||||
| 300 | 300 kbit/s | 2.50 | 1.25 | 3.33 | ~53.28 |
|
| **300** | **300 kbit/s** | **2.50** | **1.25** | **3.33** | **~53.28** |
|
||||||
| 600 | 600 kbit/s | 1.25 | 0.625 | 1.67 | ~26.72 |
|
| 600 | 600 kbit/s | 1.25 | 0.625 | 1.67 | ~26.72 |
|
||||||
|
|
||||||
For DShot, T1H length is always double T0H length.
|
For DShot, T1H length is always double T0H length.
|
||||||
|
|
@ -200,12 +180,15 @@ DShotRMT motor(GPIO_NUM_17, DSHOT300);
|
||||||
|
|
||||||
// With bidirectional support
|
// With bidirectional support
|
||||||
DShotRMT motor(17, DSHOT300, true);
|
DShotRMT motor(17, DSHOT300, true);
|
||||||
|
|
||||||
|
// Also possible, defaults (17, DSHOT300, false)
|
||||||
|
DShotRMT motor();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🎯 DShot Commands
|
## 🎯 DShot Commands (experimental)
|
||||||
|
|
||||||
| Command | Value | Description | Usage |
|
| Command | Value | Description | Usage |
|
||||||
|---------|-------|-------------|-------|
|
|---------|-------|-------------|-------|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ static constexpr auto &USB_SERIAL = Serial0;
|
||||||
static constexpr auto USB_SERIAL_BAUD = 115200;
|
static constexpr auto USB_SERIAL_BAUD = 115200;
|
||||||
|
|
||||||
// Motor configuration - Pin number or GPIO_PIN
|
// Motor configuration - Pin number or GPIO_PIN
|
||||||
// static constexpr gpio_num_t MOTOR01_PIN = GPIO_NUM_17;
|
static constexpr gpio_num_t MOTOR01_PIN = GPIO_NUM_17;
|
||||||
static constexpr auto MOTOR01_PIN = 17;
|
// static constexpr auto MOTOR01_PIN = 17;
|
||||||
|
|
||||||
// Supported: DSHOT150, DSHOT300, DSHOT600, (DSHOT1200)
|
// Supported: DSHOT150, DSHOT300, DSHOT600, (DSHOT1200)
|
||||||
static constexpr dshot_mode_t DSHOT_MODE = DSHOT300;
|
static constexpr dshot_mode_t DSHOT_MODE = DSHOT300;
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,4 @@ paragraph=This library can control a BlHeli_S by using encoded DShot commands. F
|
||||||
category=Signal Input/Output
|
category=Signal Input/Output
|
||||||
url=https://github.com/derdoktor667/DShotRMT
|
url=https://github.com/derdoktor667/DShotRMT
|
||||||
architectures=esp32
|
architectures=esp32
|
||||||
provides_includes=DShotRMT.h, DShotCommandManager.h, dshot_commands.h
|
provides_includes=DShotRMT.h, DShotCommandManager.h, dshot_commands.h, web_content.h
|
||||||
depends=ArduinoJson
|
|
||||||
Loading…
Reference in New Issue