Skip to content

Configuration

neoxic edited this page Nov 11, 2024 · 11 revisions

This page corresponds to the latest firmware revision. Previous versions can be found here.

ESCape32 Wi-Fi Link

The most convenient and hassle-free way to configure the firmware is to use an ESCape32 Wi-Fi Link board. Ubiquitous and cheap C3 Super Mini and S2 Mini boards are available on AliExpress and Amazon. Please see the Wi-Fi Link page for more information.

DSHOT programming

Command Description
1-5 Play beacon tone 1-5
7 Set normal motor direction
8 Set reversed motor direction
9 3D mode off (unidirectional mode)
10 3D mode on (bidirectional mode)
12 Save settings
20 Turtle mode off
21 Turtle mode on
22-25 LED 1-4 on
26-29 LED 1-4 off
40 Select motor timing
41 Select PWM frequency
42 Select maximum duty cycle ramp
43 Select duty cycle slew rate
47 Reset settings to defaults

Commands 40-47 are non-standard hence they must be repeated at least 6 times in a row in Betaflight CLI. They beep the new value back (see beep). For example:

dshotprog 255 40 40 40 40 40 40  # Select the next timing value
dshotprog 255 12  # Save settings

Command 40 (select motor timing) selects the next value that corresponds to the following settings:

# Value
1 15˚
2 16.875˚
3 18.75˚
4 20.625˚
5 22.5˚
6 24.375˚
7 26.25˚
8 28.125˚

Command 41 (select PWM frequency) selects the next value that corresponds to the following settings:

# Min/Max
1 24/48 kHz
2 28/56 kHz
3 32/64 kHz
4 36/72 kHz
5 40/80 kHz
6 44/88 kHz
7 48/96 kHz

Command 42 (select maximum duty cycle ramp) selects the next value from [0..10] range that sets duty_ramp in tens of kERPM. For example, the value of 5 (five beeps) translates to set duty_ramp 50.

Commands 43 (select duty cycle slew rate) selects the next value from [1..10] range that sets duty_rate in %/ms. For example, the value of 5 (five beeps) translates to set duty_rate 50.

CLI (command line interface)

The firmware features a UNIX-style console (no echo, LF as EOL) on the signal line at 38400 baud 8N1 using a USB-TTL adapter. Although not strictly required (see below), the following simple circuit is needed to convert two RX/TX pins on the USB-TTL adapter into one-wire two-way connection with the ESC:

In case of one-way connection when the ESC is connected to the TX and GND pins or via Betaflight, type beep to enable audio feedback mode. You should hear a beep in return.

For connection via Betaflight, use KISS ESC passthrough mode:

  1. Open Betaflight Configurator.

  2. Go to Motors, set ESC/Motor protocol to DISABLED, and click Save and Reboot.

  3. Make sure ESCSERIAL resource is assigned to an inactive pin with a timer.

  4. Go to CLI and type one of the following to enter passthrough mode:

     escprog ki 0  # Connect to ESC 1
     escprog ki 1  # Connect to ESC 2
     escprog ki 2  # Connect to ESC 3
     escprog ki 3  # Connect to ESC 4
    
  5. Close Betaflight Configurator. (IMPORTANT!!!)

  6. Use Betaflight's serial device (COM port) for one-way connection.

Connecting via ESCape32 CLI Utility

Download the latest release here and run:

escape32-cli -d /dev/mySerialDevice

On Windows, COM port must be specified as /dev/ttySx, i.e. COM1 → /dev/ttyS0, COM2 → /dev/ttyS1, etc.

On UNIX, the list of serial devices can be retrieved by running:

ls /dev/tty*  # Linux
ls /dev/cu.*  # macOS
ls /dev/cua*  # BSD

Connecting via socat

Examples depending on socat's flavour:

socat - /dev/ttyUSB0,rawer,b38400
socat - /dev/cu.usbserial-0001,rawer,ispeed=38400,ospeed=38400

Connecting via PuTTY on Windows

Since standard PuTTY uses CR as EOL for serial connections, download modified PuTTY.

Open a serial connection, turn on echo, and enable CR/LF:

Commands

help

Print basic usage help.

info

Print ESC information.

show

Print settings.

get <param>

Print (and beep if audio feedback mode is enabled) the value of <param>.

set <param> <value>

Set <param> to <value> and print (and beep if audio feedback mode is enabled) the resulting (possibly trimmed) value.

save

Save settings. For example, the following commands reverse motor direction and save the changes:

set revdir 1
save

reset

Reset settings to defaults.

play <music> [<volume>]

Play <music> with optional <volume>. Examples:

play cdefg_g_a2Cag_g
play a2D_D3EF#2D_D3C#b2E_E3DC#2a_a3

throt <value>

Set the current throttle position as value between -2000 (full reverse) and 2000 (full forward). This command is intended for real time testing. Use caution because this command actually starts the motor. If arming is enabled (the default), type throt 0 to arm the ESC. It is possible to change settings on the fly while the motor is running.

beep

Enable audio feedback mode (communicate values using the number of beeps). This command also beeps the last value. In the following example, the last two commands beep the current timing value:

beep
get timing
beep