From a74d0e5167362f741f06ab7be25b591fd3196f69 Mon Sep 17 00:00:00 2001 From: Joel M Date: Sun, 30 Apr 2023 13:59:21 +0200 Subject: [PATCH 1/3] altitude 3 bytes --- firmware/common/sonde_packet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/common/sonde_packet.cpp b/firmware/common/sonde_packet.cpp index b857b12c0..66f9034e0 100644 --- a/firmware/common/sonde_packet.cpp +++ b/firmware/common/sonde_packet.cpp @@ -113,7 +113,7 @@ GPS_data Packet::get_GPS_data() const } else if (type_ == Type::Meteomodem_M20) { - result.alt = 0; //((reader_bi_m.read(8 * 8, 32) / 100) - 48) / 250 ; //Disable innacurate altitude for the moment. + result.alt = result.alt = reader_bi_m.read(8 * 3, 24) / 10 ; // ((reader_bi_m.read(8 * 8, 32) / 100) - 48) / 250 ; result.lat = reader_bi_m.read(28 * 8, 32) / 1000000.0 ; //https://raw.githubusercontent.com/projecthorus/radiosonde_auto_rx/master/demod/mod/m20mod.c result.lon = reader_bi_m.read(32 * 8, 32) / 1000000.0 ; } From 7139abb9470cda79be680965f5a0ef4657b510ce Mon Sep 17 00:00:00 2001 From: Joel M Date: Mon, 1 May 2023 16:54:29 +0200 Subject: [PATCH 2/3] alt divided by 100 --- firmware/common/sonde_packet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/common/sonde_packet.cpp b/firmware/common/sonde_packet.cpp index 66f9034e0..e4b8caedc 100644 --- a/firmware/common/sonde_packet.cpp +++ b/firmware/common/sonde_packet.cpp @@ -113,7 +113,7 @@ GPS_data Packet::get_GPS_data() const } else if (type_ == Type::Meteomodem_M20) { - result.alt = result.alt = reader_bi_m.read(8 * 3, 24) / 10 ; // ((reader_bi_m.read(8 * 8, 32) / 100) - 48) / 250 ; + result.alt = reader_bi_m.read(8 * 3, 24) / 100.0 ; // ((reader_bi_m.read(8 * 8, 32) / 100) - 48) / 250 ; result.lat = reader_bi_m.read(28 * 8, 32) / 1000000.0 ; //https://raw.githubusercontent.com/projecthorus/radiosonde_auto_rx/master/demod/mod/m20mod.c result.lon = reader_bi_m.read(32 * 8, 32) / 1000000.0 ; } From d48e25167f5d769ed946291f907d782b51f7fc21 Mon Sep 17 00:00:00 2001 From: joyel24 Date: Wed, 3 May 2023 05:37:31 +0200 Subject: [PATCH 3/3] fix altitude inaccuracy --- firmware/common/sonde_packet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/common/sonde_packet.cpp b/firmware/common/sonde_packet.cpp index e4b8caedc..7842e994f 100644 --- a/firmware/common/sonde_packet.cpp +++ b/firmware/common/sonde_packet.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2017 Furrtek + * Early 2023 joyel24 added meteomodem M20 support * * This file is part of PortaPack. * @@ -113,9 +114,9 @@ GPS_data Packet::get_GPS_data() const } else if (type_ == Type::Meteomodem_M20) { - result.alt = reader_bi_m.read(8 * 3, 24) / 100.0 ; // ((reader_bi_m.read(8 * 8, 32) / 100) - 48) / 250 ; - result.lat = reader_bi_m.read(28 * 8, 32) / 1000000.0 ; //https://raw.githubusercontent.com/projecthorus/radiosonde_auto_rx/master/demod/mod/m20mod.c - result.lon = reader_bi_m.read(32 * 8, 32) / 1000000.0 ; + result.alt = reader_bi_m.read(8 * 8, 24) / 100.0 ; // <| + result.lat = reader_bi_m.read(28 * 8, 32) / 1000000.0 ; // <| Inspired by https://raw.githubusercontent.com/projecthorus/radiosonde_auto_rx/master/demod/mod/m20mod.c + result.lon = reader_bi_m.read(32 * 8, 32) / 1000000.0 ; // <| } else if (type_ == Type::Vaisala_RS41_SG) {