Use an ESP8266 module as a receiver for your drone!
This firmware has two main features: UDP-to-PPM for remote control, and a serial bridge for telemetry.
WARNING: This is not very good code and was just a fun exercise. This firmware will certainly have fatal bugs in it! I can't guarantee the safety of you and whatever you use this on. Be careful!
- Add
wifi_config.h
to the main project directory with your WiFi details:
#define SSID "your_network_ssid"
#define PASSWD "your_network_password"
- Check out
src/fw_config.h
for some configuration options. - PPM timing details are in
src/ppm.c
You probably don't need to change them, but they're there.
- Build esp-open-sdk at commit
e8d757b
withSTANDALONE=y
(which is the default). - Go into the
esp8266-ppm-rx
directory andmake
.
- Edit
ESPTOOL_PORT
and optionally the otherESPTOOL_*
variables in the Makefile as required. If you're using esptool v1.x (as is bundled with esp-open-sdk at that commit), comment or remove the lineESPTOOL_FLAGS ?= --before no_reset --after soft_reset
. - Make sure your ESP8266 module is connected via serial and is in flash mode, then
make flash
.
By default, the firmware listens on UDP port 5620 for PPM channel data. Each channel's value is represented by two bytes (16 bits) big endian, so a PPM update is a single packet of N_CHANNELS * 2
bytes, with channel one's value being the first two bytes, channel two the next two bytes, and so on.
By default, PPM is output on GPIO2/TX1. This is adjustable in src/ppm.c
(find PPM_GPIO
).
For safety, there is a failsafe. If there hasn't been a UDP channel update message in 500 milliseconds, the firmware stops transmitting PPM, indicating a loss of signal (timeout is configurable, see FAILSAFE_TIMEOUT_US
in src/fw_config.h
).
By default, the firmware listens on TCP port 5621. The connection is just a completely transparent serial bridge at 115200 baud. I use this for remote telemetry.
Released into the public domain via CC0 (see COPYING
for the license text) EXCEPT for:
- Files in
src/driver
, these are from the Espressif NONOS SDK (although slightly modified). blank.bin
andesp_init_data_default.bin
, also from the Espressif NONOS SDK.
Check the licenses for these files before using them. The source files mostly have their license at the top.