A robot project :)
- sudo apt-get install libportaudio-dev
- curl get.pimoroni.com/skywriter | bash
- sudo apt-get install flac
- pip3 install PyAudio
- sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
- pip3 install SpeechRecognition
- sudo apt-get install mpg321
- sudo apt-get update && sudo apt-get install espeak
- Activate l2c interface on raspberry (using raspi-config)
In order to have the usb audio as default audio device it makes sense to disable the
internal broadcom sound card, since sometimes it can happen, that at boot time , the usb
audio is added as card0 or card1 etc., so that it hast to be adapted in alsa.conf everytime it changes.
# Edit boot config with:
sudo nano /boot/config.txt
# so that:
cat /boot/config.txt
...
# Enable audio (loads snd_bcm2835)
#dtparam=audio=on
dtparam=audio=off
...
# You need to reboot!
sudo reboot now
Some values have to be applied before running the robot in order to make its movements more precise.
To have more precise gyro angles, GYRO_MULTIPLIER
(within gyro_movement.py
)has to be appliacted.
Therefore, let the robot turn for 360° (without calibration), then measure the angle turned, e.g. 380°.
Now divide 380° by 360° to get the GYRO_MULTIPLIER
value.
Within camera.py
the CAMERA_ANGLE_DEGREE
variable has to be set, according to the viewing angle of the camera.
- Allow non-sudo users to use port 80
- Install authbind:
sudo apt-get install authbind
- Create authbind files for port 80
sudo touch /etc/authbind/byport/80
sudo chmod 777 /etc/authbind/byport/80
- Install authbind:
- Run the
server.py
from within thebot
folder, so that its imports work (Using authbind)!authbind --deep python3 server.py
E.g.:
PiBot_v3/bot $ python3 remote/python\ server/server.py
Now you can simply access the robot via ip address within a browser.
- Make
led_matrix.py
executable- $
chmod +x led_matrix.py
- $
- Copy
remote.service
to/lib/systemd/system
- Copy
robot.service
to/lib/systemd/system
- Change
ExecStart=
command inside*.service
accordingly to path whereserver.py
is located (orRobot.py
) - Enable daemon process
- $
sudo systemctl daemon-reload
- $
sudo systemctl enable remote.service
- $
sudo systemctl start remote.service
- $
- Enable daily reboot at midnight (to automatically fix (e.g.) networking errors
sudo crontab -e
- Enter as new line and save -->
0 0 * * * /sbin/reboot
- Check status
- $
sudo systemctl status remote.service
- $
- Start service
- $
sudo systemctl start remote.service
- $
- Stop service
- $
sudo systemctl stop remote.service
- $
- Check service's log
- $
sudo journalctl -f -u remote.service
- $