Problem M5Touch hostname, transport base, mqtt_cliente anda M5Thing
-
Hi everyone, I'm having a problem with an M5tough that I use with a thermocouple and MQTT. I'm getting the following error. I don't know what it's due to or how to fix it. Has anyone else had the same problem? I searched the forum and couldn't find anything. Thanks for the help.

-
@Jose-Manuel The error you're encountering (getaddrinfo() returns 202) typically indicates a DNS resolution issue, meaning the M5Tough is unable to resolve the hostname uiflow2.m5stack.com. Here are some steps to troubleshoot and resolve the issue:
- Check Network Connection
Ensure the M5Tough is connected to a stable Wi-Fi network.
Verify the Wi-Fi credentials (SSID and password) are correctly configured.- Verify DNS Settings
If the device is unable to resolve the hostname, try using a different DNS server (e.g., Google's DNS: 8.8.8.8 or 8.8.4.4).
You can configure this in the Wi-Fi settings or DHCP settings of your router.- Test Connectivity
Use a tool like ping or nslookup to check if the hostname uiflow2.m5stack.com is resolvable from another device on the same network.
- MQTT Configuration
Ensure the MQTT broker settings (hostname, port, client ID, etc.) are correctly configured in your code.
If the broker requires authentication, verify the username and password.- Firmware Update
Ensure the M5Tough is running the latest firmware. Outdated firmware might have bugs related to network connectivity.
- Debugging
Add debug prints in your code to check the Wi-Fi and MQTT connection status before attempting to send messages.
Example:print("Wi-Fi connected:", wifi.isconnected())
print("MQTT connected:", mqtt.isconnected())- Alternative MQTT Broker
Temporarily switch to a public MQTT broker (e.g., test.mosquitto.org) to rule out issues with the uiflow2.m5stack.com server.
Example Code for MQTT Connection (MicroPython)
from umqtt.simple import MQTTClient
import networkWi-Fi Configuration
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect("YOUR_SSID", "YOUR_PASSWORD")Wait for Wi-Fi connection
while not wifi.isconnected():
passprint("Wi-Fi connected:", wifi.isconnected())
MQTT Configuration
mqtt = MQTTClient("client_id", "test.mosquitto.org", port=1883)
mqtt.connect()
print("MQTT connected:", mqtt.isconnected())Suggested Next Steps
If the issue persists, you can contact M5Stack support at support@m5stack.com for further assistance.
reply with https://chat.m5stack.com/
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login