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

Identifying meteomodem m20 radiosondes & extract GNSS location #932

Merged
merged 3 commits into from
Apr 30, 2023

Conversation

joyel24
Copy link
Contributor

@joyel24 joyel24 commented Apr 29, 2023

GNSS location is ok, no altitude yet.

m20Decode

@gullradriel
Copy link
Member

The convertion for altitude looks fishy, can you elaborate about why it's 10 % not good ?

@joyel24
Copy link
Contributor Author

joyel24 commented Apr 29, 2023

The convertion for altitude looks fishy, can you elaborate about why it's 10 % not good ?

I didn't understand the original data format/units coming from the packet and how it has to be converted.
I used this to help me for this integration https://github.com/projecthorus/radiosonde_auto_rx/blob/master/demod/mod/m20mod.c but did not help me for the altitude.

So I used sondehub.org to compare altitude with my results on the portapack and made an approximative conversion in the code.
@eried If you think that it's better, I can simply disable it and decodes only latitude and longitude and check for other data later (altitude, temperature, humidity, sondeID etc.)

@joyel24
Copy link
Contributor Author

joyel24 commented Apr 29, 2023

You can find pre-release binary to flash your portapack/hackrf here to test it if you are not away from m20 launches or if you already collected some m20 :
https://github.com/joyel24/portapack-mayhem/releases/tag/c916eaf

Copy link
Member

@gullradriel gullradriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we make a clear choice over the altitude thing, then it can be merged

@@ -109,6 +111,12 @@ GPS_data Packet::get_GPS_data() const
result.lat = reader_bi_m.read(14 * 8, 32) / ((1ULL << 32) / 360.0);
result.lon = reader_bi_m.read(18 * 8, 32) / ((1ULL << 32) / 360.0);
}
else if (type_ == Type::Meteomodem_M20)
{
result.alt = ((reader_bi_m.read(8 * 8, 32) / 100) - 48) / 250 ; //Conversion of altitude is actually a bit shifted, needs to be more accurate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reading the linked decoder code, the translation would be:
result.alt = reader_bi_m.read(8 * 8, 24) / 10.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I changed from your code is that I only read 3 bytes as the alt is encoded on 3 bytes only (3 * 8 =24)
I dunno if it is compiling and I have no sonde to check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've read further, just combining the 3 bytes and divide by 10 should do it

@gullradriel
Copy link
Member

@joyel24 have you read my review message?
Could we try to make it work ?

@joyel24
Copy link
Contributor Author

joyel24 commented Apr 30, 2023

@joyel24 have you read my review message?
Could we try to make it work ?

Yes I'm gonna work on it but I wanted to allow people to decode at least geolocation. It's more than enough for radiosondes hunters that want to collect them once on the ground. And I'm not sure I will be able to decode everything.
I'm actually compiling to check if nothing is broken without altitude and once done I planned to work on decoding other data.

I think it's better for everyone :
This pull request to identify M20 and give us latitude & longitude quickly witch in my opinion is the most Important.
Later pull request to decode other data.

Of course I want to make it work, more than that, I'd like to add other data like pressure or vertical/horizontal speed for example...

@joyel24 joyel24 closed this Apr 30, 2023
@joyel24 joyel24 deleted the meteomodem-M20-radiosondes branch April 30, 2023 11:14
@gullradriel
Copy link
Member

Okay let's do it your way :-)
Starting by merging !

@joyel24
Copy link
Contributor Author

joyel24 commented Apr 30, 2023

Didn't expect changing the branch name will close PR... I'm gonna reopen this PR after working on altitude decoding or another data.

@gullradriel
Copy link
Member

Harf you deleted the branch before I merge!

@joyel24 joyel24 restored the meteomodem-M20-radiosondes branch April 30, 2023 11:24
@gullradriel
Copy link
Member

Okay

@gullradriel gullradriel reopened this Apr 30, 2023
@joyel24
Copy link
Contributor Author

joyel24 commented Apr 30, 2023

Harf you deleted the branch before I merge!

#934 You can merge this one, I will use the current PR for further work.

@gullradriel gullradriel merged commit c5579e2 into portapack-mayhem:next Apr 30, 2023
@gullradriel
Copy link
Member

Done for that. You can if you need to delete your source branch and sync your 'next'

@joyel24 joyel24 deleted the meteomodem-M20-radiosondes branch April 30, 2023 11:30
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