I successfully connected my ESP32 board with a wifi network via the paho-mqtt example code base.
However, I don’t really know how to proceed with the work from now on. Like how to connect the board with either a local broker that runs on my Linux machine or a public broker like https://mqtt.eclipseprojects.io/.
When I try to check the network by typing ifocnfig inside the riot terminal, all I can get is just a local link ipv6 address like this:
2022-08-12 22:58:00,054 # ifconfig
2022-08-12 22:58:00,059 # Iface ET0 HWaddr: 3c:61:05:13:46:54 Link: up State: up
2022-08-12 22:58:00,061 # Link type: wireless
2022-08-12 22:58:00,069 # inet6 addr: fe80:0:0:0:3e61:5ff:fe13:4654 scope: link state: valid
I have tried paho-mqtt on native board, and it worked. So basically I don’t know how to connect my board to the outer work…
Big thanks to anyone who knows the answer to my question!
Every interface comes up with an IPv6 Link-Local (fe80:) address, so that doesn’t mean that you have any connectivity at all. It is likely that you are not connected to your wifi network at all with your build.
I haven’t tried the paho-mqtt build, but I will and see what help I can offer.
(I need to do some ESP32 work this week anyway)
Usually, you should receive the GUA prefix from your router after some time, once a router advertisement has been received. With that GUA you should then be able to connect any address outside.
Hi, thank you for your answer! The ipv4 setting does work!
The only problem is that the connection between the ESP32 node and broker is so unstable, such that I have to re-connect to the broker once after a few pub/sub. I wonder if that’s a problem related to the board itself, cause the node built on the native board works perfectly. Thank you!