portapack-mayhem / mayhem-firmware

Custom firmware for the HackRF+PortaPack H1/H2
GNU General Public License v3.0
3.02k stars 519 forks source link

Radiosonde M20 additional params #1948

Open voxo22 opened 4 months ago

voxo22 commented 4 months ago

Description of the feature you're suggesting.

Hi, is it possible to add temp, humidity, pressure, batt, etc params to existing ones for Meteomodem M20? Thank you!

Anything else?

No response

joyel24 commented 3 months ago

Hello @voxo22,

I added the feature to identify & decode M20 coordinate and altitude because this was the only things needed to chase them and didn't really care about temp/hum/pressure/Vbat...

If you wish to give me a bounty to add this feature I can do it for you.

voxo22 commented 3 months ago

How much would you like for that and also for adding detection for the DFM sonde? I'll see accordingly

joyel24 commented 3 months ago

Unfortunately I won't be able to work on decoding DFM as there isn't such a sonde in my country.

For M20, It depends on you how much you want to offer for this feature ?

voxo22 commented 3 months ago

Hm, I have no idea how much effort/time can this take. 20€? I have DFM 17 sonde here, I can share IQ file with you

joyel24 commented 3 months ago

I don't think I have enough skills to reverse it only with an IQ file. Would be easier if I had a 2nd hackrf but it's not the case...

I can start to work on decoding other data from M20 if the ammount you wrote is ok for you without DFM17 ?

voxo22 commented 3 months ago

ok, I understand. Yes, the amount for M20 decoding is ok for me, if it's ok for you....

voxo22 commented 3 months ago

I think you should definitely consider buying 2nd hackrf to comfortably simulate any recorded signal ;-)

voxo22 commented 2 months ago

@joyel24 hi, any update? Do you think it is doable?

voxo22 commented 1 month ago

@gullradriel @joyel24 I have successfuly made LOG decoder (TEMP, HUMIDITY, PRESSURE, BAT_VOLTAGE) for this M20 sonde, so now I can support direct sonde_packet.cpp code update. I can post it here, can you please move it then to original code and compile? I am too lazy to do that :-/

joyel24 commented 1 month ago

@gullradriel @joyel24 I have successfuly made LOG decoder (TEMP, HUMIDITY, PRESSURE, BAT_VOLTAGE) for this M20 sonde, so now I can support direct sonde_packet.cpp code update. I can post it here, can you please move it then to original code and compile? I am too lazy to do that :-/

Sorry, at lot busy... I don't know if you still need it, I did not understood well your last comment. What do you mean by you made log decoder ? If you've been able to do it, why don't you open PR ?

voxo22 commented 1 month ago

@joyel24 I have made it as webpage in PHP. M20 sonde has very easy-to-decode bitstream, so I think adding missing params to sonde_packet.cpp is quite easy. But I am not familiar with C++ so much plus I have no compilers installed, so if you provide me with the way how to modify/add the code in this repo, I can do it. Who will test it then (and make final firmware release)?

Or, you can read my code for M20 (attached) and copy the parts, which are about decoding batt voltage, temp, humidity, serial number and gps time. It would be even so nice to have all measured values in the log, in readable form (so I would not have to translate it from the hex string, as I do it now) M20-RS41.zip

voxo22 commented 1 month ago

@joyel24 and one more thing would be nice: Auto-sync of the portapack-clock based on real GPS time from the radiosonde. I have this parameter decoded for both M20 and RS41 (see variable $gpx in my code).

gullradriel commented 1 month ago

Nice, we have to make something with this

joyel24 commented 1 month ago

Last light I started to work with temperature. I had troubles using my docker building image but I've been able to get the temperature with a caltulator using the formula in the radiosonde_auto_rx project.

I fixed my old docker image, then I've just built this firmware that normally decodes temperature, but I'm can't check because I have nothing actually that can decode temp of the M20 to check if it's matching.

The bin is here: https://github.com/joyel24/portapack-mayhem/releases/download/temp/portapack-h1_h2-mayhem.bin

voxo22 commented 1 month ago

@joyel24 I have tried your bin. There is temp displayed, but, in comparison with the log, there are kind of weird values. Normally, now is 20.3°C, radiosonde app showed 19.6. When I touched the sensor, there is pretty curve up to 33°C and down in the log, app shows still 19.6. There was one more value, 22.3 in the app, but it seems like only these two values are possible, nothing else.

joyel24 commented 1 month ago

Yep looks like temp were good but with big steps. Added .0 to numbers and it looks better now : https://github.com/joyel24/portapack-mayhem/releases/download/temp/portapack-h1_h2-mayhem.bin

I sill have nothing to compare but I used fridge and freezer witch gave me 5.8 (top of fridge) and -14.6. I got 20.6 indoor and 20.4 outdoor where online wheather tells it's 20. It seems to be not far from reality.

voxo22 commented 1 month ago

Yep, granularity of the value is now ok. But you definitely compute temp from the wrong parameter. You use get_Tntc2 function (see lines from 636 in attached zip), instead of get_Temp function (see lines from 564). Thats why outer temp sensor does not respond to my hand touch. I mean get_Tntc2 is kind of temp measurement, which use internal SMD sensor or some other magic to acquire data, but definitely not outer temp sensor. Measurement is then much slower and low dynamic compared to outer sensor. c_m20mod.zip

voxo22 commented 2 weeks ago

@joyel24 Hi, do you think it is possible to finalize the code in short time? M20 also supports air pressure [hPa] data, so all three of them (temp/rH/pressure) could be displayed simultaneously. if needed, please use excerpt from the c_m20mod.zip (c++) above.