Bridge Node does not seem to connect to the mesh

274 views
Skip to first unread message

Matthew Macdonald-Wallace

unread,
Aug 20, 2023, 12:55:13 PM8/20/23
to painlessmesh-user
Hi,

I'm relatively new to PainlessMesh.

I want to setup a "bridge node" based on the MQTT example at https://gitlab.com/painlessMesh/painlessMesh/-/blob/master/examples/mqttBridge/mqttBridge.ino

I already have a number of nodes that connect to a mesh called "timer" via port 5555

I have updated the above code to use the same mesh SSID, password, and port as my existing nodes, however the bridge node seems to stop doing anything once it has connected to the AP and MQTT server.

The output is as follows:

CONNECTION: stationScan(): <NETWORK>
CONNECTION: scanComplete(): Scan finished
CONNECTION: scanComplete():-- > Cleared old APs.
CONNECTION: scanComplete(): num = 13
CONNECTION: found : escrg, -35dBm
CONNECTION: Found 1 nodes
CONNECTION: connectToAP(): Best AP is 3288485881<---
CONNECTION: connectToAP(): Trying to connect, scan rate set to 4*normal
CONNECTION: Event: Station Mode Connected
CONNECTION: Event: Station Mode Got IP (IP: 192.168.xxx.247  Mask: 255.255.255.0  Gateway: 192.168.xxx.1)
CONNECTION: stationScan(): <NETWORK>
CONNECTION: scanComplete(): Scan finished
CONNECTION: scanComplete():-- > Cleared old APs.
CONNECTION: scanComplete(): num = 10
CONNECTION: found : escrg, -34dBm
CONNECTION: Found 1 nodes
CONNECTION: connectToAP(): Already connected using manual connection. Disabling scanning.

I'd then expect to see something along the same lines that I see on my other nodes:

setLogLevel: ERROR | CONNECTION | DEBUG |
CONNECTION: stationScan(): timer
CONNECTION: scanComplete(): Scan finished
CONNECTION: scanComplete():-- > Cleared old APs.
CONNECTION: scanComplete(): num = 4
CONNECTION: Found 0 nodes
CONNECTION: connectToAP(): No unknown nodes found scan rate set to normal

Along with announcements as nodes join/leave the mesh, which are then propagated over to the MQTT bridge.

Have I misunderstood how this works?

Thanks in advance for any help you can provide,

Matt

Matthew Macdonald-Wallace

unread,
Aug 21, 2023, 4:51:53 AM8/21/23
to painlessmesh-user
FWIW, I "fixed" this by ensuring that the mesh port and wifi channel are definitely int().

The only change I'd made was passing them via a build flag, but that seemed to corrupt the data somehow.

This is now working.

Reply all
Reply to author
Forward
0 new messages