├── LICENSE
├── bladrf-waterfall24.grc
├── decode_pkt.py
├── decode_pl1167.py
├── decode_raw.py
├── packet_format.ods
└── packet_format.txt
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 henryk
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/bladrf-waterfall24.grc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Tue May 19 20:57:55 2015
5 |
6 | options
7 |
8 | id
9 | top_block
10 |
11 |
12 | _enabled
13 | True
14 |
15 |
16 | title
17 |
18 |
19 |
20 | author
21 |
22 |
23 |
24 | description
25 |
26 |
27 |
28 | window_size
29 | 1280, 1024
30 |
31 |
32 | generate_options
33 | wx_gui
34 |
35 |
36 | category
37 | Custom
38 |
39 |
40 | run_options
41 | prompt
42 |
43 |
44 | run
45 | True
46 |
47 |
48 | max_nouts
49 | 0
50 |
51 |
52 | realtime_scheduling
53 |
54 |
55 |
56 | alias
57 |
58 |
59 |
60 | _coordinate
61 | (10, 10)
62 |
63 |
64 | _rotation
65 | 0
66 |
67 |
68 |
69 | variable
70 |
71 | id
72 | fsk_deviation_hz
73 |
74 |
75 | _enabled
76 | True
77 |
78 |
79 | value
80 | 1e6
81 |
82 |
83 | alias
84 |
85 |
86 |
87 | _coordinate
88 | (80, 379)
89 |
90 |
91 | _rotation
92 | 0
93 |
94 |
95 |
96 | variable
97 |
98 | id
99 | firdes_tap
100 |
101 |
102 | _enabled
103 | True
104 |
105 |
106 | value
107 | firdes.low_pass(1, samp_rate, 0.1e6, 0.5e6, firdes.WIN_HAMMING, 6.76)
108 |
109 |
110 | alias
111 |
112 |
113 |
114 | _coordinate
115 | (248, 475)
116 |
117 |
118 | _rotation
119 | 0
120 |
121 |
122 |
123 | variable
124 |
125 | id
126 | samp_rate
127 |
128 |
129 | _enabled
130 | True
131 |
132 |
133 | value
134 | 4000000
135 |
136 |
137 | alias
138 |
139 |
140 |
141 | _coordinate
142 | (10, 170)
143 |
144 |
145 | _rotation
146 | 0
147 |
148 |
149 |
150 | variable
151 |
152 | id
153 | target_rate
154 |
155 |
156 | _enabled
157 | True
158 |
159 |
160 | value
161 | 4e6
162 |
163 |
164 | alias
165 |
166 |
167 |
168 | _coordinate
169 | (120, 171)
170 |
171 |
172 | _rotation
173 | 0
174 |
175 |
176 |
177 | variable
178 |
179 | id
180 | capture_freq
181 |
182 |
183 | _enabled
184 | True
185 |
186 |
187 | value
188 | 2.411e9
189 |
190 |
191 | alias
192 |
193 |
194 |
195 | _coordinate
196 | (16, 251)
197 |
198 |
199 | _rotation
200 | 0
201 |
202 |
203 |
204 | variable
205 |
206 | id
207 | target_freq
208 |
209 |
210 | _enabled
211 | True
212 |
213 |
214 | value
215 | 2.411e9
216 |
217 |
218 | alias
219 |
220 |
221 |
222 | _coordinate
223 | (128, 251)
224 |
225 |
226 | _rotation
227 | 0
228 |
229 |
230 |
231 | wxgui_waterfallsink2
232 |
233 | id
234 | wxgui_waterfallsink2_1
235 |
236 |
237 | _enabled
238 | False
239 |
240 |
241 | type
242 | complex
243 |
244 |
245 | title
246 | Waterfall Plot
247 |
248 |
249 | samp_rate
250 | target_rate
251 |
252 |
253 | baseband_freq
254 | target_freq
255 |
256 |
257 | dynamic_range
258 | 100
259 |
260 |
261 | ref_level
262 | 0
263 |
264 |
265 | ref_scale
266 | 2.0
267 |
268 |
269 | fft_size
270 | 512
271 |
272 |
273 | fft_rate
274 | 15
275 |
276 |
277 | average
278 | False
279 |
280 |
281 | avg_alpha
282 | 0
283 |
284 |
285 | win
286 | None
287 |
288 |
289 | win_size
290 |
291 |
292 |
293 | grid_pos
294 |
295 |
296 |
297 | notebook
298 |
299 |
300 |
301 | freqvar
302 | None
303 |
304 |
305 | alias
306 |
307 |
308 |
309 | affinity
310 |
311 |
312 |
313 | _coordinate
314 | (936, 355)
315 |
316 |
317 | _rotation
318 | 0
319 |
320 |
321 |
322 | freq_xlating_fir_filter_xxx
323 |
324 | id
325 | freq_xlating_fir_filter_xxx_0
326 |
327 |
328 | _enabled
329 | False
330 |
331 |
332 | type
333 | ccc
334 |
335 |
336 | decim
337 | int(samp_rate/target_rate)
338 |
339 |
340 | taps
341 | firdes_tap
342 |
343 |
344 | center_freq
345 | -(capture_freq-target_freq)
346 |
347 |
348 | samp_rate
349 | samp_rate
350 |
351 |
352 | alias
353 |
354 |
355 |
356 | affinity
357 |
358 |
359 |
360 | minoutbuf
361 | 0
362 |
363 |
364 | maxoutbuf
365 | 0
366 |
367 |
368 | _coordinate
369 | (248, 379)
370 |
371 |
372 | _rotation
373 | 0
374 |
375 |
376 |
377 | blocks_complex_to_mag
378 |
379 | id
380 | blocks_complex_to_mag_0
381 |
382 |
383 | _enabled
384 | False
385 |
386 |
387 | vlen
388 | 1
389 |
390 |
391 | alias
392 |
393 |
394 |
395 | affinity
396 |
397 |
398 |
399 | minoutbuf
400 | 0
401 |
402 |
403 | maxoutbuf
404 | 0
405 |
406 |
407 | _coordinate
408 | (800, 528)
409 |
410 |
411 | _rotation
412 | 0
413 |
414 |
415 |
416 | wxgui_fftsink2
417 |
418 | id
419 | wxgui_fftsink2_1
420 |
421 |
422 | _enabled
423 | False
424 |
425 |
426 | type
427 | complex
428 |
429 |
430 | title
431 | FFT Plot
432 |
433 |
434 | samp_rate
435 | target_rate
436 |
437 |
438 | baseband_freq
439 | target_freq
440 |
441 |
442 | y_per_div
443 | 10
444 |
445 |
446 | y_divs
447 | 10
448 |
449 |
450 | ref_level
451 | 0
452 |
453 |
454 | ref_scale
455 | 2.0
456 |
457 |
458 | fft_size
459 | 1024
460 |
461 |
462 | fft_rate
463 | 15
464 |
465 |
466 | peak_hold
467 | False
468 |
469 |
470 | average
471 | False
472 |
473 |
474 | avg_alpha
475 | 0
476 |
477 |
478 | win
479 | None
480 |
481 |
482 | win_size
483 |
484 |
485 |
486 | grid_pos
487 |
488 |
489 |
490 | notebook
491 |
492 |
493 |
494 | freqvar
495 | None
496 |
497 |
498 | alias
499 |
500 |
501 |
502 | affinity
503 |
504 |
505 |
506 | _coordinate
507 | (1104, 331)
508 |
509 |
510 | _rotation
511 | 0
512 |
513 |
514 |
515 | osmosdr_source
516 |
517 | id
518 | osmosdr_source_0
519 |
520 |
521 | _enabled
522 | True
523 |
524 |
525 | type
526 | fc32
527 |
528 |
529 | args
530 | bladerf=0,fpga=/usr/share/Nuand/bladeRF/hostedx40.rbf
531 |
532 |
533 | sync
534 |
535 |
536 |
537 | num_mboards
538 | 1
539 |
540 |
541 | clock_source0
542 |
543 |
544 |
545 | time_source0
546 |
547 |
548 |
549 | clock_source1
550 |
551 |
552 |
553 | time_source1
554 |
555 |
556 |
557 | clock_source2
558 |
559 |
560 |
561 | time_source2
562 |
563 |
564 |
565 | clock_source3
566 |
567 |
568 |
569 | time_source3
570 |
571 |
572 |
573 | clock_source4
574 |
575 |
576 |
577 | time_source4
578 |
579 |
580 |
581 | clock_source5
582 |
583 |
584 |
585 | time_source5
586 |
587 |
588 |
589 | clock_source6
590 |
591 |
592 |
593 | time_source6
594 |
595 |
596 |
597 | clock_source7
598 |
599 |
600 |
601 | time_source7
602 |
603 |
604 |
605 | nchan
606 | 1
607 |
608 |
609 | sample_rate
610 | samp_rate
611 |
612 |
613 | freq0
614 | capture_freq
615 |
616 |
617 | corr0
618 | 0
619 |
620 |
621 | dc_offset_mode0
622 | 0
623 |
624 |
625 | iq_balance_mode0
626 | 0
627 |
628 |
629 | gain_mode0
630 | False
631 |
632 |
633 | gain0
634 | 10
635 |
636 |
637 | if_gain0
638 | 20
639 |
640 |
641 | bb_gain0
642 | 20
643 |
644 |
645 | ant0
646 |
647 |
648 |
649 | bw0
650 | 2E6
651 |
652 |
653 | freq1
654 | 100e6
655 |
656 |
657 | corr1
658 | 0
659 |
660 |
661 | dc_offset_mode1
662 | 0
663 |
664 |
665 | iq_balance_mode1
666 | 0
667 |
668 |
669 | gain_mode1
670 | False
671 |
672 |
673 | gain1
674 | 10
675 |
676 |
677 | if_gain1
678 | 20
679 |
680 |
681 | bb_gain1
682 | 20
683 |
684 |
685 | ant1
686 |
687 |
688 |
689 | bw1
690 | 0
691 |
692 |
693 | freq2
694 | 100e6
695 |
696 |
697 | corr2
698 | 0
699 |
700 |
701 | dc_offset_mode2
702 | 0
703 |
704 |
705 | iq_balance_mode2
706 | 0
707 |
708 |
709 | gain_mode2
710 | False
711 |
712 |
713 | gain2
714 | 10
715 |
716 |
717 | if_gain2
718 | 20
719 |
720 |
721 | bb_gain2
722 | 20
723 |
724 |
725 | ant2
726 |
727 |
728 |
729 | bw2
730 | 0
731 |
732 |
733 | freq3
734 | 100e6
735 |
736 |
737 | corr3
738 | 0
739 |
740 |
741 | dc_offset_mode3
742 | 0
743 |
744 |
745 | iq_balance_mode3
746 | 0
747 |
748 |
749 | gain_mode3
750 | False
751 |
752 |
753 | gain3
754 | 10
755 |
756 |
757 | if_gain3
758 | 20
759 |
760 |
761 | bb_gain3
762 | 20
763 |
764 |
765 | ant3
766 |
767 |
768 |
769 | bw3
770 | 0
771 |
772 |
773 | freq4
774 | 100e6
775 |
776 |
777 | corr4
778 | 0
779 |
780 |
781 | dc_offset_mode4
782 | 0
783 |
784 |
785 | iq_balance_mode4
786 | 0
787 |
788 |
789 | gain_mode4
790 | False
791 |
792 |
793 | gain4
794 | 10
795 |
796 |
797 | if_gain4
798 | 20
799 |
800 |
801 | bb_gain4
802 | 20
803 |
804 |
805 | ant4
806 |
807 |
808 |
809 | bw4
810 | 0
811 |
812 |
813 | freq5
814 | 100e6
815 |
816 |
817 | corr5
818 | 0
819 |
820 |
821 | dc_offset_mode5
822 | 0
823 |
824 |
825 | iq_balance_mode5
826 | 0
827 |
828 |
829 | gain_mode5
830 | False
831 |
832 |
833 | gain5
834 | 10
835 |
836 |
837 | if_gain5
838 | 20
839 |
840 |
841 | bb_gain5
842 | 20
843 |
844 |
845 | ant5
846 |
847 |
848 |
849 | bw5
850 | 0
851 |
852 |
853 | freq6
854 | 100e6
855 |
856 |
857 | corr6
858 | 0
859 |
860 |
861 | dc_offset_mode6
862 | 0
863 |
864 |
865 | iq_balance_mode6
866 | 0
867 |
868 |
869 | gain_mode6
870 | False
871 |
872 |
873 | gain6
874 | 10
875 |
876 |
877 | if_gain6
878 | 20
879 |
880 |
881 | bb_gain6
882 | 20
883 |
884 |
885 | ant6
886 |
887 |
888 |
889 | bw6
890 | 0
891 |
892 |
893 | freq7
894 | 100e6
895 |
896 |
897 | corr7
898 | 0
899 |
900 |
901 | dc_offset_mode7
902 | 0
903 |
904 |
905 | iq_balance_mode7
906 | 0
907 |
908 |
909 | gain_mode7
910 | False
911 |
912 |
913 | gain7
914 | 10
915 |
916 |
917 | if_gain7
918 | 20
919 |
920 |
921 | bb_gain7
922 | 20
923 |
924 |
925 | ant7
926 |
927 |
928 |
929 | bw7
930 | 0
931 |
932 |
933 | freq8
934 | 100e6
935 |
936 |
937 | corr8
938 | 0
939 |
940 |
941 | dc_offset_mode8
942 | 0
943 |
944 |
945 | iq_balance_mode8
946 | 0
947 |
948 |
949 | gain_mode8
950 | False
951 |
952 |
953 | gain8
954 | 10
955 |
956 |
957 | if_gain8
958 | 20
959 |
960 |
961 | bb_gain8
962 | 20
963 |
964 |
965 | ant8
966 |
967 |
968 |
969 | bw8
970 | 0
971 |
972 |
973 | freq9
974 | 100e6
975 |
976 |
977 | corr9
978 | 0
979 |
980 |
981 | dc_offset_mode9
982 | 0
983 |
984 |
985 | iq_balance_mode9
986 | 0
987 |
988 |
989 | gain_mode9
990 | False
991 |
992 |
993 | gain9
994 | 10
995 |
996 |
997 | if_gain9
998 | 20
999 |
1000 |
1001 | bb_gain9
1002 | 20
1003 |
1004 |
1005 | ant9
1006 |
1007 |
1008 |
1009 | bw9
1010 | 0
1011 |
1012 |
1013 | freq10
1014 | 100e6
1015 |
1016 |
1017 | corr10
1018 | 0
1019 |
1020 |
1021 | dc_offset_mode10
1022 | 0
1023 |
1024 |
1025 | iq_balance_mode10
1026 | 0
1027 |
1028 |
1029 | gain_mode10
1030 | False
1031 |
1032 |
1033 | gain10
1034 | 10
1035 |
1036 |
1037 | if_gain10
1038 | 20
1039 |
1040 |
1041 | bb_gain10
1042 | 20
1043 |
1044 |
1045 | ant10
1046 |
1047 |
1048 |
1049 | bw10
1050 | 0
1051 |
1052 |
1053 | freq11
1054 | 100e6
1055 |
1056 |
1057 | corr11
1058 | 0
1059 |
1060 |
1061 | dc_offset_mode11
1062 | 0
1063 |
1064 |
1065 | iq_balance_mode11
1066 | 0
1067 |
1068 |
1069 | gain_mode11
1070 | False
1071 |
1072 |
1073 | gain11
1074 | 10
1075 |
1076 |
1077 | if_gain11
1078 | 20
1079 |
1080 |
1081 | bb_gain11
1082 | 20
1083 |
1084 |
1085 | ant11
1086 |
1087 |
1088 |
1089 | bw11
1090 | 0
1091 |
1092 |
1093 | freq12
1094 | 100e6
1095 |
1096 |
1097 | corr12
1098 | 0
1099 |
1100 |
1101 | dc_offset_mode12
1102 | 0
1103 |
1104 |
1105 | iq_balance_mode12
1106 | 0
1107 |
1108 |
1109 | gain_mode12
1110 | False
1111 |
1112 |
1113 | gain12
1114 | 10
1115 |
1116 |
1117 | if_gain12
1118 | 20
1119 |
1120 |
1121 | bb_gain12
1122 | 20
1123 |
1124 |
1125 | ant12
1126 |
1127 |
1128 |
1129 | bw12
1130 | 0
1131 |
1132 |
1133 | freq13
1134 | 100e6
1135 |
1136 |
1137 | corr13
1138 | 0
1139 |
1140 |
1141 | dc_offset_mode13
1142 | 0
1143 |
1144 |
1145 | iq_balance_mode13
1146 | 0
1147 |
1148 |
1149 | gain_mode13
1150 | False
1151 |
1152 |
1153 | gain13
1154 | 10
1155 |
1156 |
1157 | if_gain13
1158 | 20
1159 |
1160 |
1161 | bb_gain13
1162 | 20
1163 |
1164 |
1165 | ant13
1166 |
1167 |
1168 |
1169 | bw13
1170 | 0
1171 |
1172 |
1173 | freq14
1174 | 100e6
1175 |
1176 |
1177 | corr14
1178 | 0
1179 |
1180 |
1181 | dc_offset_mode14
1182 | 0
1183 |
1184 |
1185 | iq_balance_mode14
1186 | 0
1187 |
1188 |
1189 | gain_mode14
1190 | False
1191 |
1192 |
1193 | gain14
1194 | 10
1195 |
1196 |
1197 | if_gain14
1198 | 20
1199 |
1200 |
1201 | bb_gain14
1202 | 20
1203 |
1204 |
1205 | ant14
1206 |
1207 |
1208 |
1209 | bw14
1210 | 0
1211 |
1212 |
1213 | freq15
1214 | 100e6
1215 |
1216 |
1217 | corr15
1218 | 0
1219 |
1220 |
1221 | dc_offset_mode15
1222 | 0
1223 |
1224 |
1225 | iq_balance_mode15
1226 | 0
1227 |
1228 |
1229 | gain_mode15
1230 | False
1231 |
1232 |
1233 | gain15
1234 | 10
1235 |
1236 |
1237 | if_gain15
1238 | 20
1239 |
1240 |
1241 | bb_gain15
1242 | 20
1243 |
1244 |
1245 | ant15
1246 |
1247 |
1248 |
1249 | bw15
1250 | 0
1251 |
1252 |
1253 | freq16
1254 | 100e6
1255 |
1256 |
1257 | corr16
1258 | 0
1259 |
1260 |
1261 | dc_offset_mode16
1262 | 0
1263 |
1264 |
1265 | iq_balance_mode16
1266 | 0
1267 |
1268 |
1269 | gain_mode16
1270 | False
1271 |
1272 |
1273 | gain16
1274 | 10
1275 |
1276 |
1277 | if_gain16
1278 | 20
1279 |
1280 |
1281 | bb_gain16
1282 | 20
1283 |
1284 |
1285 | ant16
1286 |
1287 |
1288 |
1289 | bw16
1290 | 0
1291 |
1292 |
1293 | freq17
1294 | 100e6
1295 |
1296 |
1297 | corr17
1298 | 0
1299 |
1300 |
1301 | dc_offset_mode17
1302 | 0
1303 |
1304 |
1305 | iq_balance_mode17
1306 | 0
1307 |
1308 |
1309 | gain_mode17
1310 | False
1311 |
1312 |
1313 | gain17
1314 | 10
1315 |
1316 |
1317 | if_gain17
1318 | 20
1319 |
1320 |
1321 | bb_gain17
1322 | 20
1323 |
1324 |
1325 | ant17
1326 |
1327 |
1328 |
1329 | bw17
1330 | 0
1331 |
1332 |
1333 | freq18
1334 | 100e6
1335 |
1336 |
1337 | corr18
1338 | 0
1339 |
1340 |
1341 | dc_offset_mode18
1342 | 0
1343 |
1344 |
1345 | iq_balance_mode18
1346 | 0
1347 |
1348 |
1349 | gain_mode18
1350 | False
1351 |
1352 |
1353 | gain18
1354 | 10
1355 |
1356 |
1357 | if_gain18
1358 | 20
1359 |
1360 |
1361 | bb_gain18
1362 | 20
1363 |
1364 |
1365 | ant18
1366 |
1367 |
1368 |
1369 | bw18
1370 | 0
1371 |
1372 |
1373 | freq19
1374 | 100e6
1375 |
1376 |
1377 | corr19
1378 | 0
1379 |
1380 |
1381 | dc_offset_mode19
1382 | 0
1383 |
1384 |
1385 | iq_balance_mode19
1386 | 0
1387 |
1388 |
1389 | gain_mode19
1390 | False
1391 |
1392 |
1393 | gain19
1394 | 10
1395 |
1396 |
1397 | if_gain19
1398 | 20
1399 |
1400 |
1401 | bb_gain19
1402 | 20
1403 |
1404 |
1405 | ant19
1406 |
1407 |
1408 |
1409 | bw19
1410 | 0
1411 |
1412 |
1413 | freq20
1414 | 100e6
1415 |
1416 |
1417 | corr20
1418 | 0
1419 |
1420 |
1421 | dc_offset_mode20
1422 | 0
1423 |
1424 |
1425 | iq_balance_mode20
1426 | 0
1427 |
1428 |
1429 | gain_mode20
1430 | False
1431 |
1432 |
1433 | gain20
1434 | 10
1435 |
1436 |
1437 | if_gain20
1438 | 20
1439 |
1440 |
1441 | bb_gain20
1442 | 20
1443 |
1444 |
1445 | ant20
1446 |
1447 |
1448 |
1449 | bw20
1450 | 0
1451 |
1452 |
1453 | freq21
1454 | 100e6
1455 |
1456 |
1457 | corr21
1458 | 0
1459 |
1460 |
1461 | dc_offset_mode21
1462 | 0
1463 |
1464 |
1465 | iq_balance_mode21
1466 | 0
1467 |
1468 |
1469 | gain_mode21
1470 | False
1471 |
1472 |
1473 | gain21
1474 | 10
1475 |
1476 |
1477 | if_gain21
1478 | 20
1479 |
1480 |
1481 | bb_gain21
1482 | 20
1483 |
1484 |
1485 | ant21
1486 |
1487 |
1488 |
1489 | bw21
1490 | 0
1491 |
1492 |
1493 | freq22
1494 | 100e6
1495 |
1496 |
1497 | corr22
1498 | 0
1499 |
1500 |
1501 | dc_offset_mode22
1502 | 0
1503 |
1504 |
1505 | iq_balance_mode22
1506 | 0
1507 |
1508 |
1509 | gain_mode22
1510 | False
1511 |
1512 |
1513 | gain22
1514 | 10
1515 |
1516 |
1517 | if_gain22
1518 | 20
1519 |
1520 |
1521 | bb_gain22
1522 | 20
1523 |
1524 |
1525 | ant22
1526 |
1527 |
1528 |
1529 | bw22
1530 | 0
1531 |
1532 |
1533 | freq23
1534 | 100e6
1535 |
1536 |
1537 | corr23
1538 | 0
1539 |
1540 |
1541 | dc_offset_mode23
1542 | 0
1543 |
1544 |
1545 | iq_balance_mode23
1546 | 0
1547 |
1548 |
1549 | gain_mode23
1550 | False
1551 |
1552 |
1553 | gain23
1554 | 10
1555 |
1556 |
1557 | if_gain23
1558 | 20
1559 |
1560 |
1561 | bb_gain23
1562 | 20
1563 |
1564 |
1565 | ant23
1566 |
1567 |
1568 |
1569 | bw23
1570 | 0
1571 |
1572 |
1573 | freq24
1574 | 100e6
1575 |
1576 |
1577 | corr24
1578 | 0
1579 |
1580 |
1581 | dc_offset_mode24
1582 | 0
1583 |
1584 |
1585 | iq_balance_mode24
1586 | 0
1587 |
1588 |
1589 | gain_mode24
1590 | False
1591 |
1592 |
1593 | gain24
1594 | 10
1595 |
1596 |
1597 | if_gain24
1598 | 20
1599 |
1600 |
1601 | bb_gain24
1602 | 20
1603 |
1604 |
1605 | ant24
1606 |
1607 |
1608 |
1609 | bw24
1610 | 0
1611 |
1612 |
1613 | freq25
1614 | 100e6
1615 |
1616 |
1617 | corr25
1618 | 0
1619 |
1620 |
1621 | dc_offset_mode25
1622 | 0
1623 |
1624 |
1625 | iq_balance_mode25
1626 | 0
1627 |
1628 |
1629 | gain_mode25
1630 | False
1631 |
1632 |
1633 | gain25
1634 | 10
1635 |
1636 |
1637 | if_gain25
1638 | 20
1639 |
1640 |
1641 | bb_gain25
1642 | 20
1643 |
1644 |
1645 | ant25
1646 |
1647 |
1648 |
1649 | bw25
1650 | 0
1651 |
1652 |
1653 | freq26
1654 | 100e6
1655 |
1656 |
1657 | corr26
1658 | 0
1659 |
1660 |
1661 | dc_offset_mode26
1662 | 0
1663 |
1664 |
1665 | iq_balance_mode26
1666 | 0
1667 |
1668 |
1669 | gain_mode26
1670 | False
1671 |
1672 |
1673 | gain26
1674 | 10
1675 |
1676 |
1677 | if_gain26
1678 | 20
1679 |
1680 |
1681 | bb_gain26
1682 | 20
1683 |
1684 |
1685 | ant26
1686 |
1687 |
1688 |
1689 | bw26
1690 | 0
1691 |
1692 |
1693 | freq27
1694 | 100e6
1695 |
1696 |
1697 | corr27
1698 | 0
1699 |
1700 |
1701 | dc_offset_mode27
1702 | 0
1703 |
1704 |
1705 | iq_balance_mode27
1706 | 0
1707 |
1708 |
1709 | gain_mode27
1710 | False
1711 |
1712 |
1713 | gain27
1714 | 10
1715 |
1716 |
1717 | if_gain27
1718 | 20
1719 |
1720 |
1721 | bb_gain27
1722 | 20
1723 |
1724 |
1725 | ant27
1726 |
1727 |
1728 |
1729 | bw27
1730 | 0
1731 |
1732 |
1733 | freq28
1734 | 100e6
1735 |
1736 |
1737 | corr28
1738 | 0
1739 |
1740 |
1741 | dc_offset_mode28
1742 | 0
1743 |
1744 |
1745 | iq_balance_mode28
1746 | 0
1747 |
1748 |
1749 | gain_mode28
1750 | False
1751 |
1752 |
1753 | gain28
1754 | 10
1755 |
1756 |
1757 | if_gain28
1758 | 20
1759 |
1760 |
1761 | bb_gain28
1762 | 20
1763 |
1764 |
1765 | ant28
1766 |
1767 |
1768 |
1769 | bw28
1770 | 0
1771 |
1772 |
1773 | freq29
1774 | 100e6
1775 |
1776 |
1777 | corr29
1778 | 0
1779 |
1780 |
1781 | dc_offset_mode29
1782 | 0
1783 |
1784 |
1785 | iq_balance_mode29
1786 | 0
1787 |
1788 |
1789 | gain_mode29
1790 | False
1791 |
1792 |
1793 | gain29
1794 | 10
1795 |
1796 |
1797 | if_gain29
1798 | 20
1799 |
1800 |
1801 | bb_gain29
1802 | 20
1803 |
1804 |
1805 | ant29
1806 |
1807 |
1808 |
1809 | bw29
1810 | 0
1811 |
1812 |
1813 | freq30
1814 | 100e6
1815 |
1816 |
1817 | corr30
1818 | 0
1819 |
1820 |
1821 | dc_offset_mode30
1822 | 0
1823 |
1824 |
1825 | iq_balance_mode30
1826 | 0
1827 |
1828 |
1829 | gain_mode30
1830 | False
1831 |
1832 |
1833 | gain30
1834 | 10
1835 |
1836 |
1837 | if_gain30
1838 | 20
1839 |
1840 |
1841 | bb_gain30
1842 | 20
1843 |
1844 |
1845 | ant30
1846 |
1847 |
1848 |
1849 | bw30
1850 | 0
1851 |
1852 |
1853 | freq31
1854 | 100e6
1855 |
1856 |
1857 | corr31
1858 | 0
1859 |
1860 |
1861 | dc_offset_mode31
1862 | 0
1863 |
1864 |
1865 | iq_balance_mode31
1866 | 0
1867 |
1868 |
1869 | gain_mode31
1870 | False
1871 |
1872 |
1873 | gain31
1874 | 10
1875 |
1876 |
1877 | if_gain31
1878 | 20
1879 |
1880 |
1881 | bb_gain31
1882 | 20
1883 |
1884 |
1885 | ant31
1886 |
1887 |
1888 |
1889 | bw31
1890 | 0
1891 |
1892 |
1893 | alias
1894 |
1895 |
1896 |
1897 | affinity
1898 |
1899 |
1900 |
1901 | minoutbuf
1902 | 0
1903 |
1904 |
1905 | maxoutbuf
1906 | 0
1907 |
1908 |
1909 | _coordinate
1910 | (408, 99)
1911 |
1912 |
1913 | _rotation
1914 | 0
1915 |
1916 |
1917 |
1918 | blocks_file_sink
1919 |
1920 | id
1921 | blocks_file_sink_0
1922 |
1923 |
1924 | _enabled
1925 | False
1926 |
1927 |
1928 | file
1929 | /tmp/milight_2410500000_4M
1930 |
1931 |
1932 | type
1933 | complex
1934 |
1935 |
1936 | vlen
1937 | 1
1938 |
1939 |
1940 | unbuffered
1941 | False
1942 |
1943 |
1944 | append
1945 | True
1946 |
1947 |
1948 | alias
1949 |
1950 |
1951 |
1952 | affinity
1953 |
1954 |
1955 |
1956 | _coordinate
1957 | (1016, 227)
1958 |
1959 |
1960 | _rotation
1961 | 0
1962 |
1963 |
1964 |
1965 | wxgui_fftsink2
1966 |
1967 | id
1968 | wxgui_fftsink2_0
1969 |
1970 |
1971 | _enabled
1972 | False
1973 |
1974 |
1975 | type
1976 | complex
1977 |
1978 |
1979 | title
1980 | FFT Plot
1981 |
1982 |
1983 | samp_rate
1984 | samp_rate
1985 |
1986 |
1987 | baseband_freq
1988 | capture_freq
1989 |
1990 |
1991 | y_per_div
1992 | 10
1993 |
1994 |
1995 | y_divs
1996 | 10
1997 |
1998 |
1999 | ref_level
2000 | 0
2001 |
2002 |
2003 | ref_scale
2004 | 2.0
2005 |
2006 |
2007 | fft_size
2008 | 1024
2009 |
2010 |
2011 | fft_rate
2012 | 15
2013 |
2014 |
2015 | peak_hold
2016 | True
2017 |
2018 |
2019 | average
2020 | False
2021 |
2022 |
2023 | avg_alpha
2024 | 0
2025 |
2026 |
2027 | win
2028 | None
2029 |
2030 |
2031 | win_size
2032 |
2033 |
2034 |
2035 | grid_pos
2036 |
2037 |
2038 |
2039 | notebook
2040 |
2041 |
2042 |
2043 | freqvar
2044 | None
2045 |
2046 |
2047 | alias
2048 |
2049 |
2050 |
2051 | affinity
2052 |
2053 |
2054 |
2055 | _coordinate
2056 | (1112, 19)
2057 |
2058 |
2059 | _rotation
2060 | 0
2061 |
2062 |
2063 |
2064 | analog_quadrature_demod_cf
2065 |
2066 | id
2067 | analog_quadrature_demod_cf_0
2068 |
2069 |
2070 | _enabled
2071 | True
2072 |
2073 |
2074 | gain
2075 | [1,samp_rate/(2*math.pi*fsk_deviation_hz/8.0)][0]
2076 |
2077 |
2078 | alias
2079 |
2080 |
2081 |
2082 | affinity
2083 |
2084 |
2085 |
2086 | minoutbuf
2087 | 0
2088 |
2089 |
2090 | maxoutbuf
2091 | 0
2092 |
2093 |
2094 | _coordinate
2095 | (512, 675)
2096 |
2097 |
2098 | _rotation
2099 | 0
2100 |
2101 |
2102 |
2103 | wxgui_waterfallsink2
2104 |
2105 | id
2106 | wxgui_waterfallsink2_0
2107 |
2108 |
2109 | _enabled
2110 | False
2111 |
2112 |
2113 | type
2114 | complex
2115 |
2116 |
2117 | title
2118 | Waterfall Plot
2119 |
2120 |
2121 | samp_rate
2122 | samp_rate
2123 |
2124 |
2125 | baseband_freq
2126 | capture_freq
2127 |
2128 |
2129 | dynamic_range
2130 | 50
2131 |
2132 |
2133 | ref_level
2134 | -30
2135 |
2136 |
2137 | ref_scale
2138 | 2.0
2139 |
2140 |
2141 | fft_size
2142 | 512
2143 |
2144 |
2145 | fft_rate
2146 | 100
2147 |
2148 |
2149 | average
2150 | False
2151 |
2152 |
2153 | avg_alpha
2154 | 0
2155 |
2156 |
2157 | win
2158 | None
2159 |
2160 |
2161 | win_size
2162 | 600,1000
2163 |
2164 |
2165 | grid_pos
2166 |
2167 |
2168 |
2169 | notebook
2170 |
2171 |
2172 |
2173 | freqvar
2174 | None
2175 |
2176 |
2177 | alias
2178 |
2179 |
2180 |
2181 | affinity
2182 |
2183 |
2184 |
2185 | _coordinate
2186 | (944, 35)
2187 |
2188 |
2189 | _rotation
2190 | 0
2191 |
2192 |
2193 |
2194 | wxgui_scopesink2
2195 |
2196 | id
2197 | wxgui_scopesink2_0
2198 |
2199 |
2200 | _enabled
2201 | False
2202 |
2203 |
2204 | type
2205 | float
2206 |
2207 |
2208 | title
2209 | Scope Plot
2210 |
2211 |
2212 | samp_rate
2213 | target_rate
2214 |
2215 |
2216 | v_scale
2217 | 0
2218 |
2219 |
2220 | v_offset
2221 | 0
2222 |
2223 |
2224 | t_scale
2225 | 0
2226 |
2227 |
2228 | ac_couple
2229 | False
2230 |
2231 |
2232 | xy_mode
2233 | False
2234 |
2235 |
2236 | num_inputs
2237 | 1
2238 |
2239 |
2240 | win_size
2241 |
2242 |
2243 |
2244 | grid_pos
2245 |
2246 |
2247 |
2248 | notebook
2249 |
2250 |
2251 |
2252 | trig_mode
2253 | wxgui.TRIG_MODE_AUTO
2254 |
2255 |
2256 | y_axis_label
2257 | Counts
2258 |
2259 |
2260 | alias
2261 |
2262 |
2263 |
2264 | affinity
2265 |
2266 |
2267 |
2268 | _coordinate
2269 | (1104, 555)
2270 |
2271 |
2272 | _rotation
2273 | 0
2274 |
2275 |
2276 |
2277 | blocks_wavfile_sink
2278 |
2279 | id
2280 | blocks_wavfile_sink_0
2281 |
2282 |
2283 | _enabled
2284 | True
2285 |
2286 |
2287 | file
2288 | /tmp/milight_2411000000_4M.wav
2289 |
2290 |
2291 | nchan
2292 | 1
2293 |
2294 |
2295 | samp_rate
2296 | samp_rate
2297 |
2298 |
2299 | bits_per_sample
2300 | 16
2301 |
2302 |
2303 | alias
2304 |
2305 |
2306 |
2307 | affinity
2308 |
2309 |
2310 |
2311 | _coordinate
2312 | (1104, 667)
2313 |
2314 |
2315 | _rotation
2316 | 0
2317 |
2318 |
2319 |
2320 | osmosdr_source_0
2321 | wxgui_fftsink2_0
2322 | 0
2323 | 0
2324 |
2325 |
2326 | osmosdr_source_0
2327 | wxgui_waterfallsink2_0
2328 | 0
2329 | 0
2330 |
2331 |
2332 | osmosdr_source_0
2333 | blocks_file_sink_0
2334 | 0
2335 | 0
2336 |
2337 |
2338 | freq_xlating_fir_filter_xxx_0
2339 | wxgui_fftsink2_1
2340 | 0
2341 | 0
2342 |
2343 |
2344 | freq_xlating_fir_filter_xxx_0
2345 | wxgui_waterfallsink2_1
2346 | 0
2347 | 0
2348 |
2349 |
2350 | freq_xlating_fir_filter_xxx_0
2351 | blocks_complex_to_mag_0
2352 | 0
2353 | 0
2354 |
2355 |
2356 | blocks_complex_to_mag_0
2357 | wxgui_scopesink2_0
2358 | 0
2359 | 0
2360 |
2361 |
2362 | osmosdr_source_0
2363 | blocks_complex_to_mag_0
2364 | 0
2365 | 0
2366 |
2367 |
2368 | osmosdr_source_0
2369 | analog_quadrature_demod_cf_0
2370 | 0
2371 | 0
2372 |
2373 |
2374 | analog_quadrature_demod_cf_0
2375 | wxgui_scopesink2_0
2376 | 0
2377 | 0
2378 |
2379 |
2380 | analog_quadrature_demod_cf_0
2381 | blocks_wavfile_sink_0
2382 | 0
2383 | 0
2384 |
2385 |
2386 | osmosdr_source_0
2387 | freq_xlating_fir_filter_xxx_0
2388 | 0
2389 | 0
2390 |
2391 |
2392 |
--------------------------------------------------------------------------------
/decode_pkt.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- encoding: utf-8 -*-
3 |
4 | import sys
5 |
6 | BYTELEN = 8
7 | SYNC_LEN = 32
8 | TRAILER_LEN = 4
9 |
10 | def process_pkt(pkt):
11 | p = "".join(pkt)
12 | try:
13 | p = p[p.index("111")-3:]
14 | except ValueError:
15 | return p
16 | new_p = []
17 | syncword, p = p[:SYNC_LEN], p[SYNC_LEN:]
18 | trailer, p = p[:TRAILER_LEN], p[TRAILER_LEN:]
19 | while p:
20 | new_p.append( "".join( reversed(p[:BYTELEN]) ) )
21 | p = p[BYTELEN:]
22 | new_p = ["%02X" % int(e, 2) for e in new_p]
23 | return "%08X (%s) %s" % (int("".join(reversed(syncword)) or "0",2), "".join(trailer), " ".join(new_p))
24 | #return "%s (%s) %s" % ("".join(syncword), "".join(trailer), " ".join(new_p))
25 |
26 |
27 | if __name__ == "__main__":
28 | with file(sys.argv[1], "r") as fp:
29 | for line in fp:
30 | print process_pkt(line.strip())
31 |
--------------------------------------------------------------------------------
/decode_pl1167.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys
4 |
5 | def SPI_Frames(fp):
6 | fp = fp.__iter__()
7 | fp.next()
8 | framestart = None
9 | w_frame, r_frame = [], []
10 | frameno = None
11 | for line in fp:
12 | time, no, mosi, miso = line.split(",")
13 | if no:
14 | no = int(no, 0)
15 | if frameno != no:
16 | if frameno is not None:
17 | yield framestart, w_frame, r_frame
18 | w_frame, r_frame = [], []
19 | frameno = no
20 | framestart = float(time)
21 | w_frame.append(int(mosi, 16))
22 | r_frame.append(int(miso, 16))
23 |
24 | if frameno is not None:
25 | yield framestart, w_frame, r_frame
26 |
27 | def decode_pl1667(framestart, w_frame, r_frame):
28 | if len(w_frame) < 3:
29 | print "Invalid frame: %r" % w_frame
30 | return
31 |
32 | op = w_frame[0]
33 | reg = op & 0x7f
34 |
35 | print "%12.8f:" % framestart,
36 |
37 | if op&0x80:
38 | hi, lo = r_frame[1:3]
39 | print " Read reg %2X -> %02X %02X" % (reg, hi, lo),
40 | else:
41 | hi, lo = w_frame[1:3]
42 | if reg == 0x32:
43 | print "Write FIFO: %s" % (" ".join("%02X" % e for e in w_frame[1:])),
44 | else:
45 | print "Write reg %2X -> %02X %02X" % (reg, hi, lo),
46 |
47 |
48 | data = hi<<8 | lo
49 |
50 | if reg == 0x7:
51 | if data & (1<<8): print "start TX,",
52 | if data & (1<<7): print "start RX,",
53 | print "channel %s (%s)MHz" % (data & 0x7F, 2402+ (data &0x7F)),
54 | if reg == 0x20:
55 | print "preamble length: %i bytes," % ((data>>13)+1),
56 | print "syncword length: %i bits," % (16*( ((data>>11)&0x3) + 1)),
57 | print "trailer length: %i bits," % (2+(2*( ((data>>8)&0x7) + 1))),
58 | print "data type: %s," % ["NRZ", "Manchester", "8/10 bits", "Interleave"][ (data>>6) & 0x3],
59 | print "FEC: %s" % ["None", "FEC13", "FEC23", "Reserved"][ (data>>4) & 0x3],
60 | if reg >= 0x24 and op <= 0x27:
61 | print "syncword %i: %04X" % (op - 0x24, data),
62 | if reg == 0x29:
63 | if data & (1<<15): print "CRC on,",
64 | if data & (1<<14): print "scramble on,",
65 | if data & (1<<13): print "first byte is length,",
66 | if data & (1<<12): print "FW_TERM_TX,",
67 | if data & (1<<11): print "auto ack,",
68 | print "initial CRC data: %02X" % lo,
69 | if reg == 0x34:
70 | if data & (1<<15): print "clear FIFO TX,",
71 | print "FIFO write pointer: %i," % ((data>>8)&0x6f),
72 | if data & (1<<7): print "clear FIFO RX,",
73 | print "FIFO read pointer: %i" % ((data>>0)&0x6f),
74 |
75 | print
76 |
77 | if __name__ == "__main__":
78 | for filename in sys.argv[1:]:
79 | with file(filename, "r") as fp:
80 | for framestart, w_frame, r_frame in SPI_Frames(fp):
81 | decode_pl1667(framestart, w_frame, r_frame)
82 |
--------------------------------------------------------------------------------
/decode_raw.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- encoding: utf-8 -*-
3 |
4 | import sys, struct, collections
5 | from decode_pkt import process_pkt
6 |
7 | FMT = struct.Struct("= THRESH:
49 | strong = strong - 1
50 |
51 | if abs(v) >= THRESH:
52 | strong = strong + 1
53 |
54 | if not in_pkt:
55 | if strong >= STRONG_START:
56 | print >>sys.stderr, "Packet at %fs, delta %fms" % (time, (time - last_time)*1e3),
57 | in_pkt = True
58 | last_time = time
59 | else:
60 | if strong <= STRONG_STOP:
61 | print >>sys.stderr, "ended at %fs: %s" % (time, process_pkt("".join(pkt)))
62 | print "".join(pkt)
63 | in_pkt = False
64 | last_corr_v = 0
65 | pkt_started = False
66 | pkt = []
67 |
68 | if (pk > 0 and v <= 0) or (pk <= 0 and v > 0):
69 | pk = v
70 | if abs(v) > abs(pk):
71 | pk = v
72 |
73 | v = pk
74 |
75 | if in_pkt:
76 | if not pkt_started:
77 | corr_v = 0
78 | for i in range(CORR_LEN):
79 | corr_v = corr_v + corr_fn(i) * (ringbuf[ (ringbuf_i - i + RINGBUF_SIZE - 1)%RINGBUF_SIZE ])
80 | if last_corr_v > CORR_THRESH and corr_v < last_corr_v:
81 | pkt_started = pos
82 | sample_pos = 2
83 | decode_tmp = 0
84 | decode_v = 0
85 | dc = 0
86 | for i in range(CORR_LEN/2):
87 | dc = dc + (ringbuf[ (ringbuf_i - i + RINGBUF_SIZE - 1)%RINGBUF_SIZE ])
88 | dc = dc / float(CORR_LEN/2)
89 | last_corr_v = corr_v
90 | else:
91 | #decode_tmp = decode_tmp + v - dc
92 | decode_tmp = decode_tmp + [-THRESH, THRESH][v > dc]
93 | sample_pos = sample_pos + 1
94 | if sample_pos >= int(SAMP_RATE/DATA_RATE):
95 | decode_v = decode_tmp / sample_pos
96 | decode_tmp = 0
97 | sample_pos = sample_pos - int(SAMP_RATE/DATA_RATE)
98 | pkt.append( ["0", "1"][decode_v>0] )
99 |
100 |
101 | #print pos, v, dc, decode_v
102 |
103 | ringbuf_i = (ringbuf_i + 1) % RINGBUF_SIZE
104 | pos = pos + 1
105 | time = float(pos) / SAMP_RATE
106 |
107 |
108 | if __name__ == "__main__":
109 | with file(sys.argv[1], "rb") as fp:
110 | decode(fp)
111 |
112 |
--------------------------------------------------------------------------------
/packet_format.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryk/milight-reverse-engineering/104671f28fb09dee9c54d16df78f05751e212ba0/packet_format.ods
--------------------------------------------------------------------------------
/packet_format.txt:
--------------------------------------------------------------------------------
1 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 | 1 1 2 2 2 3 3 4 4 4 5 5 6 6 6 7 7 8 8 8 9 9 0 0 0 1 1 2 2 2 3 3 4 4 4 5 5 6 6 6 7 7 8
3 | 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0 4 8 2 6 0
4 | | PREAMBLE(3B) || SYNC (4B) ||4b||L (1B)|| Data (7B) || CRC (2B) | DECODED
5 | 0101010101…1 0x258B147A 1010 0x07 0xB0 0xF2 0xEA 0x76 0x10 0x01 0x8A 0x22 0xC5
6 | 01010101010101010101010101011110001010001101000110100100101011100000000011010100111101010111 RECONSTRUCTED
7 |
8 | 1010101010101010101111000101000110100011010010010101110000000001101010011110101011101101110000010001000000001010001010001001010001111111111111000000000000000000000000000000 RECEIVED
9 | 001001010111010100000000001010111010111100001110000000000001000000000001101100001111101000001110 RECEIVED ARDUINO
10 | 101001001010111000000000111010101111010101110000000000000000100010000000000011010101111101110000 MIRRORED ARDUINO
11 | ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
12 |
13 | |P (1B)|| BASE (4B) ||P (1B)||S0(1B)||S1(12b) || Data (9B) … ENHANCED SHOCKBURST
14 | 0x147aaaaa 0x8b 0x25 0x75 ENCODED
15 |
16 | |P (1B)|| BASE (4B) ||P (1B)|| Data (12B) … ENHANCED SHOCKBURST alt
17 | |P (1B)|| BASE (4B) ||P (1B)|| Data (11B) … ENHANCED SHOCKBURST simpl
18 | 0x8b147aaa 0x25 0x75 …
19 |
--------------------------------------------------------------------------------