liamcottle / meshtastic-map

A map of all Meshtastic nodes heard via MQTT.
https://meshtastic.liamcottle.net
MIT License
97 stars 25 forks source link

Neighbors Displaying #19

Closed skykingisepic closed 7 months ago

skykingisepic commented 7 months ago

Two new nodes: Heltec-V3 and WisBlock both with latest FW.

Heltec is Client with Neighbors turned On, WisBlock is Router_Client.

Heltec displays on Map but no Neighbors are showing up that saw Heltec or that Heltec saw.

Heltec connected to MQTT server, WisBlock is not.

Assumed Heltec would find WisBlock even with Neighbors off since both on FW 2.3+

No change even with WisBlock Neighbors On.

Great Map, BTW - good job!

GMart commented 7 months ago

I think this would only work if both the Wisblock and the Heltec has LongFast as the Primary channel, and the Heltec had uplink on LongFast. Right now, since MQTT is off on the wisblock, it can only transmit the Neighbors info through its primary channel. Do you have MQTT map upload on on the Heltec? What I would do is just turn on the Neighbors Module on the Heltec.

skykingisepic commented 7 months ago

Primary on both, Heltec Uplink on, Neighbors on just for Heltec, no MQTT on WisBlock. Still no neighbor info for WisBlock. Heltec info on map shows 2 local nodes online. MQTT Map reporting MED_PRECISION on heltec.

mqtt listener started with: node src/mqtt.js --mqtt-broker-url mqtt://epicnet.us:8183 --decryption-keys AQ== --collect-neighbour-info --collect-map-reports

Also (not related to Map but FYI) I set up a secondary channel for neighbors to use for private messaging. It's on the Heltec and I sent a message to the Channel (1) saying 'Channel and Map active now'. This message showed up on the WisBlock that doesn't have Channel 1 set up as a message showing '1' (channel number on left?) and 'Channel Name' where the actual channel name I created should be (MQTTEastTN) and the message. How can this be displayed without the channel name and PSK? Total breach of security!

Also, if you bring up the node info popup and move the mouse cursor over the green dot and off the times change between recent and historic (minute ago, 14 minutes ago, etc).

Just added a second Heltec set up w/o MQTT. First Heltec still only thing showing on Map and info shows 3 nodes online. I was hoping to have just one node connected to MQTT and report the other neighbor nodes in radio range so they all show on the map. There aren't many other nodes close in my area so most in the regional (Eastern TN) area will be reporting via MQTT anyway but the radio locals should hitch a ride on my Router_Client node.

liamcottle commented 7 months ago

Also, if you bring up the node info popup and move the mouse cursor over the green dot and off the times change between recent and historic (minute ago, 14 minutes ago, etc).

Yeah, the hover tooltip is bound when refreshing nodes. But the persistent tooltip is generated on the fly when you click. So moment is giving an updated time ago value.

I haven't found a way to make the initial tooltips dynamically generated on each hover, without binding to the hover event and showing, rather than binding the tooltip as normal.

Will revisit that later.

skykingisepic commented 7 months ago

Since I'm not getting any neighbor info from the one Heltec connected to my MQTT server, I connected my second Heltec to the server and getting both Heltecs showing up on the map (although the second is showing offline when it isn't). Retired IT guy and HAM radio (running neighborhood GMRS repeater to get out several miles) so this shouldn't be brain surgery for me. Can't figure out why I'm not getting map display of neighbors. My third node (WisBlock) should be showing as a neighbor (not connected to MQTT). I do see another node on the map now connected to my MQTT server, so some progress getting the locals on board. Local Node Map

skykingisepic commented 7 months ago

Screenshot from 2024-04-24 09-36-26 Screenshot from 2024-04-24 09-32-06 Looking at your own map @ liamcottle.net I'm curious to know how my three nodes are showing up since I'm only connected to my own MQTT server? Also, all three of my nodes are showing up in clustered view and I even see neighbor info between Sky1 and Sky2. https://meshtastic.liamcottle.net/?node_id=3663159600

Perhaps I briefly connected to the meshtastic MQTT server but don't recall doing that 12 hrs ago. If I did, then maybe I have an issue with my Mosquitto server, but I see my node connected to that server. Restarted MQTT server and mqqt.js. You can see that my node info never even shows Neighbors Updated time.

liamcottle commented 7 months ago

