I am new to mqtt. I try to figure out how to save the messages send from mqtt publisher to mqtt subscriber into sqldatabase.
I already search online and found some answers but since I did not have any strong background in writing python script, I failed to understand the answer. Some of the answers I found at
Is there a way to store Mosquitto payload into an MySQL database for history purpose?
and
http://jasonbrazeal.com/blog/how-to-build-a-simple-iot-system-with-python/
As from the second link the author wrote that I must have
save_to_db
function to parse the message and store it into database. Can someone explain it to me how to get that done? Do I need to write a new python script or just edit the client subscriber script? And also if there is a link which can guide me in this particular topic would be good too.
Thank you in advance.