This folder contains configs and scripts only for Raspbian running on Raspberry Pi.
-
- Follow the instructions to build and install it to the recommended location (
/opt/janus
). Enable only websocket transport and streaming plugin, everything else can be disabled. - Edit janus.transport.websockets.cfg: set SSL cert/key paths under
[certificates]
section. - Edit janus.cfg: set SSL cert/key paths under
[certificates]
section. - Copy configs to
/opt/janus/etc/janus/
- Copy systemd startup script to
lib/systemd/system
- Follow the instructions to build and install it to the recommended location (
-
Python 3:
# apt install python3 libboost-python-dev # pip install websockets
Then, follow to the folder Firmware and following the instructions install PiBot library.
-
GStreamer
# apt install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-tools python-gst-1.0
Just run the certs.sh script and all certificates will be generated automatically:
$ ./certs.sh
or for manually creating use this instruction:
You will need to create certificates for Janus, Nginx and PiBot. You can use the same certificate for PiBot and Nginx.
To create a certificate, use the command:
openssl req -x509 -nodes -newkey rsa:2048 -days 365 -keyout ssl.key -out ssl.crt
where ssl.crt and ssl.key path to future certificates. Janus certificates must be in a folder:
/opt/janus/share/janus/certs/
and their name device.crt and device.key. PiBot certificates must be in the ssl folder. The folder is in the same folder as the robot.py and name of certificates ssl.crt and ssl.key
Use either balena.io or wifi connect script
- Balena.io WiFi Connect:
Creates an access point on raspberry pi, after connecting to which it will be possible to connect the raspberry to the desired Wi-Fi access point.
Installation:
# bash <(curl -L https://github.com/balena-io/wifi-connect/raw/master/scripts/raspbian-install.sh)
- launch balena.io:
To run call the command through the terminal:
or run script "start-wifi-connect":
# wifi-connect
If you run this script, then the main script will start automatically.# ./start-wifi-connect
For normal operation you need to install networkmanager
# apt-get install network-manager
The script is called wifi.py, to run it, you must enter the command:
# python3 wifi.py
The address at which the choice of points will be available to connect to the Wi-Fi network we need.
192.168.42.1
This script differs from Balena in that it has the minimum set of functions we need, as well as in the event of an internet connection break, will automatically raise the Wi-Fi point for reconnection.
The script is called check_internet.py, to run it, you must enter the command:
# python3 check_internet.py
This script checks the current IP address and, if necessary, replaces the addresses for the web sockets Joystick and Janus, and then restarts the services.
You may want to set your own SSL certificate / key paths, for this use the arguments --ssl-cert
--ssl-key
When all dependencies are installed, run in this directory:
$ ./robot.py
If you are using a pre-built pibot assembly for raspberry pi, in this case scripts wifi.py, check_internet.py, and robot.py run by default along with the system, their autorun is controlled by systemd services wifi-connect.service, check_internet.service, robot.service. If you want to control one of the service manually, turn off the necessary service.