Duplicate a ∏-Box

From ∏ node
Jump to: navigation, search

/!\ Warning, with this operation, you can erase your hard disk if you make a mistake in the target (e.g. of=/dev/sdb), so be careful /!\ The idea is to put the .img file we made on a SD card. The .img file contains the OS (Raspbian), softwares (avconv, sox, ffmpeg, pifm, rtl_fm, lighthttpd, hostapd, dnsmasq, ...) and the script we developped (go.py).



Download the ∏ box .img file

Copy the file on a SD card

On Linux

  • Put the SD card in the card reader of a computer
  • See the name of the device
mount

we'll consider the SD Card is mount as /dev/sdb

  • Unmount the device
umount /dev/sdb1
umount /dev/sdb2
  • Duplicate the image on the SD Card (adapt the location of the image to your filesystem)
sudo dd bs=4M if='/home/b01/p-node-img/pibox-v3-2.img' of=/dev/sdb
  • Check while re-putting the SD Card in your card reader if there is 2 partitions

On Windows

download the application Disk Imager:

and follow the instructions here :

On Macintosh

download the application :

and follow the instructions here :



Configure your ∏-Box

Modify the number of your ∏ box

  • Insert the SD Card into your computer
  • Browse the content of the second partition, go to
/home/pi/
  • Edit the file config.txt
  • Change the line :
# PAS D'ESPACES
id=0

by your ∏-Box number (at least, have a look at the admin ∏-Box to see which number are up

  • Save the config.txt file and unmount the SD Card, that's it !

[optional] Modify the name of the WIFI of the PirateBox layer

sudo nano /opt/piratebox/conf/hostapd.conf

change the ssid (name) as below (for number 0 for example)

interface=wlan0
driver=nl80211
ssid=∏-node_0
...

[optional] Expand the size of your partition

  • log in your pi-box via ssh
  • and then type
sudo raspi-config

and choose

1 expand filesystem

It will expand your system on the complete SD card

Develop the main file of a PiBox

Download the main program

to get it :

git clone http://git.p-node.org/pibox.git
git pull
git gui

Dans l'interface graphique :

  • Recharger modifs
  • Indexer modifs
  • Mettre un commentaire dans la fenetre du commit pour définir la nature de la modification apportée au code
  • Committer
  • Pousser

En cas de conflit entre la version dans le git et sa version locale, il faut régler le conflit dans le fichier en enlevant les parties <<<<<< inadéquates

info.txt

the info.txt file :

FREQ 108
SOUND_INPUT 0
UPSTREAM 0
BITRATE 128
ROUTING 2
URL http://stream.p-node.org/pnode.ogg.m3u
PBON 1
PIFMON 1

Create the image from an existing SD card

On Linux

  • Put the SD card in the card reader of a computer
  • See the name of the device
mount

we'll consider the SD Card is mount as /dev/sdb

  • Unmount the device
umount /dev/sdb1
umount /dev/sdb2
  • Create the image (adapt the location of the image to your filesystem)
dd bs=4M if=/dev/sdb of='/home/b01/p-node-img/pibox-v3-2.img'