Close

A working example !

A project log for Linux-ESPNOW

An attempt at implementing a direct link between a linux station and an ESP module using ESPNOW protocol for real time robot control

thomas-flayolsThomas Flayols 02/28/2019 at 10:120 Comments

After a lot of testing with different lib and radio driver, together with @Florenc Caminade, we managed to capture and send ESP now packet! And it turns out to be quite simple, we just use linux sockets to send and receive packet. The tricky part was to generate a legit packet the card would accept and transmit as a vendor specific action frame. We had to include a radiotap header...

At the moment, packets are hard coded raw data, so it will only work if your ESP has the same MAC address, and it will send always the same data.. So not very useful but a good proof of concept

The code is on GitHub: https://github.com/thomasfla/Linux-ESPNOW/ and need a bit of cleaning.

To test it, you have to use this MAC address:

ESP: 84:F3:EB:73:55:0D
PC:  F8:1A:67:B7:EB:0B

you also have to set your interface in monitor mode, and it has to support packet injection.

compile and run using:

cd wifiRawSender/
make
sudo ./bin/sender wlan0

 where wlan0 is your interface up in monitoring mode (same applies for receiver example).

What's next?

Notes:

About the ACK behavior, I switch to an other wifi interface that does send ACK in monitoring mode !
I did not find if and where this is documented. For my application I don't mind to use a specific card.

Discussions