Direct communication between ESP8266 nodes

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

Direct communication between ESP8266 nodes

Post by EasyRider » Sat Jun 11, 2016 1:14 pm

I have supported the official campaign for Micropython implementation on ESP8266, but have not had a chance to play yet.
Congratulation to Damian and the team on great effort and achievement.

Anyway, my interest (as a newbie) in addition to standalone and WEB applications is in a "simple" direct local networking between Micropython ESP8266 nodes, without other central WIFI router or Access Point.

Is it possible currently or planned for the future to have ESP8266 nodes exchanging simple data directly?
For example in a local wireless sensing and controlling environment, where some nodes could be sensors (temperature, humidity, etc) and other controlling (relay switching, etc.).

As I understand similar capability has been implemented in LUA and Arduino ESP8266 using UDP communication protocol.

Regards
John

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Direct communication between ESP8266 nodes

Post by deshipu » Sat Jun 11, 2016 2:58 pm

The ESP8266 can work as an access point, and then other ESP8266s can connect to it. However, there is a limit of up to 4 connections at a time, so I guess they would have to connect, send their data, and then disconnect to make room for the others.

EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

Re: Direct communication between ESP8266 nodes

Post by EasyRider » Sun Jun 12, 2016 4:32 am

The ESP8266 can work as an access point, and then other ESP8266s can connect to it. However, there is a limit of up to 4 connections at a time
Unfortunately, AP with maximum 4 connections is an extremely small local network.

For beginners looking for simple/"basic" programming and practical use of ESP8266, this looks like a good alternative and appears to have a lot of features.

http://www.esp8266basic.com/

and supports UDP direct node to node communication in a local network.

https://docs.google.com/document/d/1NMZ ... f9gnk1rfei

It would be nice if someone from Micropython can confirm if there are plans to provide/improve support for low level local networking.

Regards
John

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Direct communication between ESP8266 nodes

Post by pythoncoder » Sun Jun 12, 2016 8:20 am

@EasyRider I've had a look at the esp8266basic docs and I can't see any reference to the maximum number of nodes that can connect to one in AP mode. Is it any better in this regard?

Views on Basic :shock: differ, but their dialect is rudimentary compared to MicroPython. No useful native data structures, no OO features, no generators and I doubt closures could be persuaded to work. No importing of libraries and (most repulsive of all) it seems that all variables have global scope. It would feel like stepping back thirty years. The old 'suitable for beginners' argument doesn't really wash any more. Native Python objects like lists, sets and dictionaries are beginner-friendly in my view. But each to their own: I wouldn't touch Basic :shock: with a bargepole.
Peter Hinch
Index to my micropython libraries.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Direct communication between ESP8266 nodes

Post by deshipu » Sun Jun 12, 2016 8:22 am

The 4-node limit comes from the soft AP implementation in the espressif code, so unless they rolled their own soft AP, they share that limit. Maybe they just don't know about it yet.

markxr
Posts: 62
Joined: Wed Jun 01, 2016 3:41 pm

Re: Direct communication between ESP8266 nodes

Post by markxr » Sun Jun 12, 2016 10:58 am

If all nodes are connected to the same (non-esp8266) accesspoint, they should be able to talk to each other normally. I don't know if the micropython networking stack supports multicast, but you should be able to use broadcast in UDP, and the other nodes will all receive if they have an open socket on the correct port.

Once you can do multicast or broadcast, then it should be possible to discover the ipv4 address of as many other nodes as exist on the wlan, and talk to those directly.

There is, as far as I see, a mesh implementation in the SDK, but it's not available to micropython yet; it should be possible to add this into the esp network WLAN class though.

EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

Re: Direct communication between ESP8266 nodes

Post by EasyRider » Mon Jun 13, 2016 4:34 am

ESP8266 Mesh Users Guide . I'm sure Micropython crew know and have a much better idea about this.

http://www.signal.com.tr/pdf/cat/30a-es ... n_v1.2.pdf

Implementation of Mesh network similar to Fig 1.4 would be nice.

Once again without being disrespectful, as a backer of the kickstarter campaign I would like some idea from Micropython crew if something like this has been considered.

Regards

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Direct communication between ESP8266 nodes

Post by deshipu » Mon Jun 13, 2016 7:58 am

If I remember correctly, this has been discussed during the campaign and proposed as one of the stretch goals, but didn't become one.

antgil
Posts: 1
Joined: Fri May 29, 2015 5:58 am

Re: Direct communication between ESP8266 nodes

Post by antgil » Wed Jun 15, 2016 12:36 pm

First, MicroPython is a fantastic achievement. I backed both the original PyBoard and the ESP8266 port.
That said I +1 the the request for UDP with broadcast. My company would like to implement advanced lighting controls. Being able to discover devices in the network is essential for a smooth provisioning process, but also to keep network traffic down when controlling multiple devices at once.

Keep up the good work! :D

Thanks
Anthony Gilley

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Direct communication between ESP8266 nodes

Post by deshipu » Wed Jun 15, 2016 1:47 pm

You know that nothing stops anybody from just going ahead and implementing it? If you have a C library that does it, adding some glue code to expose it to Micropython is relatively easy (just look at the existing modules) and I'm sure you will get help with that here.

Post Reply