SunTzu44
Posts: 1
Joined: Fri Dec 01, 2017 5:20 am

Reading temp from 2 separate pi's and updating to central mysql db via python

Fri Dec 01, 2017 5:28 am

I can't figure it out, hoping someone can help. I have three PI's throughout my house with temp sensors. I would like to run a master python script from one PI and get temp data from each of other raspberry pi hosts; and then update it in my central MYSQL DB. How can I do this via Python?

ghp
Posts: 1517
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Reading temp from 2 separate pi's and updating to central mysql db via python

Sat Dec 02, 2017 7:34 am

Hello,
you have some options,
  • let each pi connect to the database and store the data. Databases can have multiple remote clients connected.
  • send the data to a central pi. You could use MQTT to send/receive the data, using mosquitto as a MQTT broker.
The second option using MQTT would also allow to use other devices as e.g. arduino with ethernet/wifi to send data.

Hope this helps,
Gerhard

Return to “Python”