Comments on: ESP32 MQTT – Publish DS18B20 Temperature Readings (Arduino IDE) https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 09 Feb 2025 19:38:33 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: pfe https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-1006656 Sun, 09 Feb 2025 19:38:33 +0000 https://randomnerdtutorials.com/?p=95323#comment-1006656 In reply to Sara Santos.

HI Sara When I use arduino to programm the esp32 c3 without the rtos , the reading is correct on the same board, so it’s not the wiring. I found comments on internet about the effect of wifi on the onewire timing..

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-1006539 Sun, 09 Feb 2025 09:29:28 +0000 https://randomnerdtutorials.com/?p=95323#comment-1006539 In reply to pfe.

Hi.
Usually that error means bad wiring or a faulty sensor.
Regards,
Sara

]]>
By: pfe https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-1005600 Wed, 05 Feb 2025 19:56:00 +0000 https://randomnerdtutorials.com/?p=95323#comment-1005600 HI
perhaps the code is working on a target esp32 (dual core) but on a esp32c3 (onecore) the onewire reads always -127.

]]>
By: chiache https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-981747 Sat, 09 Nov 2024 12:19:33 +0000 https://randomnerdtutorials.com/?p=95323#comment-981747 In reply to Sara Santos.

Hi.
After the reference modification, the situation is still the same and nothing has changed.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-981549 Fri, 08 Nov 2024 15:22:49 +0000 https://randomnerdtutorials.com/?p=95323#comment-981549 In reply to chiache.

Hi.
Add the following line
xTimerStop(wifiReconnectTimer, 0);

In this section (see newline in bold):

Serial.printf(“[WiFi-event] event: %d\n”, event);
switch(event) {
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
Serial.println(“WiFi connected”);
Serial.println(“IP address: “);
Serial.println(WiFi.localIP());
xTimerStop(wifiReconnectTimer, 0);
connectToMqtt();
break;

Let me know if this fixes the issue…
Regards,
Sara

]]>
By: chiache https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-980985 Wed, 06 Nov 2024 04:43:52 +0000 https://randomnerdtutorials.com/?p=95323#comment-980985 In reply to Sara Santos.

The relevant function libraries I use include:
1-a. github.com/mathieucarbou/AsyncTCP/tree/main
-b. github.com/me-no-dev/AsyncTCP
2. github.com/khoih-prog/AsyncTCP_SSL
3. github.com/khoih-prog/AsyncMQTT_Generic

ps: async-mqtt-client-master, Because this library cannot use 8883 port

]]>
By: chiache https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-980984 Wed, 06 Nov 2024 04:36:05 +0000 https://randomnerdtutorials.com/?p=95323#comment-980984 In reply to Sara Santos.

Because this message contains watchdog and CPU crashes,
So I removed mqttReconnectTimer and changed it to AsyncMqttClient connection in loop(), but the problem was not solved.
So I completely released the ~AsyncMqttClient object and re-created it.
But the connection still fails. The strange thing is that when I restart the ESP32, the AsyncMqttClient connection works fine.

]]>
By: chiache https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-980979 Wed, 06 Nov 2024 04:21:19 +0000 https://randomnerdtutorials.com/?p=95323#comment-980979 In reply to Sara Santos.

Hi.
Currently I rely on ESPAsyncWebServer,
No problem until step 4,
But after adding the AsyncMqttClient part, there is no problem with communication.
But as long as the connection is interrupted due to unknown reasons of mqttHost,
At this time, I will fall into the event of infinite connection [onMqttConnect] and connection interruption [onMqttDisconnect]. Until the watchdog crashes or I manually restart the ESP32, the AsyncMqttClient connection can resume normal communication.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-977675 Wed, 30 Oct 2024 09:51:16 +0000 https://randomnerdtutorials.com/?p=95323#comment-977675 In reply to chiache.

Hi.
Can you better explain the issue you’re facing?
Regards,
Sara

]]>
By: chiache https://randomnerdtutorials.com/esp32-mqtt-publish-ds18b20-temperature-arduino/#comment-976871 Tue, 29 Oct 2024 06:48:03 +0000 https://randomnerdtutorials.com/?p=95323#comment-976871 Hello, I am following the course :
1. https://randomnerdtutorials.com/esp32-wi-fi-manager-asyncwebserver/
2. https://randomnerdtutorials.com/esp32-web-server-sent-events-sse/
3. https://randomnerdtutorials.com/esp32-websocket-server-arduino/
4. https://randomnerdtutorials.com/esp32-ota-over-the-air-arduino/
5. https://randomnerdtutorials.com/esp32-mqtt-publish-bme680-arduino/

My MQTT_HOST is “https://www.emqx.com/en”
But when I used AsyncMqttClient, I found that disconnection and reconnection would always fail.
This is the case even if I delete AsyncMqttClient and re-create it,
It wasn’t until I restarted my device that I could connect normally,
Do you know the reason and can you give me some suggestions?

]]>