cyberjunky / RTL-SDR-P2000Receiver-HA

Receive P2000 messages using RTL-SDR stick and post them to Home Assistant
MIT License
23 stars 11 forks source link

goupcalls sometime missing individual capcodes #41

Open spiralshapeturtle opened 2 years ago

spiralshapeturtle commented 2 years ago

Great add-on for homeassist

group call id: 002029568 002029569 002029570 00202971 etc

I was wondering why the decoder sometimes misses the individual cap-codes behind a group call, some of them works fine as displayed in bold. Other are lacking the individual capcodes which make the python cap code filter fail:

2022-09-26 16:38:35 - (DataThread) - p2000.py - DEBUG - FLEX|2022-09-26 14:38:35|1600/2/K/A|09.092|002029568|ALN|P 2 BR gerucht Slot Zeist Zinzendorflaan Zeist 096631
2022-09-26 16:38:35 - (DataThread) - p2000.py - DEBUG - Message 'P 2 BR gerucht Slot Zeist Zinzendorflaan Zeist 096631' ignored because capcode '002029568' not found in '{'000709357': 'Zeist Kazerne', '000709353': 'Zeist Kanspiket1', '000709354': 'Zeist Kanspiket2', '000709351': 'Zeist Haakarm', '000706440': 'Bunnik', '000706445': 'Bunnik', '000706001': 'VRU Regio', '000120901': 'Lifeliner1', '001420059': 'Lifeliner2', '000923993': 'Lifeliner3'}'
2022-09-26 16:38:35 - (DataThread) - p2000.py - DEBUG - City found: Zeist

Could this be cause due to CPU power, HTOP doesn't show a heavy load.

Maybe the gain is to high and I'm oversteering the receiver front end?

FLEX|2022-09-26 14:42:48|1600/2/K/A|10.099|000923203|ALN|B2 CWZ B50 Rontgen Weg door Jonkerbos 6532SZ Nijmegen 141239 FLEX|2022-09-26 14:42:52|1600/2/K/A|10.101|002029568 001520999 001520041|ALN|A2 Stadhoudersring ZOETMR : 15141 FLEX|2022-09-26 14:43:05|1600/2/K/A|10.108|002029568|ALN|A2 (dia: ja) 12146 Rit 133406 Spaarne College Haarlem Badmintonpad HaarlemW5 FLEX|2022-09-26 14:43:05|1600/2/K/A|10.108|002029569|ALN|A2 Tilburg rit: 131331 FLEX|2022-09-26 14:43:09|1600/2/K/A|10.110|002029571|ALN|P 2 BON-06 Ass. Ambu. (til assistentie) Centrum Wonen Zorg Welzijn Hoenderloseweg Ugchelen 067144 FLEX|2022-09-26 14:43:25|1600/2/K/A|10.119|002029568 001320106 001320001|ALN|A2 Vlissingen rit: 131332 (Directe inzet: ja) FLEX|2022-09-26 14:43:35|1600/2/K/A|10.124|000127850|ALN|Ongeval Letsel Badmintonpad Haarlem

spiralshapeturtle commented 2 years ago
cd
git clone https://github.com/EliasOenal/multimon-ng.git
cd multimon-ng

mkdir build;cd build

qmake -qt=qt5 ../multimon-ng.pro
make
sudo make install

defective repo:

git clone https://github.com/Zanoroy/multimon-ng.git

After a new clone & make the flex messages are decoding 100% with all the group calls. There is something defective in the @Zanoroy repo 1.2.0. Sometimes it decodes, sometimes not.

100% decoding

