2 Commits

Author SHA1 Message Date
marcel
b4f4fc351f Fixed crash after receiving empty APRS payload 2024-01-08 10:27:41 +01:00
marcel
99bad68439 Filters out digital status bit messages 2023-12-20 12:25:50 +01:00
3 changed files with 40 additions and 4 deletions

View File

@@ -10,8 +10,23 @@ All notable changes to this project will be documented in this file.
Security : in case of vulnerabilities.
## [1.0.0] - 2023-12-08
First working version.
- First working version.
## [1.1.0] - 2023-12-18
Added: AX.25 support. Telemetry is now received directly from the AX.25 stack.
Removed: Telemetry from CSV file is removed in favour of the AX.25 stack
### Added:
- AX.25 support. Telemetry is now received directly from the AX.25 stack.
### Removed:
- Telemetry from CSV file is removed in favour of the AX.25 stack
## [1.1.1] - 2023-12-20
### Fixed:
- Filters out digital status bit messages (send by node when given comand 06). This command is never issued by this program. But other programs might do. Tese messages were interpreted as telemetry data. But not any more.
## [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

View File

@@ -181,7 +181,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'
@@ -295,6 +299,15 @@ def process_message(source, ax_port, payload, mqtt_client):
for field in values:
if not is_float(field):
return 0
# One anoying thing of the PE1RXF telemetry standard is that there is also a message containing the status of the output bits.
# These messages are interpreted as valid telemetry data by this program. The message is send after a '06' command. This program
# does not request this message, but another program might. So we have to filter these messages output
if len(values[0]) == 5:
allowed = '0' + '1'
# Removes from the original string all the characters that are allowed, leaving us with a set containing either a) nothing, or b) the #offending characters from the string:'
if not set(values[0]) - set(allowed):
print ("Probably digital status bits. Ignore.")
return 0
# Check if number of teleemtry values and number of descriptions in yml file are the same. If not make then the same by appending to the shorted list.
nr_of_values = len(values)
@@ -373,5 +386,7 @@ def run():
if __name__ == '__main__':
#sys.stdout = sys.stderr = open('debug.log', 'w')
sys.stdout = sys.stderr = open('/home/marcel/aprs_telemetry_to_mqtt_debug.log', 'w')
run()

View File

@@ -25,3 +25,9 @@ topics:
- voltage
- power
- temperature
- name: wx_workshop
call: PE1RXF-6
ax_port: all
description:
- temperature
- humidity