[Radioamateur] a 70 cm Repeater / 2 meters with a Raspberry Pi


here’s an article rather intended for the amateur radio community, but as it implements a Raspberry Pi, take the opportunity to discover unusual use that we can do.
It’s Anton (ZR6AIC) a South African amateur who is at the origin of this project describes on my blog .
It uses rpitx amateur show software created by Évariste (F5OEO), a french amateur radio.
Anton has allowed translation of my blog articles for french readers of framboise314 🙂 thanks Anton!



click on the image to get the info on levels





Attention to Regulation


implementation of this Repeater in France requires that the experimenter is an amateur radio license. This ensures an operation of the Assembly respecting the regulations in force. See local regulations for other countries. framboise314 cannot be held responsible if you use this Assembly without having the right 😉



===> translation of an article of Anton ZR6AIC < =


70 cm… 2 meters? What is this?


for the first (70 cm) this is a band of frequencies allocated to radio amateurs (codeshare). It corresponds to the frequencies between 430 and 440 MHz . There are also wireless applications, remote control, telemetry, communications of alarm, and the portable LPD (Low Power Devices). Why 70 cm? The wavelength is equal to the speed of light (c ~ 300000 km/s) divided by the frequency (f = 435 MHz). What gives in this case 300/435 = 0.68 Mr. account is good!


the second (2 meters) is the band frequencies of between 144 and 146 MHz . We calculate the wavelength in the same way: 300/144 = 2.08 meters…


a Repeater… say what?


decidedly he must explain everything… But nope, I’m just kidding, we’re here for it 😀


a Repeater is a device that receives a tape radio signals and retransmit them on another. Such devices allow traffic inter-bandes and is commonly used in amateur radio.


the shema synoptic


that’s it’s simple no? The signal on the 70 cm band is picked up by the antenna and directed to a receiver: a USB RTL – SDR. It is responsible for transforming the received signal and provide it to the entrance of a transmitter that works in 2 m and retransmits the signal on this tape. It is the Raspberry Pi who plays this role.


schema detailed



click to enlarge



you see on the shema the constituents of this Assembly. The author has added a low-pass filter which we will come back a little further. As the Raspberry Pi recreates the 144 MHz with a square wave signal, it also generates many harmonic signals ( Fourier cuckoo !) that should be deleted at best for not “pollute” the frequencies.


configuration of the Repeater


for this configuration, your Raspberry Pi must be connected to the Internet.


the configuration was made with the last OS Raspbian for Raspberry Pi downloaded from the Foundation site. Anton used a Raspberry Pi B + and has tested this configuration on a Banana Pi because he needed a hard disk to compile gnuradio for later use in SDR (Software Defined Radio).


is a RTL dongle which is responsible to receive the input signal on the 70cm band, but it is configurable on the tape amateur 2 m or 70cm. The signal of the receiver will then be demodulated and broadcast with a library of DSP simulating an FM signal and using a PIN GPIO of Raspberry Pi as transmitter.


update your Raspberry Pi.


 sudo apt - get update sudo apt - get upgrade 

are going to get coffee because it may take… awhile 😉


install the CSD application command line to access the RTL USB dongle. This RTL library allows you to demodulate FM and SSB (Single Side Band) BLU signals.


 sudo apt - get install rtl - sdr - 0.5.3 - 3 mplayer octave gnuplot gnuplot - x 11 

