ESP8266 WIFI on pixhawk

im still surprised that there is no dev to adapt the pixracer wifi module for the pixhawk .

did any body found other way to make this connection to work by using other firmware on the esp?
thanks

Probably because Wifi has a relatively short range and also, from what I heard, these ESP8266 modules that go with Pixracer have high packet loss.

But there shouldn’t be anything preventing you from using it with a Pixhawk, it’s just a serial connection between the FC and the Wifi module.

I’m using ESPs for quite a while now for all kinds of tinkering and I find their range pretty good and the connection quite reliable. The range is easily 300m outside and some people have tested quite a bit more successfully.
The thing I would be most worried about would be interference with a 2.4GHz RC system when the ESP literally sits on top of the flight controller. But as replacement of a USB cable for downloading logs I would love to have 54MBit instead of 115Kbit ;).
Or if the RC system is something other than 2.4GHz, say, UHF LRS or so…

I’m using ESPs for quite a while now for all kinds of tinkering and I find
their range pretty good and the connection quite reliable. The range is
easily 300m outside and some people have tested quite a bit more
successfully.

Ah, excellent! A success story!

I have a couple of PixRacers here with ESP8266s sitting on top. I get
horrendous packet loss - virtually 100% up to the ESP8266.

What’s your secret?

Do you know which firmware you’ve go flashed on the ESP8266?
What baudrate are you using to the PixRaxer?
What autopilot do you have the ESP8266 connected to?

Ta,

Peter

Maybe there’s a misunderstanding. With “all kinds of tinkering” I meant non-autopilot stuff. I do quite a bit of IoT projects, like WIFI-controlled lamps, sensors and such. ESPs have replaced Arduinos in almost all of my projects.
Not having had a look at the MAVLink firmware for the ESP and looking at the Pixracer physical configuration, my first suspect for bad connections would be RFI or simply a blocked antenna. Those ESP-01 modules don’t have the best board antenna to begin with and if that is close to a metal case or to a PCB with active microprocessors, I can imagine all kinds of bad things going on ^^. The thing I’d try first would be to make a cable to get the ESP-01 further away from the board.

I had a quick look at the MAVESP firmware code. It’s not a transparent link but looks very much like a store-and-forward system on MAVLink protocol level. There’s already a bug report which might touch the same issues like you have. I’d suggest you add to the existing bug or open a new one here: https://github.com/dogmaphobic/mavesp8266/issues :slight_smile:

I’ve used and played with this a bit with Pixhawk and haven’t found them to be reliable enough
to be a secondary solution.

Even with external antenna, I’ve yet to have 1 experience where the connection didn’t drop or simply lock, requiring reboot of the unit.
I’m not sure what the signal level is on them but I think you’re going to need 10x the output capability, or live in rural areas where interference isn’t an issue.

I also feel like in urban areas, they simply get overloaded with interference and other wifi signals.

I’ve NEVER had an interference issue with them vs. any other 2.4ghz system.
I have one on full time on 2 rigs as a gopro controller.

My 2 cents

thank you for all answers,
i will be more specific in my question , as i have no doubt about the communication abilities of the ESp8266, as i use them all the time on other projects .
My question is if somebody did had success on making the esp to communicate on a pixhawk as it is on the pixracer

the pixracer firmware does not work on the pixhawk .
regards

Have you tried? You don’t need the Pixracer firmware, the Pixhawk one should work. Like I said before:

This is what I was talking about. Have used it on multiple pixhawk craft using multiple esp8266 versions. 2, 4, 7, 12. With and without external antenna.

Out of curiosity, did you use the MAVESP or the ESP serial firmware?

OK, that one was easy to eliminate; I used jumper cables to put some space between the board and the PixRacer; no difference.

But it was worth checking.

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.