FLEX|2022-10-07 06:04:39|1600/2/K/A|01.030|001400090|ALN|U bent niet langer actief in de functie Piket_BRW_Hoofdofficier 1.
FLEX|2022-10-07 06:04:39|1600/2/K/A|01.030|001400083|ALN|U bent nu actief in de functie Piket_BRW_Hoofdofficier 1.
FLEX|2022-10-07 06:04:46|1600/2/K/A|01.034|002029568 001520999 001520030|ALN|A1 Waldorpstraat SGRAVH : 15130
FLEX|2022-10-07 06:04:49|1600/2/K/A|01.036|002029569 001220939 001220499|ALN|B2 Tilburg rit: 136482
FLEX|2022-10-07 06:05:03|1600/2/K/A|01.043|002029568 001520999 001520020|ALN|A2 DP5 Westland Galgepad NAALDW VWS 15120
FLEX|2022-10-07 06:05:07|1600/2/K/A|01.045|001180000|ALN|TESTOPROEP HOOFDSYSTEEM MKOB DEN BOSCH
FLEX|2022-10-07 06:05:10|1600/2/K/A|01.047|002029568 001220632 001220499|ALN|A2 Raamsdonksveer rit: 136483
FLEX|2022-10-07 06:05:18|1600/2/K/A|01.051|000920102|ALN|A2 Heermoesstraat 6841DM Arnhem 147064
FLEX|2022-10-07 06:05:29|1600/2/K/A|01.057|000923204|ALN|B2 De Gildekamp 32e Straat 6545KX Nijmegen 147065
FLEX|2022-10-07 06:05:42|1600/2/K/A|01.064|001120441|ALN|Test
FLEX|2022-10-07 06:05:42|1600/2/K/A|01.064|000723083|ALN|A1 Hilversum 54041
FLEX|2022-10-07 06:06:12|1600/2/K/A|01.080|001133888|ALN|Ongeval wegvervoer letsel Vijfkamplaan Marathonloop Eindhoven
FLEX|2022-10-07 06:06:29|1600/2/K/A|01.089|001120132|ALN|Test
FLEX|2022-10-07 06:06:31|1600/2/K/A|01.090|002029568 000830999 000830111|ALN|Graag contact OC Apeldoorn
FLEX|2022-10-07 06:06:40|1600/2/K/A|01.095|002029568 001220628 001220499|ALN|A1 Breda rit: 136484
Zanoroy commented 2 years ago

@rodeho I don't have a 1.2.0 version. But if you grab'd the latest Master and that is where you are seeing the issue. I am happy to investigate. Please capture some raw audio you experiance the issue with and I'll take a look. Unfortunitlly I do not have a Flex Paging network close by that uses Dynamic Group Call so testing is restricted to raw data supplied by others.

Let me know if you would like me to look at it.

spiralshapeturtle commented 2 years ago

Thank @Zanoroy happy to record wav files. Every minute or second there is a groupcall.

I’ll install your repo on the test PI and create a test environment. Could you guide me how to record wav files? I have done some test but I think I rendered them to audio files.

spiralshapeturtle commented 2 years ago

Hello,

Just installed a fresh Pi with Bullseye and installed your master build, its displaying 1.2.0? That's maybe another number somehow?

The P2000 network is for 911 services, there is no battery saving within this network. The pagers looks always into every frame transmitted. If you walk chronological through the frames it should be like this:

FLEX|2022-10-08 13:42:20|1600/2/K/A|10.084|002029569 001420999 001420007|ALN|A1 AMBU 17107 Bachplein Schiedam SCHIDM bon 147008

Groupcall flow: -Frame 000.01 -> empty frame -Frame 000.02 -> short instructions to inform the pagers which capcodes are called in the following group call "capcode 001420999 001420007 read 002029569 for the alphanumeric message" -Frame 000.03 -> 002029569 -> A1 AMBU 17107 Bachplein Schiedam SCHIDM bon 147008

I extracted the faulty ones below, the individual capcodes are missing from the second frame.

FLEX|2022-10-08 13:42:03|1600/2/K/A|10.075|002029568|ALN|SPOEDAMBUP2 FLEX|2022-10-08 13:44:03|1600/2/K/A|11.011|002029568|ALN|A2 Rijnzate Magnoliastraat ALPHRN : 16156 FLEX|2022-10-08 13:44:38|1600/2/K/A|11.030|002029568|ALN|A1 Kapelle rit: 137338 (Directe inzet: ja) FLEX|2022-10-08 13:45:07|1600/2/K/A|11.045|002029568|ALN|A1 13175 Postjesweg 1062 Amsterdam 952982 FLEX|2022-10-08 13:42:03|1600/2/K/A|10.075|002029569|ALN|A2 AMBU 18171 Kerkstraat 3286AK Klaaswaal KLAASW bon 147007 FLEX|2022-10-08 13:43:05|1600/2/K/A|10.108|002029569|ALN|A2 (DIA: ja) AMBU 18197 Dadelgaarde 3344RH Hendrik-Ido-Ambacht HENDIA bon 147009 FLEX|2022-10-08 13:44:05|1600/2/K/A|11.012|002029569|ALN|SPOEDAMBU

Maybe a timing issue because sometimes it decodes well:

FLEX|2022-10-08 13:42:20|1600/2/K/A|10.084|002029569 001420999 001420007|ALN|A1 AMBU 17107 Bachplein Schiedam SCHIDM bon 147008

