Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply to Repeater in DeviceTelemetry module #2661

Merged
merged 3 commits into from
Aug 1, 2023

Conversation

thebentern
Copy link
Contributor

No description provided.

@GUVWAF
Copy link
Member

GUVWAF commented Jul 28, 2023

How will one be able to select the repeater as destination, since it is not in the NodeDB?

Also currently upon receiving the response from the repeater, the other nodes will send out their NodeInfo and ask for a response from the repeater (because they don't have it in their NodeDB), but it will not be able to answer.

@thebentern
Copy link
Contributor Author

thebentern commented Jul 28, 2023

That is a good point. I forgot that sending with a --dest tries to pull from NodeDB. I'm not sure how this will behave with a forged request, but I intend to experiment with it in the C# client, if nothing else to satisfy my own curiosity. 😅

Any ideas for an alternative? Almost wondering if we need some sort of heartbeat / status module in the long term. Traceroute lets you know it's still alive, but folks want something to know the repeater isn't about to have a dead battery in solar installations especially.

@GUVWAF
Copy link
Member

GUVWAF commented Jul 28, 2023

The default broadcast of the DeviceTelemetry is actually like a heartbeat/status module, right? I definitely see why getting the battery status is useful and being able to request it seems like a nice approach in order to still have the advantage of a repeater not contributing to traffic load. However, currently the only way to make this possible is when the repeater also has the NodeInfoModule and thus it would be stored in each node’s NodeDB.

Actually the only thing you need to know is its NodeNum, but letting users write that down sounds a bit cumbersome 😅
Maybe we could just use the broadcast address and let only repeaters respond to that?

Not sure how this would work client-wise, because it doesn’t know the node that responded. Maybe something like “A repeater with NodeNum x responded with: …

@thebentern thebentern closed this Jul 29, 2023
@thebentern thebentern reopened this Jul 31, 2023
thebentern added a commit to meshtastic/artifacts that referenced this pull request Jul 31, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

🤖 Pull request artifacts

file commit
pr2661-firmware-2.1.22.19ecf58.zip 19ecf58

thebentern added a commit to meshtastic/artifacts that referenced this pull request Aug 1, 2023
@thebentern
Copy link
Contributor Author

thebentern commented Aug 1, 2023

Tested in C# client (WIP) and seems to work
Sent: { "packet": { "to": 1734053744, "decoded": { "portnum": "TELEMETRY_APP", "payload": "EgA=", "wantResponse": true }, "id": 4294967295, "hopLimit": 3, "wantAck": true } } Payload decoded: { "deviceMetrics": { } } Received: { "queueStatus": { "free": 14, "maxlen": 16, "meshPacketId": 840478738 } } Received packet from device: { "queueStatus": { "free": 14, "maxlen": 16, "meshPacketId": 840478738 } } Received: { "packet": { "from": 1734053744, "to": 3693202693, "decoded": { "portnum": "TELEMETRY_APP", "payload": "DR4AAAASDAhlFUSLiEAdagNdPw==", "requestId": 4294967295 }, "id": 1465824668, "rxSnr": 5.75, "hopLimit": 3, "wantAck": true, "rxRssi": -8 } } Received packet from device: { "packet": { "from": 1734053744, "to": 3693202693, "decoded": { "portnum": "TELEMETRY_APP", "payload": "DR4AAAASDAhlFUSLiEAdagNdPw==", "requestId": 4294967295 }, "id": 1465824668, "rxSnr": 5.75, "hopLimit": 3, "wantAck": true, "rxRssi": -8 } } { "batteryLevel": 101, "voltage": 4.267, "channelUtilization": 0.86333334 }

Repeater logs:
DEBUG | ??:??:?? 30 [RadioIf] (bw=250, sf=11, cr=4/8) packet symLen=8 ms, payloadSize=24, time 518 ms
DEBUG | ??:??:?? 30 [RadioIf] Lora RX (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x8 encrypted rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [RadioIf] AirTime - Packet received : 518ms
DEBUG | ??:??:?? 30 [Router] Add packet record (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x8 encrypted rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [Router] Using channel 0 (hash 0x8)
DEBUG | ??:??:?? 30 [Router] Expanding short PSK #1
DEBUG | ??:??:?? 30 [Router] Using AES128 key!
DEBUG | ??:??:?? 30 [Router] nRF52 encrypt fr=dc21cd05, num=ffffffff, numBytes=8!
DEBUG | ??:??:?? 30 [Router] decoded message (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 WANTRESP rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [Router] handleReceived(REMOTE) (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 WANTRESP rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [Router] Module 'DeviceTelemetry' wantsPacket=1
INFO | ??:??:?? 30 [Router] Received DeviceTelemetry from=0xdc21cd05, id=0xffffffff, portnum=67, payloadlen=2
INFO | ??:??:?? 30 [Router] Device telemetry replying to request
DEBUG | ??:??:?? 30 [Router] Initial packet id 1465824666, numPacketId 4294967295
INFO | ??:??:?? 30 [Router] Asked module 'DeviceTelemetry' to send a response
DEBUG | ??:??:?? 30 [Router] Module 'routing' wantsPacket=1
INFO | ??:??:?? 30 [Router] Received routing from=0xdc21cd05, id=0xffffffff, portnum=67, payloadlen=2
DEBUG | ??:??:?? 30 [Router] Routing sniffing (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 WANTRESP rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [Router] Delivering rx packet (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 WANTRESP rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [Router] Update DB node 0xdc21cd05, rx_time=0, channel=0
DEBUG | ??:??:?? 30 [Router] Forwarding to phone (id=0xffffffff fr=0x05 to=0x70, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 WANTRESP rxSNR=6 rxRSSI=-7)
DEBUG | ??:??:?? 30 [Router] Module 'routing' considered
DEBUG | ??:??:?? 30 [Router] Sending response (id=0x575eb59c fr=0x70 to=0x05, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 requestId=ffffffff priority=70)
DEBUG | ??:??:?? 30 [Router] Update DB node 0x675b8f70, rx_time=0, channel=0
DEBUG | ??:??:?? 30 [Router] localSend to channel 0
DEBUG | ??:??:?? 30 [Router] Add packet record (id=0x575eb59c fr=0x70 to=0x05, WantAck=1, HopLim=3 Ch=0x0 Portnum=67 requestId=ffffffff priority=70)
DEBUG | ??:??:?? 30 [Router] Expanding short PSK #1
DEBUG | ??:??:?? 30 [Router] Using AES128 key!
DEBUG | ??:??:?? 30 [Router] nRF52 encrypt fr=675b8f70, num=575eb59c, numBytes=28!
DEBUG | ??:??:?? 30 [Router] enqueuing for send (id=0x575eb59c fr=0x70 to=0x05, WantAck=1, HopLim=3 Ch=0x8 encrypted priority=70)
DEBUG | ??:??:?? 30 [Router] txGood=0,rxGood=1,rxBad=0

@thebentern thebentern merged commit 9eeec6c into master Aug 1, 2023
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants