meshtastic-map icon indicating copy to clipboard operation
meshtastic-map copied to clipboard

Code Update - Server Not Updating db From Mosquitto

Open skykingisepic opened this issue 1 year ago • 5 comments

Just did a repo update, my last was in April.

After the update and prisma migrate, my nodes aren't showing

startup options specified: --mqtt-broker-url mqtt://myserver:8183 --mqtt-username MeshEast --mqtt-password private --mqtt-topic msg/TN --collect-service-envelopes --collect-neighbour-info --collect-map-reports --purge-interval-seconds 43200 --purge-nodes-unheard-for-seconds 172800 (8183 forwarded to 1883 using nginx stream).

Nodes use same root topic (msg/TN) for MQTT server and were reporting Online before the update

Also, autozoom is set to 15 but no longer works when you click on a node in global view (before my nodes disappeared).

I dropped the meshtastic-map db then ran the prisma migrate and restarted the server and map, map shows no nodes although my main home node is connected to MQTT. Mosquitto db shows the main node is Online and 3 more that are Offline. All mariadb meshtastic-map tables are empty.

Mosquitto log shows both server and my node connected.

The mqtt.js doesn't seem to be pulling from Mosquitto and updating mariadb.

Update 18-Sept: I removed and re-cloned Repo, updated prisma to 5.19.1, restarted server and map Still no records in mariadb from Mosquitto server even though it shows a node Online and the Mosquitto log shows mqtt.js and node both connected to MQTT.

skykingisepic avatar Sep 14 '24 16:09 skykingisepic

For testing to get it working, I'm starting off simple with:

node src/mqtt.js --mqtt-broker-url mqtt://epicnet.us:8183 --mqtt-username MeshEastTN --mqtt-password privcom4us --mqtt-topic msg/TN --collect-service-envelopes

Don't need the extra collection options but once working will add --collect-neighbour-info --collect-map-reports

Still no joy - empty data sets in mariadb adding any or all --collect options

By re-cloning repo and dropping the meshtastic-map db it's like a new install instead of an update.

skykingisepic avatar Sep 19 '24 11:09 skykingisepic

I'm not using docker, running with node in cloned repo folder.

skykingisepic avatar Oct 04 '24 19:10 skykingisepic

Any luck? My local Tennessee MQTT Server and Map has been down now for weeks.

skykingisepic avatar Oct 13 '24 01:10 skykingisepic

Do you have an archived version of index.js and mqtt.js that goes back a couple of releases so I can get back up and running?

skykingisepic avatar Nov 08 '24 13:11 skykingisepic

Ahh, I think I misunderstood your original issue. You got me curious, so I spun up a new VM to test and can repro similar behavior (connected to MQTT but nothing written to DB) when using docker compose up however, when I run the same command without using docker node mqtt.js <Mqtt details omitted> --collect-positions --collect-neighbour-info --collect-map-reports it works for me.

I'll let you know if I manage to find anything or get my test setup working with a bit more hacking

I tried docker and got same result - no nodes on map or in db.

skykingisepic avatar Nov 08 '24 15:11 skykingisepic

After wasting 2 days trying to get the collector (mqtt.js) to update the database from my mqtt server, I tried using the default meshtastic mqtt server. Still no database updates. I have deleted the entire repo and re-cloned, dropped the database and let it get re-created and synced. Nothing. Starting the server with just the basics:

node src/mqtt.js --collect-service-envelopes --collect-neighbour-info --collect-map-reports

.env is correct as npx prisma migrate dev completes.

My local node is connected to my mqtt server and sending data. I'm using MQTT Explorer and can see constant data streaming in. My node sees 62 local nodes, so I should have lots of neighbour info. And I am reporting my position. This worked great for the last year until it quit working.

skykingisepic avatar Nov 08 '24 20:11 skykingisepic