Live test
This commit is contained in:
+56
-30
@@ -245,7 +245,7 @@ h2, h3 {
|
||||
|
||||
<h3 id="system">System Installation</h3>
|
||||
<p>
|
||||
Before installing anything additionally, <a href="https://www.raspberrypi.org/downloads/raspbian/">Raspbian Lite</a> has to be <a href="https://www.raspberrypi.org/documentation/installation/installing-images/README.md">installed on the SD card</a>. From there on, it's all on the command line.
|
||||
Before installing anything additionally, <a href="https://www.raspberrypi.org/downloads/raspbian/">Raspbian Lite</a> has to be <a href="https://www.raspberrypi.org/documentation/installation/installing-images/README.md">installed on the SD card</a>. When the SD card is ready, it is necessary to at least once connect a monitor and a keyboard to the RasPi for the initial setup since SSH is disabled by default. As soon as wi-fi is configured, we can remove all the cables and continue to work remotely over ssh.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -253,9 +253,9 @@ h2, h3 {
|
||||
</p>
|
||||
|
||||
<pre class="pre-scrollable">
|
||||
# Make sure that the latest versions are installed
|
||||
# Make sure that the latest versions are installed (this might take some time) (<a href="https://www.raspberrypi.org/documentation/raspbian/updating.md">https://www.raspberrypi.org/documentation/raspbian/updating.md</a>)
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo apt dist-upgrade
|
||||
|
||||
# Basic setup: password, keyboard layout, wi-fi channels, hostname, ssh
|
||||
sudo raspi-config
|
||||
@@ -269,6 +269,9 @@ lsusb
|
||||
# Install wi-fi client (<a href="https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md">https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md</a>)
|
||||
sudo apt install iw
|
||||
|
||||
# If not done yet, plug in wi-fi adapter and reboot
|
||||
sudo reboot
|
||||
|
||||
# Scan networks and add wi-fi network to configuration
|
||||
sudo iwlist wlan0 scan
|
||||
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
@@ -277,11 +280,25 @@ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
# psk="Your_wifi_password"
|
||||
# }
|
||||
|
||||
# Restart wi-fi
|
||||
sudo ifdown wlan0
|
||||
sudo ifup wlan0
|
||||
|
||||
# disable HDMI (<a href="http://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-conserve-energy">http://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-conserve-energy</a>)
|
||||
# Check if wi-fi is connected
|
||||
ifconfig wlan0
|
||||
|
||||
# Turn off
|
||||
sudo shutdown -h now
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
From here on you can connect via SSH over wi-fi. Unplug monitor, keyboard and the ethernet cable. It might also be helpful to configure a static IP for the wi-fi adapter in your router, before continuing. Then restart the RasPi, <a href="https://www.raspberrypi.org/documentation/remote-access/ssh/">connect via SSH</a> from a different computer and go on with the setup procedure.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
# Now that remote connection is available, disable HDMI (<a href="http://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-conserve-energy">http://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-conserve-energy</a>)
|
||||
sudo nano /etc/rc.local
|
||||
# # disable HDMI
|
||||
# /usr/bin/tvservice -o
|
||||
|
||||
# Disable the ACT LED
|
||||
@@ -292,14 +309,15 @@ sudo nano /boot/config.txt
|
||||
# Configure NTP
|
||||
sudo apt install ntp
|
||||
sudo nano /etc/ntp.conf
|
||||
# add time server to /etc/ntp.conf
|
||||
# add time server to /etc/ntp.conf (line 16)
|
||||
# server de.pool.ntp.org
|
||||
sudo /etc/init.d/ntp restart
|
||||
date
|
||||
|
||||
sudo reboot
|
||||
# Turn off
|
||||
sudo shutdown -h now
|
||||
</pre>
|
||||
|
||||
|
||||
<p>
|
||||
After the basic installation is done, it's time to bring everything together in the case. All components are connected but we'll wait using the glue gun until everything is tested thoroughly. Especially the webcam might need some in-place live adjustment. The easiest way to do this is by connecting the webcam to another computer while it is already in the case (see bash history below).
|
||||
</p>
|
||||
@@ -312,15 +330,24 @@ sudo reboot
|
||||
# Install additional software
|
||||
sudo apt install lirc zbar-tools mc moc fswebcam python3 python-rpi.gpio python3-rpi.gpio
|
||||
|
||||
# As a first test turn the LED on and off
|
||||
python3 ~/test/lighton.py
|
||||
python3 ~/test/lightoff.py
|
||||
|
||||
# We can also test the buttons and the sensor (press buttons, hold a card on the sensor to see if it switches from 'LOW' to 'HIGH') - stop with Ctrl-C
|
||||
python3 ~/test/buttons.py
|
||||
python3 ~/test/sensor.py
|
||||
|
||||
|
||||
# Configure PHAT DAC (<a href="https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install">https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install</a>)
|
||||
curl -sS get.pimoroni.com/phatdac | bash
|
||||
|
||||
# Check for errors
|
||||
dmesg
|
||||
|
||||
# Plug in headphones or JBL connector cable, start mocp and test audio output via the PHAT DAC
|
||||
# Plug in headphones or JBL connector cable, start mocp and test audio output via the PHAT DAC (Don't forget to turn on the speaker!)
|
||||
mocp -S
|
||||
mocp -l ~/piplayer2/sounds/scanning.mp3
|
||||
mocp -l ~/sounds/scanning.mp3
|
||||
mocp -x
|
||||
|
||||
# Determine the webcams USB ID and the available resolutions (<a href="http://askubuntu.com/questions/214977/how-can-i-find-out-the-supported-webcam-resolutions">http://askubuntu.com/questions/214977/how-can-i-find-out-the-supported-webcam-resolutions</a>)
|
||||
@@ -329,17 +356,18 @@ lsusb -s 001:006 -v | egrep "Width|Height"
|
||||
|
||||
# Webcam test: turn on the LED, take a photo and turn the LED off
|
||||
# (The focus of the webcam should be adjusted before on another computer with a live picture)
|
||||
python3 ~/piplayer2/test/lighton.py
|
||||
python3 ~/test/lighton.py
|
||||
sudo fswebcam -r 320x240 -d /dev/video0 -v ~/webcam-test.jpg
|
||||
python3 ~/piplayer2/test/lightoff.py
|
||||
python3 ~/test/lightoff.py
|
||||
|
||||
# Copy ~/webcam-test.jpg to another computer and have a look at it
|
||||
# If needed, adjust the webcam and repeat the step until the QR code recognition is reliable
|
||||
|
||||
# QR-Test: Hold a QR code card above the webcam then turn on the LED, decode the QR code and turn the LED off
|
||||
python3 ~/piplayer2/test/lighton.py
|
||||
# (Stop scanning for codes with Ctrl-C)
|
||||
python3 ~/test/lighton.py
|
||||
zbarcam --quiet --nodisplay --raw -Sdisable -Sqrcode.enable --prescale=320x240 /dev/video0
|
||||
python3 ~/piplayer2/test/lightoff.py
|
||||
python3 ~/test/lightoff.py
|
||||
|
||||
# Enable lirc in /boot/config.txt and add parameters
|
||||
sudo nano /boot/config.txt
|
||||
@@ -398,7 +426,7 @@ sudo reboot
|
||||
ps -ef | grep python
|
||||
|
||||
# Watch the log output while testing with QR code cards
|
||||
tail -f /home/pi/piplayer2/piplayer2.log
|
||||
tail -f /home/pi/piplayer2.log
|
||||
|
||||
# Switch to RAM disk and set the filesystem read-only (<a href="https://www.heise.de/ct/ausgabe/2016-21-Den-Raspi-als-Bluetooth-Empfaenger-einsetzen-3330683.html">https://www.heise.de/ct/ausgabe/2016-21-Den-Raspi-als-Bluetooth-Empfaenger-einsetzen-3330683.html</a>)
|
||||
|
||||
@@ -428,7 +456,7 @@ sudo nano /etc/rc.local
|
||||
# # make /tmp on RAM disk writable
|
||||
# chmod 777 /tmp
|
||||
#
|
||||
# # disable hdmi
|
||||
# # disable HDMI
|
||||
# /usr/bin/tvservice -o
|
||||
#
|
||||
# # start piplayer
|
||||
@@ -440,11 +468,10 @@ sudo reboot
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
We can make the filesystem writeable again for maintenance by remounting it like this:
|
||||
We can make the filesystem writeable again (until reboot) for maintenance by remounting it like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
# Dateisystem temporär beschreibbar machen
|
||||
sudo mount -o rw,remount /
|
||||
sudo mount -o rw,remount /boot
|
||||
</pre>
|
||||
@@ -454,24 +481,23 @@ sudo mount -o rw,remount /boot
|
||||
Until now, we can only play local files from the SD card (and audiostreams from the Internet). The final step is to connect the local share that stores all of our MP3 files. How this is done depends upon the type of share you would like to use. The most common type should be a SMB share that can be connected like this:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
HIER WEITER: Test-MP3 zu Template und Repository hinzufügen
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<pre>
|
||||
# make SD writable
|
||||
sudo mount -o rw,remount /
|
||||
sudo mount -o rw,remount /boot
|
||||
|
||||
# create mount point
|
||||
mkdir /home/pi/share
|
||||
|
||||
# Share einbinden
|
||||
sudo nano /etc/rc.local
|
||||
# sudo mount -t cifs -o user=guest,password= //192.168.1.125/media /home/pi/share
|
||||
|
||||
# via /etc/fstab HAT NICHT FUNKTIONIERT
|
||||
sudo nano /etc/fstab
|
||||
# tmpfs /media/share tmpfs defaults,size=10% 0 0
|
||||
# //192.168.1.125/hidrive/Media /media/share cifs guest,ro
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
HIER WEITER:
|
||||
- Test-MP3 zu Template und Repository hinzufügen
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="python">Python Script</h3>
|
||||
|
||||
Reference in New Issue
Block a user