download the FM transmitter software from github.
Rpitx is the main software responsible for the show. It allows to transmit from:


  • IQ * .iq files (that can be generated by external as software GNU Radio ). [

  • files frequency/time * .ft (usually used to easily implement digital modes)

Installation of rpitx


 git clone https://href.li/?https://github.com/F5OEO/rpitx cd rpitx # make sure you have access to the Internet to download packages # or download them and install them manually (libsndfile1-dev and imagemagick)./install.sh

, create IQ files that will be used to test the transmitter.


SSB transmitter


. / pissb sampleaudio.wav ssbIQ.wav 

an example of script testssb.sh is included.


modulation FM


pifm converts an audio file (wav, 48 kHz, 1 channel, codec pcm_s16le) in FM narrowband (12.5khz tour) and stores the result in a file .ft. If your audio file is assumed to be in your working directory current


. / pifm sampleaudio.wav fm.ft 

connect antenna to pin 4 (a long thread of 40 cm or more depending on the value of one quarter of the wavelength. [])



you can then pass on 100 MHz (be careful to define a correct frequency to be legal)


 sudo. /rpitx RF-i fm.ft f-l - c1 100000 m 

an example of script: testfm.sh is included. Add – c1 in the file to transmit on pin 4 of the GPIO.


VFO


a VFO mode is provided to allow for precise adjustment of frequency. For example, to define a surrogate on 100 MHz (Please set a correct frequency to be legal)


 sudo. /rpitx m f 100000 VFO - c1 

we now have a transmitter that works.
Now at the turn of the RTL dongle.
Follow this tutorial https://href.li/?http://zr6aic.blogspot.co.za/2013/02/setting-up-my-raspberry-pi-as-sdr-server.html


when you have finished the installation of RTL_SDR and that you have tested it with rtl_test t , you can check what audio device your Raspberry has Pi.


 sudo aplay-l * List of PLAYBACK Hardware Devices * card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 8/8 Subdevice #0: subdevice Subdevice #1 #0: subdevice Subdevice #2 #1: subdevice Subdevice #3 #2: subdevice Subdevice #4 #3: subdevice Subdevice #5 #4: subdevice Subdevice #6 #5: subdevice Subdevice #7 #6: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices : 1/1 #0 Subdevice: subdevice #0 

now, installing a few audio utility programs to convert audio signals :


 sudo apt - get install sox libsox-fmt-all 


test to see whether it is possible to receive a broadcast of the 2 m band.


set the RTL dongle on a frequency of 145.500 Mhz and transmit a test signal.



 rtl_fm f 145500000 sudo m fm 

send a recording of mp3 file


 sox mp3 zr6aic_CQ_mono.mp3 wav r 48000-c t t 1 - | sudo. /pifm - 145.5 - c1 


Installation of ffmpeg


# create and install x 264


 git clone - depth 1 git: cd x 264 //git.videolan.org/x264. / configure--host = arm-unknown-linux-gnueabi-enable-static-disable-opencl-j 4 sudo make install make 

# Build and make of ffmpeg


 git clone - depth = 1 git : //source.ffmpeg.org/ffmpeg.git cd ffmpeg. / configure--arch armel = - target-os = linux - enable-gpl-enable-libx264-enable-nonfree make - j4 sudo make install 

install the following utilities to facilitate audio manipulation:


 sudo apt - get install libav-tools sox oggfwd libsndfile1-dev sudo apt - get install libfftw3-dev fftw3 

install csdr


 clone git https://github.com/simonyiszk/csdr.git cd git fetch git checkout make dev csdr & sudo make install 

Test of the transmitter with an audio file


(while true; do cat speech48000.raw; done) | CSDR convert_i16_f | CSDR gain_ff 700 | CSDR convert_f_samplerf 20833 | sudo rpitx - i - m RF f 145000 - c1 

turn the transmitter rpitx in listening mode TCP (substitute the IP address – bold – of your Raspberry Pi)
sending audio from the remote computer. (Using the microphone of the Linux computer)


 arecord - fS16_LE - r48000 - c1 - | NC  192.168.10.128  8011 

Test of RTL_fm (substitute the IP address – bold – of your Raspberry Pi)


 sudo rtl_fm m wbfm f 98000000 | play t raw r 24 k - are-b-16 c 1 - V1 - sudo rtl_fm m wbfm f 98000000 | NC  192.168.10.128  8011-

send the output of the RTL dongle to the transmitter (substitute the IP address – bold – of your Raspberry Pi)


 sudo rtl_sdr s 250000 f 144300000 Pei 0 - | NC - vv  192.168.10.128  8011 sudo rtl_sdr s 4800 f 144300000 Pei 0 - | NC - vv  192.168.10.128  8011 

receiver with dongle RTL


 sudo nc-l 8011 | CSDR convert_i16_f | CSDR gain_ff 8000 | CSDR convert_f_samplerf 20833 | sudo rpitx - i - m RF f 145300 - c1 

show on the 4 of the GPIO pin


 sudo rtl_fm - s48000 49.6 g-l 0 m fm f 434400000 | nc 192.168.10.128 8011-

you have a Repeater without squelch… [


to automatically start the Repeater to the boot of the Raspberry Pi


create a file and edit:


 sudo vi etc/init.d/Repeater

Add the following lines in the file and save it:


 #! / bin/sh # /home/pi/sh/run_repeater.sh # BEGIN INIT INFO # Provides: SDR repater start script # Required - Start: $remote_fs $syslog # Required - Stop: $remote_fs $syslog # Default - Start: 2 3 4 5 # Default - Stop: 0 1 6 # Short - Description: Simple script to start a program at boot # Description: simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
(# END INIT INFO # If you want a command to always run, put it here # Carry out specific functions when asked to by the system box "$1" in start) echo "Starting SDR_repeater" # run application you want to start /home/pi/sh/run_repeater.sh;
stop) echo "Stopping SDR_Repeater" # kill application you want to stop rtl_fm killall killall rpitx;
*) echo "use: /etc/init.d/Repeater stop" exit 1;

[[esac

make the executable file


 sudo chmod 755 etc/init.d/Repeater

create a file /home/pi/sh/run_repeater.sh


 vi home/pi/sh/run_repeater.sh

Add the script Repeater see above in the file so that it can be started during the boot.


 sudo rtl_fm Pei 38 - s48000 g 0-l 3 m fm f 434400000 | csdr convert_i16_f | CSDR gain_ff 12000. CSDR 20330 convert_f_samplerf | sudo rpitx - i - m RF f 145293 - c1 & 

Test the start and stop script.


start the Repeater


 sudo /etc/init.d/Repeater start 

stop the Repeater


 sudo /etc/init.d/Repeater start 

Video of the tests of the Repeater



Creating APRS transmitter




Attention!


In its implementation of origin APRX is not in conformity with the French legislation. The French regulations stipulate that all repeater stations must be identifiable in the data path. See this article from F4FXL .


Repeater APRX with Raspberry Pi


 aprs - callsign - output - "" | CSDR convert_i16_f | CSDR gain_ff 7000 | CSDR convert_f_samplerf 20833 | sudo rpitx RF-i--f 144800 m 

configured in Repeater has single line


 sudo Pei 38 - g 0-l s48000 rtl_fm 0 m fm f 434400000 | csdr convert_i16_f | CSDR gain_ff 12000. CSDR 20330 convert_f_samplerf | rpitx - i - m RF f 145293 sudo - c1 

Application GnuRadio equivalent to the version from the command line. (


1) launch rpitx so that it listens on the TCP of GnuRadio output on port 8011


 while true; do (nc-l 8011; dd if = / dev/zero bs = 4096 count = 30); done | sudo rpitx - i - m IQFLOAT f 145259 - c1 

2) throw Gnuradio-companion


 gnuradio-companion 

3) charge the RCMP file for the file wav audio to the transmitter on the port 8011



click to enlarge



you can this download GnuRadio that sends the audio file on port 8011.


the output filter


this Repeater, if you put it into operation without filter at the output, generates signals over a wide frequency range. Indeed the GPIO port goes from 0 to 1 (0v – 3, 3v) and the square shape of the signal generates many harmonics.



click to enlarge



these harmonics are not allowed by the regulations and therefore use a low pass filter to remove harmonics. Here is filter built by Anton to get rid of the harmonics. It had been described on F8BXI blog end of October.



Anton has tested this filter with the Analyzer of spectrum NWT500 , the level of harmonics should normally be lowered by about 25 db.



click to enlarge



here are some photos of the filter that was used for testing. It is mounted on a map of Veroboard. Anton plans to make a CI for the Raspberry Pi, with a small amp of 10db.



click to enlarge – filter 146 MHz made with SMD components




click to enlarge – the filter mounted on the Raspberry Pi. Still need to replace the wires by a coaxial cable.



it is also possible to test the installation with a bandpass filter:



click to enlarge



tools


Simulator
https://href.li/?http://www.electroschematics.com/835/rfsim99-download/
filter design
https://href.li/?http://tonnesoftware.com/svcfilter.html
Selection of Tori
https://href.li/?http://kitsandparts.com/tcalc.html
RFSim99
http : / / www.electroschematics.com/835/rfsim99-download/


rather reserved for the amateur radio community, this montage shows once again the flexibility of use of the Raspberry Pi. The exclusive use of the command line in Linux to realize the functions of this Repeater proves the power of this mode text 🙂


this article is a translation of an article from Anton ZR6IAC. For any question or further on this subject, please refer to the original article.


section contains scripts that may serve to those who want to test the use of the Raspberry Pi in FM transmitter (always in the respect of the regulations).


thanks to Pascal F1ULT who told me the low-pass filter, to Michel F5OZF for the info on the Repeater and Anton ZR6AIC who authorized the translation of my articles for the readers of framboise314 and kindly answered my questions via Hangout!



No comments:

Powered by Blogger.