paulmandal / atak-forwarder

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

Error in message handling - "ack/nack" errors #121

Closed SzzoekzZx9 closed 2 years ago

SzzoekzZx9 commented 2 years ago

Android Version: Tested on 10 & 12.1 Firmware Version: 1.2.52 Meshtastic App Version: 1.2.52 (also tested on 1.2.51/1.2.53/1.2.55/1.2.61) ATAK Version: 4.6.0.3 ATAK Forwarder Version: 1.0.6

I have noticed an issue regarding, what I believe to be, the connection between ATAK and the Meshtastic app.

I connect to the radio via bluetooth and can send/receive messages over the air via the Meshtastic app. I can also get ATAK to show "connected" and start to send broadcast signals, however, these signals immediately fail and are counted as errors. I checked the debug panel in the Meshtastic app and did not see any packets tx/rx from "atak forwarder".

I checked logcat during ATAK startup and received the following.

04-13 00:02:12.220 11857 11857 D FWDDBG.i4: Mesh connected: true 04-13 00:02:12.223 11857 11857 V FWDDBG.i4: Notifying connection state listener: 39588367, state: DEVICE_CONNECTED 04-13 00:02:12.224 11857 11857 V FWDDBG.i4: Notifying connection state listener: 11726970, state: DEVICE_CONNECTED 04-13 00:02:12.224 11857 11857 V FWDDBG.i4: Notifying connection state listener: 164741163, state: DEVICE_CONNECTED 04-13 00:02:12.224 11857 11857 V FWDDBG.i4: Notifying connection state listener: 57650187, state: DEVICE_CONNECTED 04-13 00:02:12.224 11857 11857 V FWDDBG.i4: Notifying connection state listener: 230404603, state: DEVICE_CONNECTED 04-13 00:02:12.224 11857 11857 V FWDDBG.i4: Notifying connection state listener: 104, state: DEVICE_CONNECTED 04-13 00:02:12.227 11857 11857 V FWDDBG.P3: onUserDiscoveryBroadcastReceived, callsign: xxxx, meshId: xxxx, atakUid: ANDROID-xxxx 04-13 00:02:12.227 11857 11857 V FWDDBG.P3: Adding new user from discovery broadcast: xxxx, atakUid: ANDROID-xxx 04-13 00:02:12.229 11857 11857 V FWDDBG.e4: Checking owner 04-13 00:02:12.230 11857 11857 V FWDDBG.e4: Setting radio owner longName: xxxx, shortName: x 04-13 00:02:12.231 11857 11857 V FWDDBG.e4: Checking radio config 04-13 00:02:12.266 11857 11857 V FWDDBG.e4: Checking channel config for channel: xxxx, mode: 4, psk: xxxx 04-13 00:02:12.280 11857 11857 V FWDDBG.e4: target channel: xxxx, found! checking PSK and modemConfig 04-13 00:02:12.280 11857 11857 V FWDDBG.e4: channel: , found, not target 04-13 00:02:12.280 11857 11857 V FWDDBG.e4: channel: xxxx, found, not target 04-13 00:02:12.281 11857 11857 V FWDDBG.e4: channel: , found, not target 04-13 00:02:12.281 11857 11857 V FWDDBG.e4: channel: , found, not target 04-13 00:02:12.281 11857 11857 V FWDDBG.e4: needsUpdate: false 04-13 00:02:12.362 11857 12183 I FWDDBG.g4: sendMessageInternal(), message length: 52 chunks: 1 04-13 00:02:12.362 11857 12183 D FWDDBG.g4: sendNextChunk() 04-13 00:02:12.362 11857 12183 D FWDDBG.g4: sendChunk() 04-13 00:02:12.374 11857 12183 I FWDDBG.g4: ---> Sent packet: ATAKBCAST,meshid,ANDROID-xxxx,callsign,1 04-13 00:02:12.374 11857 12183 I FWDDBG.g4: messageChunk: 1/1 to: ^all, waiting for ack/nack id: -1181019467

shortly after I receive

04-13 00:02:27.027 11857 12418 I FWDDBG.g4: handleMessageStatusChange, got the message we ACK/NACK we're waiting for id: -1181019467, status: ERROR 04-13 00:02:27.028 11857 12418 I FWDDBG.g4: Status is ERROR, resending chunk after 5000ms

In short: What works

What doesn't work

I believe the issue falls between the meshtastic app and the forwarder, as the meshtastic app successfully sends and receives text messages and the debug panel shows these packets, but fails to show any packets relating to ATAK forwarder.

Let me know if I can provide any more information or testing. I would be happy to help in any way I can.

SzzoekzZx9 commented 2 years ago

It would appear I misunderstood both the "make sure you are in range" toast and the debug panel for Meshtastic.

I reunited the radios back to within 10 feet and the debug panel in question shows ATAKForwarder from the 2nd device! I was under the impression the "make sure you are in range" toast was referring to my radio, not the destination. I should have known due to the nature of ACK/NACK, however, it was not clear.

I do now have an issue with an overwhelming number of my packets resulting in errors, but, it is no longer 100%. Although I have not solved all my issues, I will close this as the original issue was less of an issue and more of a personal knowledge gap.