junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
527 stars 151 forks source link

Not receiving squawk #79

Closed carvicas closed 3 years ago

carvicas commented 3 years ago

I receive all the other ADS-B messages but not the squawk ones. Are commercial planes actually emiting them or maybe in emergency cases only?

junzis commented 3 years ago

Squawk codes are not transmitted in ADS-B.

You may want to use other types of Mode S messages (DF 5 or 21), and you can use the idcode() from pyModeS to decode the squawk.

https://github.com/junzis/pyModeS#decode-identity-replies-in-df5--df21

carvicas commented 3 years ago

Thank you for the answer.

Is the message lenght 28 for all pyModeS messages (including the squawk) or only for ADS-B ones?

If the answer is yes, I suppose that "if len(msg) != 28: # wrong data length" should start all implementations to ensure (with "if pms.crc(msg) !=0: # CRC fail") that the message is ok.

junzis commented 3 years ago

Sorry for this is a late reply. Not all Mode S messages are 112 bits, some are 56 bits. See following table. https://mode-s.org/decode/content/introduction.html#tb:mode_s_formats