Arodd2000
Posts: 10
Joined: Sat May 02, 2015 9:17 pm

Python Communication Between Many Pi's

Mon May 29, 2017 9:38 pm

I was wondering if there is a python library that would let multiple Pi's talk to 1 main pi over wifi? I was thinking it would be easier to have 2 or 3 pi zero W's spread out for IOT and having 1 main Pi that takes care of users. Or would I need to pickle data and have the pi's constantly check a network folder?

DirkS
Posts: 10194
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Python Communication Between Many Pi's

Mon May 29, 2017 9:44 pm

For IoT I would have a look at MQTT protocol.
Run a mosquitto broker on a central Pi and let other Pi communicate with / through that one.

See e.g. http://www.hivemq.com/mqtt-essentials/ for more info.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Python Communication Between Many Pi's

Mon May 29, 2017 11:40 pm

I used hsmm-pi to set-up a mesh network that worked very well.

I made izzati to simply the talking between a front-end and a backend which is much simpler than mqtt.

http://izzati.readthedocs.io/en/latest/
There are 10 types of people: those who understand binary and those who don't.

User avatar
mattrix
Posts: 133
Joined: Mon Mar 02, 2015 6:20 am
Location: Christchurch, New Zealand
Contact: Website

Re: Python Communication Between Many Pi's

Tue May 30, 2017 4:36 am

2nd vote for MQTT :)
www.matthuisman.nz

User avatar
jjsanderson
Posts: 19
Joined: Wed Oct 17, 2012 11:45 am

Re: Python Communication Between Many Pi's

Tue May 30, 2017 2:03 pm

Third vote for MQTT. One advantage of going that route is that it's fully cross-platform and language-agnostic: we use it a lot for mixed networks of Pis and Arduino (ESP8266) controllers/sensors. Izzati looks interesting though - thanks for that, kusti8!

User avatar
mattrix
Posts: 133
Joined: Mon Mar 02, 2015 6:20 am
Location: Christchurch, New Zealand
Contact: Website

Re: Python Communication Between Many Pi's

Tue May 30, 2017 10:57 pm

And send the messages in JSON format (as that's pretty much universal as well)
www.matthuisman.nz

ian_g
Posts: 36
Joined: Fri May 26, 2017 1:04 am
Location: East Midlands, UK

Re: Python Communication Between Many Pi's

Wed May 31, 2017 1:39 am

mattrix wrote:And send the messages in JSON format (as that's pretty much universal as well)
anothrer vote for mqtt with json. Also encrypt using tls

Return to “Python”