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

Get real TTN gateway ID if data arriving via a packetbroker #143

Merged
merged 1 commit into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lambda/ttn_helium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ def upload_ttn(event, context):

hotspot_telem['uploader_callsign'] = hotspot['gateway_ids']['gateway_id']

# Handle telemetry arriving via a packetbroker, and try and get the real gateway ID
if hotspot_telem['uploader_callsign'] == "packetbroker":
try:
hotspot_telem['uploader_callsign'] = hotspot['packet_broker']['forwarder_gateway_id']
except:
pass

# Frequency and modulation metadata is common to all packets
# Frequency is in Hz
hotspot_telem['frequency'] = float(payload['uplink_message']['settings']['frequency'])/1e6
Expand Down
Loading