paulmandal / atak-forwarder

Forwards packets to/from ATAK over an off-grid communication layer
MIT License
399 stars 42 forks source link

Managed device name mangled, breaks comms #154

Closed Josh-SMU closed 1 year ago

Josh-SMU commented 1 year ago

One of my Meshtastic devices has a mac ending in 11. When managed by the Forwarder, it names the device BlahBlah-001/ instead of BlahBlah-0011. This appears to be breaking something as the location from this device/member is never displayed on other devices.

paulmandal commented 1 year ago

What type of device is it? There's some code to subtract 2 from the last character of the MAC address, at least on T-Beams the address is 2 higher than the address used in the MT UI.

An easy fix is to boundary check this but it sounds like that will result in the MT device's longName not being quite accurate.

Josh-SMU commented 1 year ago

It is a RAK4631

paulmandal commented 1 year ago

Try this release and let me know how it goes: https://github.com/paulmandal/atak-forwarder/releases/tag/2.0.3

Josh-SMU commented 1 year ago

Ok I do see the broadcasts now with device name BUT the AtakUid is only populated for the phone's device (phone1 is BlahBlah-MX-1234 and phone2 is YaddaYadda-1211; phone1 log shows its own broadcasts with proper AtakUid but the AtakUid for broadcasts from phone2 is null, and vice versa... Almost like its not being sent in the packets?)

Also oddly enough 1211 is no longer 121/ but is now 1210 which is incorrect...

Is there a way to capture the logs from logcat to a file? It may be easier for you to see what Im seeing.

paulmandal commented 1 year ago

The fix for the Bluetooth address thing was just to set the last character to 0 if it is less than 0, it's not a very robust fix but right now the plugin has no way to differentiate between RAK devices and T-Beams (which give a Bluetooth address 2 higher than the displayed address).

You can use Android Studio and copy & paste the logs out. Your theory about the broadcasts not containing the ATAK UID could be right, try sending discovery broadcasts from both devices and capturing what they send.

Josh-SMU commented 1 year ago

I'll continue this issue in the proper issue, this one is done (functionally, even if the mac is mismatched).