Git Product home page Git Product logo

test's Introduction

PiBot on Raspberry Pi

This folder contains configs and scripts only for Raspbian running on Raspberry Pi.

Installing dependencies


  • Janus WebRTC Gateway:

    1. 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.
    2. Edit janus.transport.websockets.cfg: set SSL cert/key paths under [certificates] section.
    3. Edit janus.cfg: set SSL cert/key paths under [certificates] section.
    4. Copy configs to /opt/janus/etc/janus/
    5. Copy systemd startup script to lib/systemd/system
  • 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

Certificates


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

Wifi connection

Important

Use either balena.io or wifi connect script

Install if you need it

  • 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:
    # wifi-connect
    or run script "start-wifi-connect":
    # ./start-wifi-connect
    If you run this script, then the main script will start automatically.
Wifi-connection script
Using if you need it

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.

Script autoconfiguration of network configs


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.

Main script


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

PiBot image


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.

test's People

Watchers

 avatar

test's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.