Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By McChubby007
#75165 Hi all, as the title says I want to send data using wi-fi from the esp8266 to a Linux PC, only in one direction, asynchronously to the PC, either broadcast or point-to-point, and I'm looking for a quick and easy example. The esp8266 implementation is not so much of a problem for me, but rather I'm looking for the right architecture to use on the Linux side which will guide me and also then drive my esp8266 code. Additionally, suggestions of language on the Linux side would be welcome.

My project is constrained in that the Linux side must be a standalone executable (from cmd line) that can write the received data to a file descriptor. However this is not my area of expertise and hence I'm asking for advice; what protocol would you suggest, implemented in what language (on Linux) and do you have a cheap and cheerful example for esp and Linux.

Anyway, I don't want anyone spending lots of time researching this, as I can do that myself, but please reply if you have something to hand that helps me further along.

Failing that, I will research this myself and post my findings/solution when I have it, as reference for others in the future. My default will most likely be Java (Arduino Processing, then exported) and UDP, but that's just a bit of a guess right now.
User avatar
By destroyedlolo
#75166 Salut,

You have several solutions for that :
  • Socket communication (GG will be your friend to find out zillion C of example for that) : probably the most complex one.
  • REST web service : Apache + PHP or NodeJS or ...
  • but my favourite is MQTT massages sending. You will find lot of example at ESP side, with help of Mosquitto companions, you can directly write incoming data using simple shell scripts

The big added value of MQTT solution is you can plug other subscriber (for example for tracing purposes) without interfering with your normal flows.

Almost all my smart home automation is driven with that, and my subscribers (automation, dashboard, widgets, ...) are made in C or in Lua.

Other solution exists ...

Bye
User avatar
By McChubby007
#75168
destroyedlolo wrote:Salut,

You have several solutions for that :
  • Socket communication (GG will be your friend to find out zillion C of example for that) : probably the most complex one.
  • REST web service : Apache + PHP or NodeJS or ...
  • but my favourite is MQTT massages sending. You will find lot of example at ESP side, with help of Mosquitto companions, you can directly write incoming data using simple shell scripts

The big added value of MQTT solution is you can plug other subscriber (for example for tracing purposes) without interfering with your normal flows.

Almost all my smart home automation is driven with that, and my subscribers (automation, dashboard, widgets, ...) are made in C or in Lua.

Other solution exists ...

Bye

Many thanks for the info, I will add it to my list of things to look into.