Slim mavlink bridge exposing mavlink based serial interface to UDP world. This repository aims to provide a minimal code base for defining a bridge between serial and UDP interfaces. It tries to provide an alternative for the feature rich prominent prevalent solutions. Extensions and improvements are welcome in any form without adding features exceeding the forwarding application.
Features:
- Establish connection to compile time defined hotspot
- Forward UDP to UART interface
- Forward UART to UDP interface
Flash to the microcontroller by using the following commands under the directory ./firmware
platformio run -e esp01_1m -t upload
Note: Specific port platformio run -e esp01_1m -t upload --upload-port /dev/ttyUSB0
and platformio run -e esp01_1m -t clean
.
Use mavros
with the connection url
roslaunch mavros px4.launch fcu_url:=udp://:[email protected]:UDP_CLIENT_PORT
Note: You can find the parameters under firmware/include/config.h
.
Adjust the following code segment excerpt in main.cpp
under firmware/src
to your liking.
// Main.cpp line 14f
IPAddress IP(192, 168, 3, 14);
IPAddress GATEWAY(192, 168, 3, 1);
IPAddress SUBNET(255, 255, 255, 0);
IPAddress DNS(1, 1, 1, 1);
WiFi.config(IP, GATEWAY, SUBNET, DNS, 0U);
WiFi.begin("yourssid", "yourpassword");
Note: Additionally you can adjust the bridge UART
and UDP
configuration constants under config.h
.
Multi-Vehicle Setup:
In order to connect to multiple vehicles from the same workstation, each ESP needs to be configured with a separate UDP_HOST_PORT
.
Note: that the vehicle's slimbridge is written with the perspective of the HOST
being a external workstation and the vehicle being the CLIENT
.
This means that the UDP_CLIENT_PORT
can be the same, as long as each vehicle has its unique IP in the network.
For details about the hardware setup see the wiring guide.
- Initialise the repository with
git submodule update --init --recursive
- Install platformio with
pip install platformio
- (optional) install visual studio code extension here (in VSC under extensions
PlatformIO IDE
) - (optional) install
esptool
to flash binariescd resources/esptool && python setup.py install
Any contribution is welcome. If you find missing instructions or something did not work as expected please create an issue and let me know.
See the LICENSE
file for details of the available open source licensing.