Heltecs showing up on the map (although the second is showing offline when it isn't)

The MQTT connection status isn't perfect. These states are based on your node publishing the online state to the stat topic when coming online, and an LWT (more info in readme about this), is used to publish the offline state. There's a bug, with using MQTT Client Proxy that breaks these states. Unsure if you are using such function...

Looking at your own map @ liamcottle.net I'm curious to know how my three nodes are showing up since I'm only connected to my own MQTT server?

According to my public map database, both of the below nodes connected to the public MQTT server, based on the fact that they both have a timestamp set for their MQTT connection status. (as indicated by the time in brackets next to the MQTT status). That timestamp can only be updated if the public MQTT server emitted a stat topic for your node ids.

Looking at the last updated timestamp, none of those nodes have been updated for over 10 hours. So no more packets have been heard on my map for your nodes since then.

Also, all three of my nodes are showing up in clustered view

It appears all 3 nodes have the same lat/lng value on my map, so that will be the only way to see the nodes, as they are perfectly on top of each other.

I even see neighbor info between Sky1 and Sky2

I don't think it's possible to see the neighbour lines in the UI if nodes are perfectly on top of each other, but this endpoint will return all of the records it can determine for neighbours for a given node id, making sure to update the url to point to your server instead...

https://meshtastic.liamcottle.net/api/v1/nodes/3663159600/neighbours

Can't figure out why I'm not getting map display of neighbors.

If you have updated the position of your devices on your own map so they are not overlaying on top of each other, then I can't say why your neighbour links aren't updating on the map, other than the fact they are likely not being published to the MQTT server at all.

I would suggest, logging outbound packets, by looking at the mesh logs, or using usb serial to make sure the nodes are actually broadcasting neighbour app packets over RF, and then to also use something like MQTT explorer, or another MQTT client, to check if those packets are also being published to the relevant MQTT server.

liamcottle commented 7 months ago

Also, just going back to a previous comment, I saw you were passing in -decryption-keys AQ==, unsure if you posted that as a shorthand, or to obfuscate your actual keys, or if you are actually passing that value in to mqtt.js when running it.

If it's a case of actually using the value AQ==, I don't think this will work, and any packets encrypted with the default key won't actually be decrypted by mqtt.js as it doesn't expand the shorthand default key for you.

I would suggest changing this to the full key, which you can see in mqtt.js, and maybe that could resolve your problem?

skykingisepic commented 7 months ago

Sorry to take up your time with this - my noobness is showing :>)

Didn't know AQ== was a shorthand (as displayed in the default channel PSK) so I used just that to start mqtt.js

I removed the command line option and let it load with the full PSK and now I'm seeing Neighbor info!

Just to clarify - I'll only see nodes if they are connected to my MQTT server or when I specifically click on 'Show Neighbours' in Node Detail popup? They won't automatically show up just because they are reported as a neighbour?

My goal here was to have nodes appear on the map without having to connect to MQTT as long as they are reported by another node as a neighbour that is connected to MQTT.

Thanks again for you assistance and clarification. Cheers.

liamcottle commented 7 months ago

Sorry to take up your time with this

No problem at all! Always happy to help :)

I removed the command line option and let it load with the full PSK and now I'm seeing Neighbor info!

Fantastic! Glad you got it fixed. Please close this issue if there's nothing else needed here.

I'll only see nodes if they are connected to my MQTT server or when I specifically click on 'Show Neighbours' in Node Detail popup?

You will see nodes on the map if any of the following are true, (could be more, but that's all I could think of right now);

Note: MQTT Map Reports include the node info and the position, and can immediately display the node on the map from that single report. However, map reports are only sent to MQTT for the node that is directly connected to MQTT. If it's not, you will need to collect 2 packets from the node, the node info packet and the position packet, before the node will show on the map. The node info packet does not include a position. The map search bar will show the node name as red when there is no position available.

They won't automatically show up just because they are reported as a neighbour?

Neighbour packets won't show those other nodes on the map, you need the node info, and position packets for them to show up. Neighbour packets just indicate which nodes heard each other, and their signal quality.

My goal here was to have nodes appear on the map without having to connect to MQTT as long as they are reported by another node as a neighbour that is connected to MQTT.

Yep, I do the same. I have a single Raspberry Pi model 3B, with an SX1268 Waveshare LoRa hat, running Meshtastic Linux Native. It is connected to the internet via Ethernet or WiFi, and acts as an MQTT gateway node. It will uplink all packets it hears to the public MQTT server.

This allows all of my other nodes placed around the city, to have no internet connection and not be directly connected to MQTT. They will broadcast their own position over the default LongFast channel, and my Pi Gateway will pick up those packets and send to MQTT.

Then, mqtt.js picks up those packets, saves them to database and displays them on the map.

skykingisepic commented 7 months ago

Thanks for all that. Map says search 4 nodes but still not showing my WisBlock even though I have all three now connected to MQTT. I think it's because they're all so close. Will wait for some local folks to connect and see what they display.