Comments on: MicroPython: MQTT – Publish DHT11/DHT22 Sensor Readings (ESP32/ESP8266) https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Thu, 27 Jul 2023 14:43:47 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Ahmad Reza https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-851458 Thu, 27 Jul 2023 14:43:47 +0000 https://randomnerdtutorials.com/?p=95590#comment-851458 In reply to Sara Santos.

Hi Sara
I add one led to my circuit for control:
def sub_cb(topic, msg):
print((topic, msg))
if msg == b’ON’:
led.value(1)
print(“LED turned ON”)
elif msg == b’OFF’:
led.value(0)
print(“LED turned OFF”)
but I have two problem at now:
this problem and this alarm
Traceback (most recent call last):
File “”, line 94, in
ValueError: too many values to unpack (expected 2)
line 94 temp, hum=read_sensor()

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-851294 Thu, 27 Jul 2023 09:10:42 +0000 https://randomnerdtutorials.com/?p=95590#comment-851294 In reply to Ahmad Reza.

Hi.
What LED are you referring to?
Regards,
Sara

]]>
By: Ahmad Reza https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-850834 Wed, 26 Jul 2023 17:15:53 +0000 https://randomnerdtutorials.com/?p=95590#comment-850834 Hi Sara
I exec this program by esp32 but my led does not on or off but hum and temp does.
thanks..

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-800899 Sun, 04 Dec 2022 10:57:10 +0000 https://randomnerdtutorials.com/?p=95590#comment-800899 In reply to hushuai.

Make sure you set up the node red mqtt nodes properly.
If you’re using the broker with a password and user, make sure you insert those there.
Additionally, make sure you have the mqtt broker set up properly (allowing remote connection): https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/
Regards,
Sara

]]>
By: hushuai https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-800773 Sat, 03 Dec 2022 18:47:44 +0000 https://randomnerdtutorials.com/?p=95590#comment-800773 IoT is the topic of my final year project,I have tried this tutorial,code works fine,but node-red unable to connect the Mqtt-in node.status always show: connecting.
Could you pls help to give some suggestion?

]]>
By: Ti wang https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-795972 Sat, 05 Nov 2022 03:43:47 +0000 https://randomnerdtutorials.com/?p=95590#comment-795972 There is no need for an external pull up resister with the esp8266. Several inputs have internal pull up resisters, pin 14 is one of them.

Declare your pin like this:
pin14 = Pin(14, Pin.IN, Pin.PULL_UP)

and use it like this:
sensor1 = dht.DHT22(pin14)

]]>
By: mackrackit https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-738086 Wed, 13 Apr 2022 17:24:03 +0000 https://randomnerdtutorials.com/?p=95590#comment-738086 Hi,
I recently installed a MQTT broker on Centos 9 Stream server. So I did not know if the error I was receiving was from that or something else. The error:

File “umqttsimple.py”, line 102, in connect
MQTTException: 2

The above is
“Connection Refused: Identifier rejected”

After some googling, I found out that there was a change to Mosquitto,
https://github.com/daq-tools/umqtt-example/pull/1

The fix for the above error is to change line #13 in umqttsimple.py to have a “keepalive” of 60.

class MQTTClient:

def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=60,
ssl=False, ssl_params={}):

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-672268 Thu, 23 Sep 2021 13:10:22 +0000 https://randomnerdtutorials.com/?p=95590#comment-672268 In reply to William.

Thanks for mention those details.
I’ll add some more information about the tutorial.
Regards,
Sara

]]>
By: William https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-672173 Thu, 23 Sep 2021 07:53:49 +0000 https://randomnerdtutorials.com/?p=95590#comment-672173 In reply to Sara Santos.

If Thonny is installed using the link to your comprehensive instructions as given in your post above, setting up the software for the specific microcontroller is included. Should a newbie have already installed Thonny beforehand without reading the ‘instruction manual,’ then it is easy to miss the section on setting up the options for the ESP32. In fact, I had previously installed Thonny, and when getting to the section “save as,” it was clear that something was missing as the screen did not show the option to save to the microcontroller. A quick web search brought up the website, as I had mentioned in my original post.

Therefore, it would be helpful to insert a relevant comment within your article saying that if the “save as” option is missing, then refer to your instruction article for setting up Thonny.

Regarding your allegation regarding plagiarism by the other site and noting your work is under copyright, that is a matter to take up accordingly. The link I provided resulted from a simple web search – no intention at all to deviate away from the randomnerdtutorials that are excellent.

Moral of the story – RTBM

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-mqtt-publish-dht11-dht22-esp32-esp8266/#comment-672027 Wed, 22 Sep 2021 21:28:13 +0000 https://randomnerdtutorials.com/?p=95590#comment-672027 In reply to William.

That website copied all our instructions from this tutorial: https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/

]]>