Fixed crash after receiving empty APRS payload

master
marcel 11 months ago
parent 62484e3c52
commit f0fe632cae
  1. 21
      CHANGELOG.md
  2. 6
      aprs-mqtt-bridge.py

@ -13,10 +13,25 @@ All notable changes to this project will be documented in this file.
- First working version.
## [1.0.1] - 2023-01-14
- Changed: aprs_status (published on the MQTT broker) now returns actual state of transmision (sending, retrying, send or failed) instead if just 'ready' and 'busy'.
### Changed
- aprs_status (published on the MQTT broker) now returns actual state of transmision (sending, retrying, send or failed) instead if just 'ready' and 'busy'.
## [1.1.0] - 2023-07-08
- Added: APRS nodes can now be polled to get there actual status. An extra section in the YAML configuration file is added for this functionality.
### Added
- APRS nodes can now be polled to get there actual status. An extra section in the YAML configuration file is added for this functionality.
## [1.1.1] - 2024-01-04
- Fixed: after reconnect to MQTT broker messages from broker were not received.
### Fixed
- after reconnect to MQTT broker messages from broker were not received.
## [1.1.2] - 2024-01--8
### Fixed
- In parsePacket(string): Occasionally a bad APRS packet is received causing the program to crash with an "IndexError: list index out of range". Fix: check if index IS out of range before copying it to payload

@ -76,7 +76,11 @@ def parsePacket(string):
source = listAddress[1]
destination = listAddress[0]
digipeaters = listAddress[2:]
payload = buffer[1]
# Occasionally a bad packet is received causng the program to crash with an "IndexError: list index out of range". Fix: check if index IS out of range before copying it to payload
if len(buffer) > 1:
payload = buffer[1]
else:
payload = 'NOT VALID'
else:
# If there was an error decoding the address we return save values which will be ignored by the rest of the program
source = 'NOCALL'

Loading…
Cancel
Save