====== Autoreplicant π-box - installation guide ====== // page en cours / documentation in construction // ---- {{ :documentation:piksel-schema.jpg?nolink |}} **Autoreplicant** is a program that scans all the files on the π-box, and transfer them by audio using minimodem, the packet transfer is routed to the audio output of the pibox, so you can choose to use stream, radio or line out, or all of them together. Another raspberry can use the reception script, listen to the audio, and will be able to duplicate the π-box on this new host. **coderequisites** : the installation requires two raspberry pis. One that transmits, and one that receives the packets, and a radio if you transmit through FM. - a functional π-box for the transmission, - a minijack audio cable for the transmission, - a second raspberry pi for the reception, - a radio and/or internet. ===== Step 1. Setup the transmitter node - on the π-box ===== The transmitter has to be set on a working π-box. If you need to build one, refer to the [[../what-is-a-pibox|π-box documentation page]]. ==== Install minimodem ==== Then, connect in ssh to the π-box and install minimodem. - To find π-box ip address, check it on the top of its configuration page. $ sudo apt-get install minimodem ==== Set the script to scan the π-box and transmits the files to minimodem ==== Download the transmission scripts here ! [transmission.zip](transmission.zip) - launchrepicate.sh - minimodemTXaudio.sh You can put the scripts either via ssh/scp, or copy them directly on the π-box sd card in the /home/pi/ or create them with nano, and copy paste the content below : The sending script is to be put at: /home/pi/ $ cd /home/pi Create the script that scans the files and send them to minimodem : $ nano launchrepicate.sh Copy the script: #!/bin/bash ###################################################################### # find all files of the os and send 2 minimodem one by one # ###################################################################### sleep 3 while true do find / -type d \( -path /proc -o -path /sys -o -path /tmp \) -prune -o -exec ./minimodemTXaudio.sh {} + done Save and quit the file. Transform launchrepicate.sh into an executable sudo chmod +x /home/pi/launchrepicate.sh ==== Set the Minimodem script that transmit the file name and its content ==== Create the file called minimodemTXaudio.sh : nano minimodemTXaudio.sh then copy the following script : #!/bin/bash ########################################################################## # minimodemTXaudio pass any type of document to binary and then to Pi audio internal out # ########################################################################## echo $(basename "$1") |tee /dev/tty1 | minimodem -q -8 --tx --alsa=plughw:0,0 100 sleep 1 cat "$1" | pv -l -L 1 -q |tee /dev/tty1 | minimodem -q -8 --tx --alsa=plughw:0,0 200 exit 0 Save and quit the file. The command pv allow to read slowly the result of the cat command line by line, tee allow to show on screen - console /dev/tty1 (see which console is used ) who and send it to minimodem at the same time Transform minimodemTXaudio.sh into an executable sudo chmod +x /home/pi/minimodemTXaudio.sh ==== Startup script ==== you have to modify the rc.local file nano /etc/rc.local then modify as follow /usr/bin/python3 /home/pi/pibox_V2/go.py 2> /home/pi/pibox_V2/error_log.txt >/dev/null & cd /home/pi/ ./launchrepicate.sh & exit 0 ==== Set up the pibox sound parameters ==== you have to set up the pibox settings as follows inputs (with or without internet): line in outputs through a stream, line out, or radio, according to how you want to transmit the signal (over internet, locally on FM, or via a cable) ==== Connect the minijack cable ==== Connect the minijack cable from the native soundcard of the Raspberry pi (audio output included on the Pi) to the microphone input of the USB external sound card ==== Configure alsamixer ==== while connected to the pibox with ssh, type : $ alsamixer You will have to put the minimodem sound to the maximum. It uses the native spound card of the raspberry pi. Then check the pibox external sound card by raising the mic input to the maximum. after this step the sound shall be audible on the sound medium you chose. now time to configure the receiver, on you second pibox ===== Step 2. Setup the receiver Node ===== ==== on the second Raspberry pi or computer ==== ==== Get the script ==== download the scripts here! [reception_script.zip](reception_script.zip) - minimodemRXaudioTXT.sh === Install minimodem=== $ sudo apt-get install minimodem === Setup for reception script=== the TX reception script is to put in the directory /home <