loadingaz
Posts: 1
Joined: Tue May 14, 2019 1:16 pm

MQTT Sensor Data to LAMP web-server

Tue May 14, 2019 1:25 pm

Hello guys! I'm new here on this forum. Me and my buddies are making an IoT project, we're going to build a smoke detector with mobile application. User will be able to monitor current temperature on his mobile phone.

We will be using an ESP8266, RPI, MQTT protocol to send sensor data to the server and then to MySQL database. My question is how would I save incoming data (temperature, humidity and etc) to MySQL database. I found out that Python is being used in order to do this.

These tools have to be used in order to make this project, ESP8266, RPI, MQTT protocol, LAMP server or simply MySQL database.

Any help would be appreciated.

Andyroo
Posts: 4124
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: MQTT Sensor Data to LAMP web-server

Tue May 14, 2019 6:18 pm

Welcome to the forum.

If you have a look at the Paho module for Python you will find a set of functions to receive data from any topic and good coverage of this is to be found at http://www.steves-internet-guide.com specifically here.

Steve has also produced two logging programs - one to a plan log file and one here to an SQL database.

You may also like to have a look at Node-Red or io.adafruit.com - both may save you some coding - unless you fancy that :lol:
Need Pi spray - these things are breeding in my house...

Return to “Advanced users”