pi@raspberrypi:~/multimon-ng/build$ rtl_fm -f 169.65M -M fm -s 22050 | multimon-ng -a FLEX -t raw -
Found 1 device(s):
multimon-ng 1.2.0
  (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
  (C) 2012-2022 by Elias Oenal
Available demodulators: POCSAG512 POCSAG1200 POCSAG2400 FLEX FLEX_NEXT EAS UFSK1200 CLIPFSK FMSFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2 ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE_CW DUMPCSV X10 SCOPE
Enabled demodulators: FLEX
  0:  Generic, RTL2832U, SN: <cut>

Using device 0: Generic RTL2832U
Detached kernel driver
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 169903575 Hz.
Oversampling input by: 46x.
Oversampling output by: 1x.
Buffer size: 8.08ms
Exact sample rate is: 1014300.020041 Hz
Sampling at 1014300 S/s.
Output at 22050 Hz.
FLEX|2022-10-08 13:41:55|1600/2/K/A|10.071|000127850|ALN|Overval Tiberiusplein IJmuiden
FLEX|2022-10-08 13:42:03|1600/2/K/A|10.075|002029568|ALN|SPOEDAMBUP2
FLEX|2022-10-08 13:42:03|1600/2/K/A|10.075|002029569|ALN|A2 AMBU 18171 Kerkstraat 3286AK Klaaswaal KLAASW bon 147007
FLEX|2022-10-08 13:42:18|1600/2/K/A|10.083|002029568 001220649 001220499|ALN|A2 Esbeek rit: 137337 (Directe inzet: ja)
FLEX|2022-10-08 13:42:20|1600/2/K/A|10.084|002029569 001420999 001420007|ALN|A1 AMBU 17107 Bachplein Schiedam SCHIDM bon 147008
FLEX|2022-10-08 13:42:22|1600/2/K/A|10.085|002029570 000120999 000120122|ALN|A2 13122 Pruimenstraat 1033 Amsterdam 95296
FLEX|2022-10-08 13:42:38|1600/2/K/A|10.094|000820122|ALN|A2 Ambu 06122 DIA Vaassen Rit 101322
FLEX|2022-10-08 13:42:40|1600/2/K/A|10.095|001403003|ALN|GAARNE CONTACT MKB!
FLEX|2022-10-08 13:42:42|1600/2/K/A|10.096|002029568 000120999 000120111|ALN|A1 13111 Arlandaweg 1043 Amsterdam 95297
FLEX|2022-10-08 13:42:50|1600/2/K/A|10.100|001120108|ALN|A2 's-Hertogenbosch Rit: 117161
FLEX|2022-10-08 13:42:57|1600/2/K/A|10.104|001123340|ALN|A2 Eindhoven Rit: 117162
FLEX|2022-10-08 13:42:59|1600/2/K/A|10.105|002029568 001523184 001523001|ALN|A2 Rijnzate Magnoliastraat ALPHRN : 16184
FLEX|2022-10-08 13:43:01|1600/2/K/A|10.106|001120103|ALN|A2 's-Hertogenbosch Rit: 117163
FLEX|2022-10-08 13:43:05|1600/2/K/A|10.108|002029569|ALN|A2 (DIA: ja) AMBU 18197 Dadelgaarde 3344RH Hendrik-Ido-Ambacht HENDIA bon 147009
FLEX|2022-10-08 13:43:09|1600/2/K/A|10.110|001735149|ALN|Prio 1, Duiker in problemen , MISTRA,NJAbi
FLEX|2022-10-08 13:43:09|1600/2/K/A|10.110|001735069|ALN|Prio 1, Duiker in problemen , MISTRA,NJAbi
FLEX|2022-10-08 13:43:09|1600/2/K/A|10.110|001735099|ALN|Prio 1, Duiker in problemen , MISTRA,NJAbi
FLEX|2022-10-08 13:43:50|1600/2/K/A|11.004|002029568 001181849 001181848 001181840 001171849 001171802|ALN|ALARM B-PLOEG VEGHEL > (FLEX-INZET) P 2 BOB-05 BR GERUCHT MFC LEEST DE DINTEL VEGHEL 213931<5
FLEX|2022-10-08 13:43:50|1600/2/K/A|11.004|002029569 000402198 000302294|ALN|SPOEDAMBU
FLEX|2022-10-08 13:44:03|1600/2/K/A|11.011|002029568|ALN|A2 Rijnzate Magnoliastraat ALPHRN : 16156
FLEX|2022-10-08 13:44:05|1600/2/K/A|11.012|002029569|ALN|SPOEDAMBU
FLEX|2022-10-08 13:44:16|1600/2/K/A|11.018|002029568 001520999 001520042|ALN|A2 Wolverlei NOOTDP : 15142
FLEX|2022-10-08 13:44:25|1600/2/K/A|11.023|002029568 001423374 001423001 001420999|ALN|A1 (DIA: ja) AMBU 18174 Dadelgaarde 3344RH Hendrik-Ido-Ambacht HENDIA bon 147011
FLEX|2022-10-08 13:44:27|1600/2/K/A|11.024|001120124|ALN|A2 Berlicum Rit: 117164
FLEX|2022-10-08 13:44:38|1600/2/K/A|11.030|002029568|ALN|A1 Kapelle rit: 137338 (Directe inzet: ja)
FLEX|2022-10-08 13:44:59|1600/2/K/A|11.041|002029568 001420999 001420038|ALN|A2 (DIA: ja) AMBU 17138 De Vloot 3144PJ Maassluis MAASSL bon 147010
FLEX|2022-10-08 13:45:05|1600/2/K/A|11.044|000933350|ALN|Aanrijding letsel Duffeltdijk Leuth
FLEX|2022-10-08 13:45:07|1600/2/K/A|11.045|002029568|ALN|A1 13175 Postjesweg 1062 Amsterdam 952982
FLEX|2022-10-08 13:45:07|1600/2/K/A|11.045|001180000|ALN|TESTOPROEP HOOFDSYSTEEM MKOB DEN BOSCH
FLEX|2022-10-08 13:45:53|1600/2/K/A|11.070|002029568 001420999 001420027|ALN|A1 AMBU 17127 Hesseplaats Rotterdam ROTTDM bon 147012
Zanoroy commented 2 years ago

Could be a timing issue.

Its been a while since I captured audio to a raw file. And it depends on what you are using to pipe the audio into multimon. But the basic idea is instead of piping to Multimon you pipe to sox to capture the 'audio' to a file.

For example if using rtl_fm rtl_fm -d 1 -A fast -f 929.620M -M fm -E dc -s 22050 -g 50 -F 0 | sox -t raw -e signed -c 1 -b 16 -r 22050 - flex2.wav

Once captured upload the wav file and tell me the capture detail so I can match them when playing it back.

spiralshapeturtle commented 2 years ago

https://www.reddit.com/r/RTLSDR/comments/bkpwcb/comment/emizqdo/?utm_source=reddit&utm_medium=web2x&context=3

I have tried to capture a file, its quite hard because a lot of "[R82XX] PLL not locked!" messages.

rtl_fm -f 169.65M -fm -s 48k -E deemp -F 9 -l 250 - | sox -t raw -e signed -c 1 -b 16 -r 48000 - flex3.wav rate 11025

These codes should be available in the flex3.wav file https://www.dropbox.com/s/uiq6l7s42pl7bcu/flex3.wav?dl=0

FLEX|2022-10-09 09:22:20|1600/2/K/A|05.084|001420104|ALN|U bent niet langer actief in de functie Piket_VRR_Hoofd Meldkamer. FLEX|2022-10-09 09:22:35|1600/2/K/A|05.092|002029568 001320107 001320001|ALN|A2 Renesse rit: 137721 (Directe inzet: ja) FLEX|2022-10-09 09:22:38|1600/2/K/A|05.094|001120107|ALN|A2 's-Hertogenbosch Rit: 117566 FLEX|2022-10-09 09:22:50|1600/2/K/A|05.100|002029568 001420999 001420043|ALN|A1 AMBU 17143 Zoutziedersstraat 3026EL Rotterdam ROTTDM bon 147393 FLEX|2022-10-09 09:23:16|1600/2/K/A|05.114|001120115|ALN|A2 Heesch Rit: 117567 FLEX|2022-10-09 09:23:23|1600/2/K/A|05.118|002029568 001320104 001320001|ALN|A2 Burgh-Haamstede rit: 137723 FLEX|2022-10-09 09:23:46|1600/2/K/A|06.002|000723156|ALN|A1 Nagele 54493 FLEX|2022-10-09 09:23:53|1600/2/K/A|06.006|002029568 001320102 001320001|ALN|A2 Grijpskerke rit: 137725 FLEX|2022-10-09 09:23:55|1600/2/K/A|06.007|001123112|ALN|A2 Eindhoven Rit: 117568 FLEX|2022-10-09 09:24:10|1600/2/K/A|06.015|002029568 000421127 000402198|ALN|SPOEDAMBU OOSTERHAVENBRUG FLEX|2022-10-09 09:24:33|1600/2/K/A|06.027|002029568 001230275 001201999 001201953 001201565 001201547 001200688 001200044|ALN|P 1 BZB-01 BR industrie Industrieweg Moergestel 209092 209133 FLEX|2022-10-09 09:24:36|1600/2/K/A|06.029|001423285|ALN|cvd contact MKA FLEX|2022-10-09 09:25:07|1600/2/K/A|06.045|001180000|ALN|TESTOPROEP HOOFDSYSTEEM MKOB DEN BOSCH FLEX|2022-10-09 09:25:16|1600/2/K/A|06.050|002029568 001520999 001520003|ALN|A1 Hof van Brasser NOOTDP : 15103 FLEX|2022-10-09 09:25:40|1600/2/K/A|06.063|000923344|ALN|A1 de Zandkampen 5301WG Zaltbommel 148205 FLEX|2022-10-09 09:26:35|1600/2/K/A|06.092|001120101|ALN|test FLEX|2022-10-09 09:26:35|1600/2/K/A|06.092|001123109|ALN|A2 Eindhoven Rit: 117569 FLEX|2022-10-09 09:26:53|1600/2/K/A|06.102|002029568 001520999 001520044|ALN|A1 Reijerskopstraat SGRAVH : 15144 FLEX|2022-10-09 09:27:20|1600/2/K/A|06.116|000726125|ALN|A2 Amersfoort 107362 FLEX|2022-10-09 09:27:36|1600/2/K/A|06.125|002029568 000923125 000923100|ALN|A2 VWS Steenweg 4181AL Waardenburg 148207 FLEX|2022-10-09 09:27:47|1600/2/K/A|07.002|002029568 001420999 001420158|ALN|A2 (DIA: ja) AMBU 17348 Tongelaarweg 3077TB Rotterdam ROTTDM bon 147394 FLEX|2022-10-09 09:28:18|1600/2/K/A|07.019|002029568 001108898 001104799|ALN|P 2 BOB-03 BR buiten Wethouder Ebbenlaan Helmond 223231 FLEX|2022-10-09 09:28:59|1600/2/K/A|07.041|002029568 001520999 001520020|ALN|A2 Nieuwendamlaan SGRAVH : 15120 FLEX|2022-10-09 09:29:03|1600/2/K/A|07.043|002029569 000102998 000101291 000101211|ALN|P 2 BAD-01 BR container Sarphatistraat Amsterdam 133431 FLEX|2022-10-09 09:29:44|1600/2/K/A|07.065|000726115|ALN|A2 Den Dolder 107363 FLEX|2022-10-09 09:29:52|1600/2/K/A|07.069|002029568 000220119 000126999|ALN|B1 10119 Rit 139634 De Keizerskroon Julianadorp FLEX|2022-10-09 09:29:55|1600/2/K/A|07.071|000820190|ALN|A2 Ambu 06190 DIA Ermelo Rit 101579 FLEX|2022-10-09 09:29:59|1600/2/K/A|07.073|002029568 001420999 001420158|ALN|A2 (DIA: ja) AMBU 17348 Dotterlei 2906BD Capelle aan den IJssel CAPIJS bon 147395

Zanoroy commented 2 years ago

Ok, I'll give that file a go. But the minimum resample rate shouldn't be any lower than 22050. 11025 has removed a lot of data points multimon (Flex) needs.

Maybe try the following: rtl_fm -f 169.65M -fm -s 22050 -E deemp -F 9 -l 250 - | sox -t raw -e signed -c 1 -b 16 -r 22050 - flex3.wav

I'll let you know if the recording you linked works for testing.

Cheers

leejoow commented 1 year ago

Is there any progress on this issue? In an lot of calls I'm missing the capcodes.

I didn't have this problem with my previous RTLSDR dongle, I have replaced it yesterday by one from rtl-sdr.com and now I'm missing the capcodes sometimes.

spiralshapeturtle commented 1 year ago

Is there any progress on this issue? In an lot of calls I'm missing the capcodes.

I didn't have this problem with my previous RTLSDR dongle, I have replaced it yesterday by one from rtl-sdr.com and now I'm missing the capcodes sometimes.

This is another repo the guys here can’t fix that for you. What you can do as workaround is to use another repo as I mentioned here.

https://github.com/cyberjunky/RTL-SDR-P2000Receiver-HA/issues/41#issuecomment-1271148533