Open blu006 opened 3 months ago
If needed, I can also provide the schematic and design files between the OPi one and my RFM95, but I don't think those are necessary for this software issue.
Looks like pubSub.loop() at https://github.com/meshtastic/firmware/blob/master/src/mqtt/MQTT.cpp#L413 is always returning false, even though it should be connected. Very possibly an issue with Portduino's fake WiFiClient implementation.
I guess I could set up a vscode environment with platform io, place a debug statement, and try to crosscompile for armhf...
it also seems like good practice to put just a few more debugging printouts into the mqtt code so that we know what's going on
@blu006 You could open a PR with some reasonable debug calls added. The CI will push out armhf and arm64 builds.
@jp-bennett it seems to be as you expected (not surprised)
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 96 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: MQTT connected
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 96 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: published online=1
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: DEBUG | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: Reconnecting MQTT because the PubSub loop returned false
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: MQTT connected
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: published online=1
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: DEBUG | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: Reconnecting MQTT because the PubSub loop returned false
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: MQTT connected
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]:
Jul 06 15:13:55 george meshtasticd[25790]: INFO | ??:??:?? 97 [mqtt]
Jul 06 15:13:55 george meshtasticd[25790]: published online=1
Jul 06 15:13:55 george meshtasticd[25790]:
@blu006 We might be able to query pubsub's state() call to get the reason, as per https://pubsubclient.knolleary.net/api#state
@jp-bennett I get some interesting results from this. It still looks like it's definitely a fake wifi issue. I'm wondering how the portduino code for all of this looks.
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: DEBUG | ??:??:?? 20 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: Reconnecting MQTT because the PubSub loop returned false:-3
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: INFO | ??:??:?? 20 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: INFO | ??:??:?? 20 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: MQTT connected
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: INFO | ??:??:?? 20 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: published online=1
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: DEBUG | ??:??:?? 21 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: Reconnecting MQTT because the PubSub loop returned false:-3
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: INFO | ??:??:?? 21 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: INFO | ??:??:?? 21 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: MQTT connected
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]:
Jul 06 16:29:58 george meshtasticd[26864]: INFO | ??:??:?? 21 [mqtt]
Jul 06 16:29:58 george meshtasticd[26864]: published online=1
Jul 06 16:29:58 george meshtasticd[26864]:
@blu006 Part of your Issue says only Android can configure.
Is this meaning iOS App can't? What about the web client?
@blu006 Part of your Issue says only Android can configure.
Is this meaning iOS App can't? What about the web client?
I could not configure it on the web client.
I do not have iOS
@blu006 It looks to me like https://github.com/knolleary/pubsubclient/blob/2d228f2f862a95846c65a8518c79f48dfc8f188c/src/PubSubClient.cpp#L684 calls https://github.com/meshtastic/WiFi/blob/b885b9595d54ee6eae59696eeae98f631eb27a23/src/WiFiClient.cpp#L171 which is the spot in the fake wifi code that is returning not connected. Possibly related to https://github.com/meshtastic/WiFi/pull/1
My working theory is that on native, we loop through the MQTT check so fast, we're pulling all the bits from the socket, and the logic there is faulty when there are no bytes waiting to be read.
maybe addressed with https://github.com/meshtastic/WiFi/pull/2
@jp-bennett I'm still looking for some way to cross-compile everything without the limitations from GitHub actions 😵💫
Is there a docker image that I can run under qemu or anything like that?
@jp-bennett I'm still looking for some way to cross-compile everything without the limitations from GitHub actions 😵💫
Is there a docker image that I can run under qemu or anything like that
I'm sure there are ways. I've just been compiling on an arm32 install on a modern Pi. I'll see about getting a test build for you to try.
@jp-bennett I'm interested.
@blu006 Sorry for the delay. See if https://drive.google.com/file/d/16uXRGjITWo6D2dblD1LBiAHtIKFjiDFx/view?usp=sharing will work.
@blu006 Sorry for the delay. See if https://drive.google.com/file/d/16uXRGjITWo6D2dblD1LBiAHtIKFjiDFx/view?usp=sharing will work.
it still connection cycles, but it seems slower this time (or my wifi sucks more). Let me see if I can get the logs.
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 240 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: published online=1
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 270 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 270 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: MQTT connected
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 270 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: published online=1
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 285 [DeviceTelemetryModule]
Jul 10 03:30:27 george meshtasticd[1884]: (Sending): air_util_tx=0.082417, channel_utilization=0.000000, battery_level=101, voltage=0.000000, uptime=285
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 285 [DeviceTelemetryModule]
Jul 10 03:30:27 george meshtasticd[1884]: Sending packet to phone
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 285
Jul 10 03:30:27 george meshtasticd[1884]: Telling client we have new packets 14
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 285 [ServerAPI]
Jul 10 03:30:27 george meshtasticd[1884]: getFromRadio=STATE_SEND_PACKETS
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
\Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 300 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 300 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: MQTT connected
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 300 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: published online=1
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 330 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: Attempting to connect directly to MQTT server mqtt.meshtastic.org, port: 1883, username: meshdev, password: large4cats
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 330 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: MQTT connected
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]:
Jul 10 03:30:27 george meshtasticd[1884]: INFO | ??:??:?? 330 [mqtt]
Jul 10 03:30:27 george meshtasticd[1884]: published online=1
Jul 10 03:30:27 george meshtasticd[1884]:
@jp-bennett are the debugging symbols retained in these pio files? they seem a bit small for that imo
i kind of want to put a breakpoint in it with gdb and see how things go
Category
Other
Hardware
DIY
Firmware Version
2.3.13.83f5ba0
Description
The MQTT connection configuration on Portduino only works through the Android app, and it continuously connection cycles on the public MQTT server at
mqtt.meshtastic.org
.My device is an orangepione.
armbianmonitor -u
reports the following:My meshtasticd configuration is this:
My MQTT configuration page looks like this:
I found the issue through a combination of reading the logs and meshexplorer. Meshexplorer toggles my node's online / offline status very quickly. Here are some of the logs from systemd:
Relevant log output
No response