From f24a5c8dc341e841804cec4520bf42993596ea8c Mon Sep 17 00:00:00 2001 From: RocketGod <57732082+jeremyyablan@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:14:09 -0700 Subject: [PATCH] Added scripts and readme.md with link to YouTube video for further instructions --- .../LRS_Pagers/thanks_tony-tiger/README.md | 10 + .../LRS_Pagers/thanks_tony-tiger/lrs_pager.py | 124 + .../thanks_tony-tiger/lrs_pager_grc | 2181 +++++++++++++++++ .../LRS_Pagers/thanks_tony-tiger/pager_0.zip | Bin 0 -> 25326612 bytes 4 files changed, 2315 insertions(+) create mode 100644 Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/README.md create mode 100644 Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager.py create mode 100644 Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager_grc create mode 100644 Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/pager_0.zip diff --git a/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/README.md b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/README.md new file mode 100644 index 00000000..ce53f87d --- /dev/null +++ b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/README.md @@ -0,0 +1,10 @@ +# lrs +Python source code file "lrs_pager.py" for generating manchester encoded binary files. Use with LRS pagers, GNU Radio and HackRF. + +Please watch the following YouTube video for more information. + +https://www.youtube.com/watch?v=ycLLb4eVZpI + +GNU Radio file "lrs_pager.grc. Use with GNU Radio software. + +File "pager_0.zip" contains binary pager files for ringing all pagers at the same time. Restaurant ID must match pager setting. View the read me file for more info. diff --git a/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager.py b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager.py new file mode 100644 index 00000000..6e1dd91e --- /dev/null +++ b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager.py @@ -0,0 +1,124 @@ +#!/usr/bin/python + +""" +Written by: Tony Tiger 6/2019 + +This program generates manchester encoded data packets for LRS pagers and GNU Radio. + +Output file name: pager.bin + +Watch the YouTube video for more information: https://www.youtube.com/watch?v=ycLLb4eVZpI + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + +import sys +import re +import struct + + +def encode_manchester( bin_list ): + + pre = [] # create extra preambles to wake up the pager + for x in range(0,50): + pre.append('1') + pre.append('0') + + l = re.findall('.', "".join( pre + bin_list ) ) # join the preamble and the rest of the packet + + m = [] + print '\n' + print "".join(str(x) for x in l) # convert list to string + + for x in l: # convert to manchaster coding + if( x == '0'): + m.append(1) + m.append(0) + + if( x == '1'): + m.append(0) + m.append(1) + return m + + +# calculate the crc +def calculate_crc( pre, sink_word, rest_id, station_id, pager_n, alert_type ): + + l = re.findall('..', pre + sink_word + rest_id + station_id + pager_n + '0000000000' + alert_type ) + + bin_array = [] + for c in l: + bin_array.append ( (format( int(c, 16) , '08b'))) + + sum=0 + for b in bin_array: + sum += int(b , 2) + + print '\n{0} {1} {2} {3} {4} {5} {6} {7}'.format( pre, sink_word, rest_id, station_id, pager_n, '0000000000', alert_type, format( ( sum % 255), '02x' )) + bin_array.append( format( ( sum % 255), '08b') ) + return bin_array + + + + +########################################## +# main program start # +########################################## + +try: + rest_id=int(raw_input('\nEnter restaurant id 0-255: ')) +except ValueError: + print "Not a number" + +try: + pagers=(raw_input('Enter one or more pager numbers 0-1023 : ')) +except ValueError: + print "Not a number" + +pager_list = [] +pager_list = map( int, re.split('\s+',pagers)) + +print '1 Flash 30 Seconds\n2 Flash 5 Minutes\n3 Flash/Beep 5X5\n4 Beep 3 Times\n5 Beep 5 Minutes\n6 Glow 5 Minutes\n7 Glow/Vib 15 Times\n10 Flash/Vib 1 Second\n68 beep 3 times\n' + + +try: + alert_type=int(raw_input('Enter alert type: ')) +except ValueError: + print "Not a number" + + +handle = open('pager.bin', 'wb') + +data = [] +for pager_n in pager_list: + crc_out = ( calculate_crc( format(11184810, '06x') , format( 64557,'04x'), format(rest_id, '02x'), '0', format( pager_n ,'03x' ), format(alert_type, '02x') ) ) + + data = encode_manchester( crc_out ) + [ data.append(0) for x in range(0,100) ] + + print '\n'; + print "".join(str(x) for x in data) + print '\n' + + for d in data: + if d == 0: + handle.write(struct.pack('f', .0001)) + elif d == 1: + handle.write(struct.pack('f', 1)) + else: + print "Error detected in data" + sys.exit() + +handle.close() + diff --git a/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager_grc b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager_grc new file mode 100644 index 00000000..32b6c926 --- /dev/null +++ b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/lrs_pager_grc @@ -0,0 +1,2181 @@ + + + + Tue Apr 30 00:41:07 2019 + + options + + author + + + + window_size + + + + category + Custom + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 8) + + + _rotation + 0 + + + generate_options + qt_gui + + + hier_block_src_path + .: + + + id + top_block + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + thread_safe_setters + + + + title + + + + + variable_qtgui_range + + comment + + + + value + 6.268 + + + _enabled + True + + + _coordinate + (528, 248) + + + gui_hint + + + + _rotation + 0 + + + id + fm + + + label + + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + .001 + + + stop + 10 + + + rangeType + float + + + widget + counter_slider + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (216, 13) + + + _rotation + 0 + + + id + samp_rate + + + value + 2e6 + + + + analog_frequency_modulator_fc + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (560, 148) + + + _rotation + 0 + + + id + analog_frequency_modulator_fc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + sensitivity + fm + + + + blocks_complex_to_float + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (848, 81) + + + _rotation + 0 + + + id + blocks_complex_to_float_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_file_sink + + append + False + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + file + /tmp/current + + + _coordinate + (1032, 486) + + + _rotation + 0 + + + id + blocks_file_sink_0 + + + type + complex + + + unbuffered + False + + + vlen + 1 + + + + blocks_file_source + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + file + /home/tony/python/pager.bin + + + _coordinate + (40, 93) + + + _rotation + 0 + + + id + blocks_file_source_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + float + + + repeat + True + + + vlen + 1 + + + + blocks_repeat + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (352, 132) + + + _rotation + 0 + + + id + blocks_repeat_0 + + + interp + 3190 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + float + + + vlen + 1 + + + + blocks_throttle + + alias + + + + comment + + + + affinity + + + + _enabled + 2 + + + _coordinate + (112, 196) + + + _rotation + 0 + + + id + blocks_throttle_0 + + + ignoretag + True + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samples_per_second + samp_rate + + + type + float + + + vlen + 1 + + + + osmosdr_sink + + alias + + + + ant0 + + + + bb_gain0 + 20 + + + bw0 + 0 + + + corr0 + 0 + + + freq0 + 467750000+4800 + + + if_gain0 + 20 + + + gain0 + 47 + + + ant10 + + + + bb_gain10 + 20 + + + bw10 + 0 + + + corr10 + 0 + + + freq10 + 100e6 + + + if_gain10 + 20 + + + gain10 + 10 + + + ant11 + + + + bb_gain11 + 20 + + + bw11 + 0 + + + corr11 + 0 + + + freq11 + 100e6 + + + if_gain11 + 20 + + + gain11 + 10 + + + ant12 + + + + bb_gain12 + 20 + + + bw12 + 0 + + + corr12 + 0 + + + freq12 + 100e6 + + + if_gain12 + 20 + + + gain12 + 10 + + + ant13 + + + + bb_gain13 + 20 + + + bw13 + 0 + + + corr13 + 0 + + + freq13 + 100e6 + + + if_gain13 + 20 + + + gain13 + 10 + + + ant14 + + + + bb_gain14 + 20 + + + bw14 + 0 + + + corr14 + 0 + + + freq14 + 100e6 + + + if_gain14 + 20 + + + gain14 + 10 + + + ant15 + + + + bb_gain15 + 20 + + + bw15 + 0 + + + corr15 + 0 + + + freq15 + 100e6 + + + if_gain15 + 20 + + + gain15 + 10 + + + ant16 + + + + bb_gain16 + 20 + + + bw16 + 0 + + + corr16 + 0 + + + freq16 + 100e6 + + + if_gain16 + 20 + + + gain16 + 10 + + + ant17 + + + + bb_gain17 + 20 + + + bw17 + 0 + + + corr17 + 0 + + + freq17 + 100e6 + + + if_gain17 + 20 + + + gain17 + 10 + + + ant18 + + + + bb_gain18 + 20 + + + bw18 + 0 + + + corr18 + 0 + + + freq18 + 100e6 + + + if_gain18 + 20 + + + gain18 + 10 + + + ant19 + + + + bb_gain19 + 20 + + + bw19 + 0 + + + corr19 + 0 + + + freq19 + 100e6 + + + if_gain19 + 20 + + + gain19 + 10 + + + ant1 + + + + bb_gain1 + 20 + + + bw1 + 0 + + + corr1 + 0 + + + freq1 + 100e6 + + + if_gain1 + 20 + + + gain1 + 10 + + + ant20 + + + + bb_gain20 + 20 + + + bw20 + 0 + + + corr20 + 0 + + + freq20 + 100e6 + + + if_gain20 + 20 + + + gain20 + 10 + + + ant21 + + + + bb_gain21 + 20 + + + bw21 + 0 + + + corr21 + 0 + + + freq21 + 100e6 + + + if_gain21 + 20 + + + gain21 + 10 + + + ant22 + + + + bb_gain22 + 20 + + + bw22 + 0 + + + corr22 + 0 + + + freq22 + 100e6 + + + if_gain22 + 20 + + + gain22 + 10 + + + ant23 + + + + bb_gain23 + 20 + + + bw23 + 0 + + + corr23 + 0 + + + freq23 + 100e6 + + + if_gain23 + 20 + + + gain23 + 10 + + + ant24 + + + + bb_gain24 + 20 + + + bw24 + 0 + + + corr24 + 0 + + + freq24 + 100e6 + + + if_gain24 + 20 + + + gain24 + 10 + + + ant25 + + + + bb_gain25 + 20 + + + bw25 + 0 + + + corr25 + 0 + + + freq25 + 100e6 + + + if_gain25 + 20 + + + gain25 + 10 + + + ant26 + + + + bb_gain26 + 20 + + + bw26 + 0 + + + corr26 + 0 + + + freq26 + 100e6 + + + if_gain26 + 20 + + + gain26 + 10 + + + ant27 + + + + bb_gain27 + 20 + + + bw27 + 0 + + + corr27 + 0 + + + freq27 + 100e6 + + + if_gain27 + 20 + + + gain27 + 10 + + + ant28 + + + + bb_gain28 + 20 + + + bw28 + 0 + + + corr28 + 0 + + + freq28 + 100e6 + + + if_gain28 + 20 + + + gain28 + 10 + + + ant29 + + + + bb_gain29 + 20 + + + bw29 + 0 + + + corr29 + 0 + + + freq29 + 100e6 + + + if_gain29 + 20 + + + gain29 + 10 + + + ant2 + + + + bb_gain2 + 20 + + + bw2 + 0 + + + corr2 + 0 + + + freq2 + 100e6 + + + if_gain2 + 20 + + + gain2 + 10 + + + ant30 + + + + bb_gain30 + 20 + + + bw30 + 0 + + + corr30 + 0 + + + freq30 + 100e6 + + + if_gain30 + 20 + + + gain30 + 10 + + + ant31 + + + + bb_gain31 + 20 + + + bw31 + 0 + + + corr31 + 0 + + + freq31 + 100e6 + + + if_gain31 + 20 + + + gain31 + 10 + + + ant3 + + + + bb_gain3 + 20 + + + bw3 + 0 + + + corr3 + 0 + + + freq3 + 100e6 + + + if_gain3 + 20 + + + gain3 + 10 + + + ant4 + + + + bb_gain4 + 20 + + + bw4 + 0 + + + corr4 + 0 + + + freq4 + 100e6 + + + if_gain4 + 20 + + + gain4 + 10 + + + ant5 + + + + bb_gain5 + 20 + + + bw5 + 0 + + + corr5 + 0 + + + freq5 + 100e6 + + + if_gain5 + 20 + + + gain5 + 10 + + + ant6 + + + + bb_gain6 + 20 + + + bw6 + 0 + + + corr6 + 0 + + + freq6 + 100e6 + + + if_gain6 + 20 + + + gain6 + 10 + + + ant7 + + + + bb_gain7 + 20 + + + bw7 + 0 + + + corr7 + 0 + + + freq7 + 100e6 + + + if_gain7 + 20 + + + gain7 + 10 + + + ant8 + + + + bb_gain8 + 20 + + + bw8 + 0 + + + corr8 + 0 + + + freq8 + 100e6 + + + if_gain8 + 20 + + + gain8 + 10 + + + ant9 + + + + bb_gain9 + 20 + + + bw9 + 0 + + + corr9 + 0 + + + freq9 + 100e6 + + + if_gain9 + 20 + + + gain9 + 10 + + + comment + + + + affinity + + + + args + + + + _enabled + True + + + _coordinate + (1032, 353) + + + _rotation + 0 + + + id + osmosdr_sink_0 + + + type + fc32 + + + clock_source0 + + + + time_source0 + + + + clock_source1 + + + + time_source1 + + + + clock_source2 + + + + time_source2 + + + + clock_source3 + + + + time_source3 + + + + clock_source4 + + + + time_source4 + + + + clock_source5 + + + + time_source5 + + + + clock_source6 + + + + time_source6 + + + + clock_source7 + + + + time_source7 + + + + nchan + 1 + + + num_mboards + 1 + + + sample_rate + samp_rate + + + sync + + + + + qtgui_freq_sink_x + + autoscale + False + + + average + 1.0 + + + bw + samp_rate + + + alias + + + + fc + 0 + + + comment + + + + ctrlpanel + True + + + affinity + + + + _enabled + True + + + fftsize + 2048 + + + _coordinate + (1104, 78) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_freq_sink_x_0 + + + legend + True + + + alpha1 + 1.0 + + + color1 + "blue" + + + label1 + + + + width1 + 1 + + + alpha10 + 1.0 + + + color10 + "dark blue" + + + label10 + + + + width10 + 1 + + + alpha2 + 1.0 + + + color2 + "red" + + + label2 + + + + width2 + 1 + + + alpha3 + 1.0 + + + color3 + "green" + + + label3 + + + + width3 + 1 + + + alpha4 + 1.0 + + + color4 + "black" + + + label4 + + + + width4 + 1 + + + alpha5 + 1.0 + + + color5 + "cyan" + + + label5 + + + + width5 + 1 + + + alpha6 + 1.0 + + + color6 + "magenta" + + + label6 + + + + width6 + 1 + + + alpha7 + 1.0 + + + color7 + "yellow" + + + label7 + + + + width7 + 1 + + + alpha8 + 1.0 + + + color8 + "dark red" + + + label8 + + + + width8 + 1 + + + alpha9 + 1.0 + + + color9 + "dark green" + + + label9 + + + + width9 + 1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + name + "" + + + nconnections + 1 + + + showports + True + + + freqhalf + True + + + tr_chan + 0 + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_FREE + + + tr_tag + "" + + + type + float + + + update_time + 0.10 + + + wintype + firdes.WIN_BLACKMAN_hARRIS + + + ymax + 10 + + + ymin + -140 + + + + qtgui_time_sink_x + + autoscale + False + + + alias + + + + comment + + + + ctrlpanel + False + + + affinity + + + + entags + True + + + _enabled + True + + + _coordinate + (1048, 278) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_time_sink_x_0 + + + legend + True + + + alpha1 + 1.0 + + + color1 + "blue" + + + label1 + + + + marker1 + -1 + + + style1 + 1 + + + width1 + 1 + + + alpha10 + 1.0 + + + color10 + "blue" + + + label10 + + + + marker10 + -1 + + + style10 + 1 + + + width10 + 1 + + + alpha2 + 1.0 + + + color2 + "red" + + + label2 + + + + marker2 + -1 + + + style2 + 1 + + + width2 + 1 + + + alpha3 + 1.0 + + + color3 + "green" + + + label3 + + + + marker3 + -1 + + + style3 + 1 + + + width3 + 1 + + + alpha4 + 1.0 + + + color4 + "black" + + + label4 + + + + marker4 + -1 + + + style4 + 1 + + + width4 + 1 + + + alpha5 + 1.0 + + + color5 + "cyan" + + + label5 + + + + marker5 + -1 + + + style5 + 1 + + + width5 + 1 + + + alpha6 + 1.0 + + + color6 + "magenta" + + + label6 + + + + marker6 + -1 + + + style6 + 1 + + + width6 + 1 + + + alpha7 + 1.0 + + + color7 + "yellow" + + + label7 + + + + marker7 + -1 + + + style7 + 1 + + + width7 + 1 + + + alpha8 + 1.0 + + + color8 + "dark red" + + + label8 + + + + marker8 + -1 + + + style8 + 1 + + + width8 + 1 + + + alpha9 + 1.0 + + + color9 + "dark green" + + + label9 + + + + marker9 + -1 + + + style9 + 1 + + + width9 + 1 + + + name + "" + + + nconnections + 1 + + + size + 1024 + + + srate + samp_rate + + + tr_chan + 0 + + + tr_delay + 0 + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_FREE + + + tr_slope + qtgui.TRIG_SLOPE_POS + + + tr_tag + "" + + + type + float + + + update_time + 0.10 + + + ylabel + Amplitude + + + yunit + "" + + + ymax + 1 + + + ymin + -1 + + + + analog_frequency_modulator_fc_0 + blocks_complex_to_float_0 + 0 + 0 + + + analog_frequency_modulator_fc_0 + blocks_file_sink_0 + 0 + 0 + + + analog_frequency_modulator_fc_0 + osmosdr_sink_0 + 0 + 0 + + + blocks_complex_to_float_0 + qtgui_time_sink_x_0 + 1 + 0 + + + blocks_complex_to_float_0 + qtgui_freq_sink_x_0 + 0 + 0 + + + blocks_file_source_0 + blocks_throttle_0 + 0 + 0 + + + blocks_repeat_0 + analog_frequency_modulator_fc_0 + 0 + 0 + + + blocks_throttle_0 + blocks_repeat_0 + 0 + 0 + + diff --git a/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/pager_0.zip b/Sub-GHz/Restaurant_Pagers/LRS_Pagers/thanks_tony-tiger/pager_0.zip new file mode 100644 index 0000000000000000000000000000000000000000..69299fe5fb378bba2b99281af195d97fe31b2450 GIT binary patch literal 25326612 zcmaI8XH=6x*EOsNVnCw=0ZS-KAP_{5Y79LfCX~>tv`8vUxOyA!~D z;2_Zbz=3~{CF+xz@ zzfPT##$JiW84Za#Yy3JXCfepEk$FN*_ZOR(ycYkZ2y3?LJZJO{L=1%mr{x@JIQlxH z=Rqo`n2eTM+TP*({*xM#aqE28bMpB|x$;9En6MX?^j@RkB|43<8K<3$Otd7^hFoLM zrad&`FU)x@o4yV~I3E3TRZAxgdl+qn&?{+^8_h*v74K`lKWzTU=#ZPE0jSpZ@JRZX zdpsH?qV$Wn@CQLA&||xdkw-(h4pGggj&*Jtd%!w-a+Ps6a_k=jD?S`bD}pD=C%vi; zmp}WwWGCL^V%x{um>eN#pFwOVXMXMJTj@&pMz0#ma0S(1{I1t$b3;x(nWL6j7tc>x zU8#P);g4VYvZgR>%)TK!{WtEHI%H2``6JI>?_}3kwdbpEZ|ok*3wLEc*4$6#_?uJr zx5p>MV^c<8eQu_?pzqPCKUKEvj`9jhTDqO4ryOA4KX69$a~@VPgC#?k*PMd_dW8K} zMbcEnIgXoue<&5MU@QEkdqyx+u%%3EA2DsOy6J`4-5ql9i?qyLim@g&nYUpMU=nq>VY5Z}~iS`g`mT zA<@`0xvw_y@$UBVP58z)ahD4FGRzjz;w~30KVQDV%|13L#!>Y}#6F>g|Ds&Jp5V^< zk-FSekX>XezmHtr8K%Z|^wS*gN zui(=CxteIxQ)nFaas(mAH7@f8Bx(Jq1@iptXv)lLaE=i1@IGQe_j+`AgVd^Y!@