eengamerjens
Posts: 13
Joined: Fri Dec 30, 2016 2:22 pm

how to connect mqtt to python?

Wed Oct 31, 2018 4:23 pm

I have a project with a esp8266, raspberry pi zero w and a relay
And I want to send a command from the esp8266 to the raspberry pi to open the relay.
The relay is connect to a raspberry pi zero w who is connect via wifi to the same AP.
Can anybody help me?

pws
Posts: 91
Joined: Mon Apr 11, 2016 4:16 pm

Re: how to connect mqtt to python?

Wed Oct 31, 2018 4:39 pm

Post what you have done so far.


User avatar
B.Goode
Posts: 8256
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: how to connect mqtt to python?

Wed Oct 31, 2018 5:17 pm

eengamerjens wrote:
Wed Oct 31, 2018 4:23 pm
I have a project with a esp8266, raspberry pi zero w and a relay
And I want to send a command from the esp8266 to the raspberry pi to open the relay.
The relay is connect to a raspberry pi zero w who is connect via wifi to the same AP.
Can anybody help me?


There are a number of ways this could be implemented. And an equally large number of sequences of design steps you could take to reach a viable outcome.

Since you appear to have decided to use MQTT, my first design decision would be to determine where the MQTT Broker function is to be implemented: on the esp8266, on the RPi, or on some other independent system?

User avatar
jadro
Posts: 409
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: how to connect mqtt to python?

Sun Nov 04, 2018 1:49 pm

It is normally to have MQTT Raspberry pi server installed. ESP8266, Arduino or other microcontrollers are MQTT clients in my home IoT stuff.
Jadro
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

Return to “Python”