ESP8266 WIFI on pixhawk

Some updates.

Updating to the most recent MAVESP8266 firmware has solved the vast majority of the lost packets on the downlink - I’m at 1.2% packet loss.

Looking at it, it makes sense; prior to this change a lot of the packets the vehicle sent would not have been recognized - ArduPilot support is actually a late-comer to the ESP8266 firmware. This is a drawback in having the ESP8266 interpreting the mavlink messages. Is anybody running the ESP8266s without having it decode the mavlink messages?

Still have problems sending commands to the vehicle. Typically I need to issue “mode manual” three or more times before the mode change happens.

@StefanG Can I assume you’re not having issues getting commands to your vehicle? Do you have a specific git hash I can compile, or failing that just a version number?

Why not just use esp-link? https://github.com/jeelabs/esp-link I’ve been using it for the last year to relay ground feed to a tcp/ip port so that my devices can connect to my plane 10km away without needing line of sight.

Why not just use esp-link? GitHub - jeelabs/esp-link: esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer I’ve been
using it for the last year to relay ground feed to a tcp/ip port so that my
devices can connect to my plane 10km away without needing line of sight.

How do you need the data from the WiFi side of things back into the GCS?
With the mavesp firwmare it packetises them all up as mavlink packets and
sends them as UDP messages to the GCS.

I assume that this esp-link firwmare will just give you a byte stream; do
you just throw the bytestream at a TCP port the GCS is listening on?

Also - 10km WiFi is awesome range! Have you written an article on how you
accomplish that? If not, having one up on ardupilot.org would be good
:slight_smile:

Thanks,

Peter

@peterbarker:
As I mentioned, I’m (currently) not using ESPs with Pixhawk but was talking from my general experience with the ESPs from many other projects. But your test did confirm my suspicion that the MAVESP fw had something to do with it.
As I mentioned, I use the ESPs a lot, among other things, for realtime data transmission, like remote controlling an RGB LED matrix, streaming timecode to a camera(!) and such… Never had any problems with packet loss, even on longer distances like a couple of 100 meters. I also have an ESP with environmental sensors in the garden which is streaming sensor data to my main server - also no problems (building walls are massive concrete).
I’d go with @Hein_Du_Plessis suggestion and try ESP-link, even if it’s just to have a comparison. ESP-link looks like it’s just a truly transparent data link, so no meddling with the packets.

Hi Peter, I’m using regular SIK radios from the plane to the ground, but on the ground I simply forwarding the UART via esplink to a tcp/ip port. Then, I can place my ground radio on an elevated position (on the car’s roof, on a pole or mast) and I can sit inside the car and connect to the feed via wifi.

So it’s radio:plane > radio:ground > wifi > mission planner / tower. The wifi range is around 900m depending on the type of unit. So my 10km is still on the radio link.

Hope that makes sense?

1 Like

Wanted to add my 5 cents:

  1. Usually when dealing with ESP8266 <-> Phone / Tablet / Laptop connection the limiting factor will be the phone / tablet / laptop (assuming esp wifi power is bumped all the way up as is in https://pixhawk.org/peripherals/8266 ). The range here is expected at up to around 100 meters.

  2. The fun starts when one is using two esp8266 to communicate with each other, typical setup will be:
    FC <-> ESP for the air part and ground part: ESP1 <-> ESP2 <-> Phone / Tablet / Laptop.
    ESP1 and 2 can run same firmware with RX / TX crossed (i.e. TX from 1 to RX of 2 and vise versa). Alternatively ESP2 can be swapped for BT module HC-05 / HC-06 in same manner. If using two ESP’s it’s advised to run on distinct channels. Range here if using ESP with external antenna is expected at around 500 - 750 meters.

  3. I also use soemthing simillar to more or less that Peter have, 2 SIK radios (433Mhz)
    Air <-> SIK and ground setup: SIK <-> RPI3 (RaspberryPi 3 built in wifi set up as soft AP) <-> Phone / Tablet.
    Run from portable phone power bank or car charger, benefit of additional logging via RPI and more or less nicely packed setup (the rpi is in a case).

  4. Firmware wise, I’ve tested for the ESP8266 3 firmwares:
    a. jeelabs/esp-link https://github.com/jeelabs/esp-link - HTTP, nice GUI. setting in AP mode isn’t straightforward.
    b. festlv/mavbridge https://github.com/festlv/mavbridge - UDP, very nice and polished, GUI is good.
    c. dogmaphobic/mavesp8266 https://github.com/dogmaphobic/mavesp8266 - UDP, poor GUI.

I’ve played mostly with (a) and © and prefer © mainly as it’s support UDP, lean & easy to flash, code is easy and traceable. jeelabs esp link is great firmware but it’s HTTP transport doesn’t give benefits to the least in our case.
Another thing all firmware are missing with respect to our use case is lowering the PHY Layer speed link to the lowest possible as this provides higher sensitivity for all wifi receivers out there. (https://www.espressif.com/sites/default/files/documentation/0b-esp8266_system_description_en.pdf - page 5).

Good luck, Eddi

1 Like

Dear Hein Du Plessis,
Could you please give me the link with step by step with this one.
Sorry my english.
Reed Noel

I found the instructions on https://github.com/jeelabs/esp-link to be good enough to get going, but you’re welcome to ask me any specific questions if you’re stuck.

Hi @Hein_Du_Plessis,
I connect esp to laptop and running with Qgroundcontrol ok.
So I have a question ?
I have action wifi cam. How to connect with esp8266 and sent signal to laptop.
If some body know, please give me instructor?
Rgs
Reed Noel

Hi @Hein_Du_Plessis,
Could you please give me detail of your esp8266? near to 1km, very nice.
Rgs
Reed Noel

Dear @Eddi_Maevski,
Did you have a video and somethings like that for instructor of your solution?
I reeding your comment but can understand.
And, please show me, If haven’t RPI3, I can using instead with arduino and other ?
Rgs
Reed Noel

I’m using ESP8266 radios on 2 PixRacers with the dogmaphobic firmware with the Nodemcu flasher App. They work pretty well out to 300m max.

1 Like

some one make esp8266 with distance near 1km, so I don’t understand

Maybe with a router and a directional antenna you could come close to that. And/or a better antenna than the typical PCB one one on the module. The module mRobotics sells has an antenna connector.

1 Like

I connect my quad (px4) to esp via UDP, so I want addition camera wifi to quadcopter, and transfer signal to QGS,
Some body know, How to do that.

I have used an ESP module to read PWM from Pixhawk and control a gopro, the same module reads mavlink and controls LEDs in a converted Phantom 2.

I’ve been doing some updates to the mavesp8266 firmware to add MAVLink2 support, and improve the web UI for setup
I’ve released some updated binaries here:
http://uav.tridgell.net/mavesp8266/
for the modules that come with the pixracer the esp01_1m version works nicely.
Main new features are:

  • mavlink2 support
  • also handles mavlink1
  • handles new mavlink messages without building new firmware
  • much expanded web UI for setting up SSID, password etc
  • fixes firmware update of ESP8266 over WiFi

PR against upstream is here:

testers welcome!

Gus merged your PR, so mavlink2 and the HTML interface is in mavesp8266 master now.

I’ve created a draft page for the ESP8266 wifi telemetry module on the wiki. It’s based around the adafruit module because it apparently doesn’t require a regulator or level shifter.

I’d like to get some details on that page for how people can flash the MAVESP8266 firmware onto the module so if anyone has any advice…

I use the NodeMCU Flasher for the ESP8266 radios supplied with PixRacers or available cheaply elsewhere.