User Tools

Site Tools


documentation:radio2pi_workshop_content

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
documentation:radio2pi_workshop_content [2023/09/07 21:42] – created pnodedocumentation:radio2pi_workshop_content [2024/01/09 10:07] (current) – removed pnode
Line 1: Line 1:
-====== Radio2pi Workshop content ====== 
  
----- 
- 
-===== Radio2pi toolbox ===== 
- 
-A general workshop on radio broadcast with a pibox, that deconstructs all the tools used for the pibox, that can be of help to build another architecture, fork the pibox or understand better what's inside. 
- 
-==== SUMMARY ==== 
- 
-<code>    1 installation of Raspbian system on R-pi 
-    2 PI_FM_RDS 
-    3 Fm_Transmitter 
-    4 Rpitx 
-    5 Gqrx 
-    6 Rtl-Sdr 
-    7 websdr 
-    8 Espeak 
-    9 Minimodem 
-    10 DUMP1090 
-    11 How to construct a playlist in bash, to broadcast through Raspberry-PI 
-    12 How to use the input on a usb soundcard to broadcast radio : 
-    13 create a stream with cat 
-    14 usefull tool for streaming</code> 
-===== installation of Raspbian system on R-pi ===== 
- 
-==== start from scratch ==== 
- 
-Step 1: Install Raspbian system on the SDcard download the image on your computer https://www.raspberrypi.org/downloads/raspbian/ insert the sd card in your computer then follow the instructions here: https://www.raspberrypi.org/documentation/installation/installing-images/ 
- 
-Step 2 : connect to Raspberry on the same network introduce the SD card in the Raspberry pi connect ethernet cable then plug power To connect to Raspberry on the same network : Search devices connected to network on port 22 (default port for SSH connection) on macOSX : $ ifconfig You will get your network ip, ex. 192.168.1 
- 
-Then with 'nmap', find devices connected to the network with port 22 open If you don't have nmap on MacOSX, you can get it here : https://nmap.org/dist/nmap-7.12.dmg 
- 
-<code>     $ nmap -p 22 --open 192.168.1.*</code> 
-Then, find your Raspberry Pi ip on the nmap result and connect to your Raspberry on ssh for example : 
- 
-<code>     $ ssh pi@192.168.0.49</code> 
-Step 3. raspi-config, update/upgrade 
- 
-<code>   $ sudo raspi-config</code> 
-Recommended 1. change passwd (optional) 2. international > language, timezone 3. verify boot option B1 console user login 
- 
-then update the system (1 mn) 
- 
-<code>   $ sudo apt-get update</code> 
-and upgrade the system (can last a few minutes) 
- 
-<code>   $ sudo apt-get upgrade</code> 
-step 4. LIBRAIRIES install utilitaries: libavtools (avconv) sox oggfwd libsndfile1-dev 
- 
-<code>   $ sudo apt-get install libav-tools sox oggfwd libsndfile1-dev</code> 
-to see the documentation of each library: 
- 
-<code>   $ man sox 
-   $ man libav-tools ...</code> 
-===== PI_FM_RDS ===== 
- 
-installation & test PiFmRds, explore the fonctions, test with a track mp3, wav, with a stream, listening on several frequencies (limit : 88 to 108 Mhz) 
- 
-Step 1: Download PiFmRDS : 
- 
-<code>   $ mkdir /home/pi/downloads 
-   $ cd /home/pi/downloads 
-   $ wget https://github.com/ChristopheJacquet/PiFmRds/archive/master.zip 
-   $ unzip master.zip 
-   $ cd PiFmRds-master/src 
-   $ sudo make clean 
-   $ sudo make</code> 
-try pifm_rds 
- 
-<code>   $ sudo ./pi_fm_rds -freq 108 -audio sound.wav</code> 
-try a stream for ex. http://stream.p-node.org/billiejean.mp3 and adapt pi_fm_rds path to your pi it can be different 
- 
-<code>   $ avconv -i http://stream.p-node.org/billiejean.mp3 -f wav - | sudo ./pi_fm_rds -freq 108.0 -audio -</code> 
-Step 3: Copy a file from your harddrive to play it 
- 
-using scp 
- 
-check manual 
- 
-<code>   $ man scp</code> 
-basic syntax : 
- 
-from your computer (open a new terminal): 
- 
-the structure is : $ scp filepath user@ip:/path 
- 
-example: 
- 
-<code>   $ scp /home/user/Desktop/sound.wav pi@192.168.1.132:/home/pi/downloads</code> 
-be cautious when using it => it as it may erase files ! 
- 
-then from the pi terminal 
- 
-<code>    $ ls path _of_the_folder_where_your_file_is</code> 
-About RDS broadcasting: https://github.com/ChristopheJacquet/PiFmRds 
- 
-== FM_Transmitter == 
- 
-Step 1: installation and test with fm_transmitter 
- 
-<code>   $ cd /home/pi/Downloads/ 
-   $ sudo apt-get install make gcc g++ 
-   $ wget https://github.com/markondej/fm_transmitter/archive/master.zip 
-   $ unzip master.zip 
-   $ cd fm_transmitter-master 
-   $ make</code> 
-Step 2 : try 
- 
-<code>   $ sudo ./fm_transmitter -f 108 -r star_wars.wav</code> 
-from a stream read by avconv 
- 
-<code>   $ sudo apt-get install libav-tools 
-   $ avconv -i http://stream.p-node.org:80/billiejean.mp3 -ac 1 -ar 22050 -f wav - | sudo ./fm_transmitter -f 108.0 -</code> 
-FM Transmitter is more stable than PiFmRds, for streams broadcasting. There is a lot of others softwares like these ones. Let see an other one : 
- 
-===== RPITX ===== 
- 
-installation and test rpitx 
- 
-RPITX is able to broadcast on sstv, am fm etc .. from 130 kHz to 750 MHz. documentation : https://github.com/F5OEO/rpitx "all you need to do is plug in a wire antenna to Pin 12 (GPIO 18) on the GPIO port and run the PiTx software by piping in an audio file or image for SSTV." 
- 
-coderequisite : libsndfile1-dev (already installed before) 
- 
-install git 
- 
-<code>   $ sudo apt-get install git</code> 
-then install ritpx 
- 
-<code>   $ cd /home/pi/Downloads/ 
- 
-   $ git clone https://github.com/F5OEO/rpitx 
- 
-   $ cd rpitx 
- 
-   $ ./install.sh</code> 
-test riptx 
- 
-FSQ mode 
- 
-<code>   $ sudo ./testfsq.sh 
- 
-   $ sudo text fsq => change (nano testfsq.sh repalce test with helloworld for ex.)</code> 
-FM Mode broadcast on 108 
- 
-<code>   $ sudo ./testfm.sh</code> 
-AM Mode 
- 
-<code>   $ sudo ./testam.sh</code> 
-etc ... 
- 
-===== GQRX ===== 
- 
-http://gqrx.dk/ 
- 
-instlall Demo gqrx on Linux and on MacOSX > 10.9 and Raspbian or sdr# on Windows 
- 
-or for MacosX <10.9 install RTL SDR https://github.com/2013-UQ-Communication-Systems/public/wiki/Installing-RTL-SDR-in-Mac-OSX 
- 
-test codecise frequency listening (talkie walkie, radio, strange signals..). 
- 
-test GQRX for a frequencis hunting! 
- 
-Airband Radio London Control Frequencies 118.050 > 136.600 [http://www.2e0jps.com/radio/airband/control/%20http://www.pb-photos.com/radio.html%20http://www.wattisham.org.uk/genscan_feb_mar_2010.pdf http://www.2e0jps.com/radio/airband/control/ http://www.pb-photos.com/radio.html http://www.wattisham.org.uk/genscan_feb_mar_2010.pdf] 
- 
-London Center Radio Frequencies http://ukradioscanning.com/viewtopic.php?f=7&t=33 
- 
-Citizen band list & more http://www.coastalcomms.org.uk/frequency_listings.htm 
- 
-===== RTL-SDR ===== 
- 
-download & installation of rtlsdr on raspbian. interception piFM via rtlsdr. 
- 
-installation packets rtl-sdr // doc http://sdr.osmocom.org/trac/wiki/rtl-sdr 
- 
-<code>   $ sudo apt-get install rtl-sdr</code> 
-blacklist the module to make it work 
- 
-<code>   $ sudo nano /etc/modprobe.d/raspi-blacklist.conf</code> 
-add on the file content: 
- 
-<code>   blacklist dvb_usb_rtl28xxu 
-   blacklist rtl_2832 
-   blacklist rtl_2830</code> 
-then 
- 
-<code>   $ sudo reboot</code> 
-test listen FM band radio on various frequencies 
- 
-for example 
- 
-<code>   $ rtl_fm -f 89100000 -M wbfm -r 48000 - | aplay -r 48k -f S16_LE</code> 
-or 
- 
-<code>   $ rtl_fm -f 94900000 -M wbfm -r 48000 - | aplay -r 48k -f S16_LE</code> 
-use rtl_fm to catch minimodem 
- 
-<code>   $ rtl_fm -f 108e6 -M wbfm -s 352k -A fast -r 44.1k -l 0 -E deemp | AUDIODEV=hw:0,0 play -r 44.1k -t raw -e s -b 16 -c 1 -V1 -</code> 
-===== websdr ===== 
- 
-http://www.websdr.org 
- 
-WebSDR at the University of Twente, Enschede, NL http://websdr.ewi.utwente.nl:8901/ JO32KF; 417 users 0.000 - 29.160 MHzMini-Whip WebSDR in C3 Ordino - ANDORRA PRINCIPALITY - ARDAM Ham Radio Association - RX 4 pcs FuncubePro+ http://sdr.radioandorra.org:8901/ JN02SN; 34 users7.008 - 7.200 MHzHalf wave Dipole.50.000 - 50.192 MHz2 elem. Moxon NE3.610 - 3.802 MHzHalf wave Dipole.14.043 - 14.235 MHz 160m, 60m, 80m, 40m and 17m SDR's from Nantwich in Cheshire http://hackgreensdr.org:8901/ IO83RA; 46 users1.804 - 1.996 MHz204 foot long double size G5RV3.600 - 3.792 MHz 5.237 - 5.428 MHz7.008 - 7.200 MHz14.130 - 14.322 MHz18.019 - 18.211 MHz HF WebSDR, South of Russia, Volgodonsk City. (op. RW6MIT) http://websdr.net/ LN17CM; 37 users3.458 - 3.842 MHzOCF Dipole Antennas6.908 - 7.292 MHz13.983 - 14.367 MHz20.816 - 21.584 MHz WebSdr in Santa Rita do Sapucai, MG, Brasil http://py4ve.qsl.br:50000/ GG77DR; 23 users 
- 
-===== ESPEAK ===== 
- 
-installation 
- 
-<code>   $ sudo apt-get install espeak</code> 
-you can check manual : 
- 
-<code>   $ man espeak</code> 
-first test: 
- 
-<code>   $ espeak "hello world"</code> 
-change pitch : 
- 
-<code>   $ espeak -p 100 "hello world"</code> 
-broadcast voice on radio : 
- 
-<code>   $ espeak "hello" --stdout | avconv -i - -f wav - | sudo /home/pi/Downloads/fm_transmitter-master/fm_transmitter -f 108 -</code> 
-== MINIMODEM == 
- 
-installation minimodem 
- 
-<code>   $ sudo apt-get install minimodem</code> 
-you can check manual : 
- 
-<code>    $ man minimodem</code> 
-you have two configurations : 
- 
-Tx => to transmit 
- 
-Rx => to receive 
- 
-first test (transmit): 
- 
-<code>   $ echo "my first test" | minimodem --tx 100</code> 
-if it doesn't work, try before : 
- 
-<code>   $ pulseaudio --start</code> 
-write ouput to a .wav file to transmit : 
- 
-<code>   $ echo "this is a test" | minimodem --tx 100 -f /tmp/testminimodem.wav </code> 
-listen the file you just wrote : 
- 
-<code>   $ aplay /tmp/testminimodem.wav </code> 
-decode sound with microphone connected to the sound card (the --tx and --rx must be the same value) : 
- 
-<code>   $ minimodem --rx 100</code> 
-Broadcasting minimodem : 
- 
-to broacast on radio using 'echo', 'minimodem' and pi_fm_rds (you need to use '&&' to execute one command after another. 
- 
-play in loop 
- 
-<code>   $ echo "test" | minimodem -tx 100 -f /tmp/output.wav && sudo ./pi_fm_rds -freq 108 -audio /tmp/output.wav</code> 
-play once 
- 
-<code>   $ echo "t aaaaaa e aaaaaa zzz" | minimodem --tx 100 -f /tmp/test.wav && sox /tmp/test.wav -t wav - | sudo ./pi_fm_rds -freq 108.0 -audio -</code> 
-decode 
- 
-with rtl-sdr piped to sox piped to minimodem, structure is: rtlsdr > sox > minimodem --rx 100 on 108MHzFM 
- 
-examples: 
- 
-<code>   $ rtl_fm -f 108e6 -M fm -s 352k -A fast -r 44.1k -l 0 -E deemp | sox -t raw -r 44.1k -e s -b 16 -c 1 -V1 - -t wav - | minimodem -f 1 --rx 100</code> 
-<code>   $ rtl_fm -f 108000000 -M wbfm -r 48000 - | sox -t raw -r 48000 -e s -b 16 -V1 - -t wav - | minimodem -f - --rx 100D</code> 
-<code>   $ rtl_fm -f 108000000 -M wbfm -r 48000 - | sox -t raw -r 48000 -e s -b 16 - -t wav - | minimodem --rx 100 -f -</code> 
-== DUMP1090 == 
- 
-Installation of cmake & lib-usb : 
- 
-<code>   $ sudo apt-get install cmake 
- 
-   $ sudo apt-get install libusb-1.0-0-dev</code> 
-sources downloading and installation of RTL2883U : 
- 
-<code>   $ git  clone  git://git.osmocom.org/rtl-sdr.git 
-   $ cd  rtl-sdr 
-   $ mkdir  build 
-   $ cd  build 
-   $ cmake  ../ -DINSTALL_UDEV_RULES=ON 
-   $ make 
-   $ sudo  make  install 
-   $ sudo  ldconfig</code> 
-sources downloading and installation of the application dump1090 : 
- 
-<code>   $ cd 
-   $ cd Downloads 
-   $ wget https://github.com/MalcolmRobb/dump1090/archive/master.zip 
-   $ unzip master.zip 
-   $ cd dump1090-master/ 
-   $ make</code> 
-Run. : 
- 
-<code>   $ ./dump1090 --interactive</code> 
-here you can see the flights transiting 
- 
-check : http://flightradar24.com 
- 
-same command 
- 
-<code>   $ ./dump1090 --interactive --net</code> 
-then launch on chromium http://localhost:8080 
- 
-COULOIR AÉRIEN by Cécile Babiole http://babiole.net/spip.php?article107 
- 
-How to construct a playlist in bash, to broadcast through Raspberry-PI 
- 
-codepare a folder with music, such as '/home/pi/musics' 
- 
-nano = text editor 
- 
-<code> 
-   $ man nano </code> 
-edit a bash file that will be our program for radio playlist 
- 
-<code>   $ nano playlist.bash </code> 
-GNU nano 2.2.6 
- 
-File: /home/pi/playlist.bash 
- 
-<code>   while [ 1 ] 
-   do 
-       while read plst 
-       do 
-           echo "$plst" 
-           avconv -loglevel quiet -i /home/pi/panier-panio-mp3/2/"$plst" -f ogg - | sox -t ogg - -t wav - | sudo /home/pi/PiFmRds-master/src/pi_fm_rds -freq 108 -audio - > /dev/null 2>&1 
-       done < <(ls /home/pi/folder/2) 
-   done</code> 
-when script is done 
- 
-modification of the rc.local file insert bash program for execution at startup and insert some comment 
- 
-GNU nano 2.2.6<br /> 
-File: /etc/rc.local 
- 
-<code>   #!/bin/sh -e 
-   # 
-   # rc.local 
-   # 
-   # This script is executed at the end of each multiuser runlevel. 
-   # Make sure that the script will "exit 0" on success or any other 
-   # value on error. 
-   # 
-   # In order to enable or disable this script just change the execution 
-   # bits. 
-   # 
-   # By default this script does nothing. 
-    
-   # Print the IP address 
-   _IP=$(hostname -I) || true 
-   if [ "$_IP" ]; then 
-     printf "My IP address is %s\n" "$_IP" 
-   fi 
-    
-   # this is a script of a radio broadcast playlist that be executed at boot 
-   /bin/bash /home/pi/playlist.bash & 
-    
-   exit 0</code> 
-How to use the input on a usb soundcard to broadcast radio : 
- 
-First : plug your card To see if your device is recognized : 
- 
-<code>   $ dmesg</code> 
-<code>... [ 738.353160] usb 1-1.4: new full-speed USB device number 5 using dwc_otg [ 738.455413] usb 1-1.4: New USB device found, idVendor=0d8c, idProduct=000c [ 738.455440] usb 1-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 738.455458] usb 1-1.4: Product: C-Media USB Headphone Set [ 738.467788] input: C-Media USB Headphone Set as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3/0003:0D8C:000C.0001/input/input0 [ 738.523553] hid-generic 0003:0D8C:000C.0001: input,hidraw0: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-3f980000.usb-1.4/input3 [ 738.994622] usbcore: registered new interface driver snd-usb-audio</code> 
-<code>   $ arecord -l 
- 
-                List of CAPTURE Hardware Devices **** 
- 
-card 1: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio] 
- 
- Subdevices: 0/1 
- Subdevice #0: subdevice #0</code> 
-What is interresting here is : 'card 1' 'device 0' 
- 
-So to broadcast : 
- 
-<code>   $ arecord -r 44100 -D plughw:1,0 - | sudo /home/pi/Downloads/PiFmRds-master/src/pi_fm_rds -freq 108 -audio -</code> 
-To see some devices compatible with Rasperry PI / Raspbian : http://elinux.org/RPi_VerifiedPeripherals 
- 
-create a stream with cat 
- 
-coderequisite : be on the same network select a wav file on your computer and stream the file on a distant computer by using the following command structure : $ cat path/to/the/file | netcat ip_adress_of_the_distant_computer port (any port > 1024) 
- 
-example : 
- 
-<code>   $ cat /home/Downloads/sound.wav | netcat 192.168.1.127 9876</code> 
-on mac netcat = nc 
- 
-then listen to it on the computer 
- 
-<code>   $ netcat -l 9876 | aplay</code> 
-With fm_transmitter we need only one channel : 
- 
-<code>   $ netcat -l 9876 | avconv -i - -ac 1 -f wav - | sudo ./fm_transmitter -f 108 -</code> 
-OK with pifmrds : 
- 
-<code>   $ netcat -l 9876 | sudo Downloads/PiFmRds-master/src/pi_fm_rds -freq 108 -audio -</code> 
-===== usefull tool for streaming ===== 
- 
-icecast2 (server) http://icecast.org/ butt (streaming client) http://www.danielnoethen.de/ other R-pi broadcasting resource: https://github.com/search?utf8=%E2%9C%93&q=pi+fm 
documentation/radio2pi_workshop_content.1694115746.txt.gz · Last modified: 2023/09/07 21:42 by pnode