Comments on: Raspberry Pi Publishing MQTT Messages to ESP8266 https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Tue, 30 Nov 2021 15:31:07 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Thomas https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-704707 Tue, 30 Nov 2021 15:31:07 +0000 http://randomnerdtutorials.com/?p=33293#comment-704707 In reply to Thomas.

It was a problem to connect to rpi. I don’t know why ! If i change the port number 1883, i have this message on rpi console :
192.168.218.149 – – [30/Nov/2021 15:01:03] code 400, message Bad HTTP/0.9 request type (‘\x10\x19\x00\x04MQTT\x04\x02\x00\x0f\x00’)
ESP8266Client” HTTPStatus.BAD_REQUEST -03] “MQTT

It work with this url “broker.mqtt-dashboard.com”

]]>
By: Thomas https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-704700 Tue, 30 Nov 2021 15:09:19 +0000 http://randomnerdtutorials.com/?p=33293#comment-704700 Hi,

I have a problem with mqtt connection. It failed with rc=-2…

I have the same code in both pyton and ESP8266 code.

Can you help me with the value of rc state ?

Thank in advance
Thomas

]]>
By: Joeri Vanden Abeele https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-552284 Mon, 08 Feb 2021 11:32:32 +0000 http://randomnerdtutorials.com/?p=33293#comment-552284 Hi,

can I ask you something please?

Inside the python script, you are using:

“”
def action(board, changePin, action):
# Convert the pin from the URL into an integer:
changePin = int(changePin)
# Get the device name for the pin being changed:
devicePin = pins[changePin][‘name’]

“”
Can you tell me why you define devicePin? I guess you’re making a link to board in the next few lines, but i dont get it šŸ™‚

if action == “1” and board == ‘esp8266’:
mqttc.publish(pins[changePin][‘topic’],”1″)
pins[changePin][‘state’] = ‘True’

thx

]]>
By: rgbs https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-546904 Thu, 28 Jan 2021 16:10:11 +0000 http://randomnerdtutorials.com/?p=33293#comment-546904 super tutorial!It’s really great .Hope for your next blogs —-
1.the same project with voicecommand controlled
2.the same one that can be controlled globally not in the same lan
Thanks!

]]>
By: Sara Santos https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-471618 Wed, 01 Jul 2020 12:40:56 +0000 http://randomnerdtutorials.com/?p=33293#comment-471618 In reply to Navadeep Ganesh U.

Hi.
This particular project only works on your local network.
But if you install a broker on a cloud server you can control from anywhere. Take a look at this tutorial: https://randomnerdtutorials.com/cloud-mqtt-mosquitto-broker-access-anywhere-digital-ocean/
Regards,
Sara

]]>
By: Navadeep Ganesh U https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-471585 Wed, 01 Jul 2020 11:14:44 +0000 http://randomnerdtutorials.com/?p=33293#comment-471585 Is it local control(only in local WiFi) or can control GPIO’s globally from anywhere in the world?

]]>
By: bg https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-455675 Mon, 11 May 2020 21:20:13 +0000 http://randomnerdtutorials.com/?p=33293#comment-455675 Working!!! Sorry for all the noise.

Python3, maybe fixed it? I ran the sudo python3 app.py and reloaded the web page.
Pi is running Jessie w/py2 and 3 pre-installed

sudo python3 app.py
* Running on http://0.0.0.0:8181/
* Restarting with reloader
192.168.10.200 – – [11/May/2020 13:59:25] “GET / HTTP/1.1” 200 –
192.168.10.200 – – [11/May/2020 13:59:27] “GET /favicon.ico HTTP/1.1” 404 –
192.168.10.200 – – [11/May/2020 13:59:36] “GET /esp8266/4/1 HTTP/1.1” 200 –
192.168.10.200 – – [11/May/2020 13:59:41] “GET /esp8266/5/1 HTTP/1.1” 200 –

]]>
By: bg https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-455672 Mon, 11 May 2020 20:55:59 +0000 http://randomnerdtutorials.com/?p=33293#comment-455672 opps, and:

This site can’t be reached192.168.10.246 refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

Sounds like a priv/perm thing,

Thank in advance

]]>
By: bg https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-455671 Mon, 11 May 2020 20:54:10 +0000 http://randomnerdtutorials.com/?p=33293#comment-455671 Forgot to add:

ESP IP address: 192.168.10.246
Attempting MQTT connection…connected

]]>
By: BG https://randomnerdtutorials.com/raspberry-pi-publishing-mqtt-messages-to-esp8266/#comment-455665 Mon, 11 May 2020 19:01:43 +0000 http://randomnerdtutorials.com/?p=33293#comment-455665 Rui,

For starters, thanks for all the work you’ve done creating your turtorials!!! I’ve been using them to learn the ESP and Arduino plateforms. However,
I’m having issues getting this one to work. When running the python script, I get differnt output. I only two lines of output and it hangs on
the second line, ie, doesn’t return to cmd prompt or any other output.

python script hangs with “* Restarting with reloader”

web-server:

$ python -V
Python 2.7.9

$ ls
app.py templates

$ sudo python app.py
* Running on http://0.0.0.0:8181/
* Restarting with reloader
[this is where it hangs]

]]>