... | ... | @@ -87,3 +87,139 @@ After compiling and installing the engine on the RPi by following the README.md |
|
|
To do so, the bin/cfg/ dir contains the required files.
|
|
|
|
|
|
|
|
|
The "carpi" subdir is a perfect skeletton to start with.
|
|
|
|
|
|
Copy this dir to a new dir named after your robot's name.
|
|
|
|
|
|
WARNING: the robot's name should also be the hostname of your RPi.
|
|
|
In this example, let's call the robot "Terminator".
|
|
|
"terminator" has to be the hostname of your RPi, as well as the name of your config dir:
|
|
|
$ cp -r carpi terminator
|
|
|
|
|
|
Let's have a look at the files inside this config dir:
|
|
|
|
|
|
config.json
|
|
|
|
|
|
{
|
|
|
"audio_dev": "default",
|
|
|
"http_address": "0.0.0.0",
|
|
|
"http_port": "8000s",
|
|
|
"hw_video_encoder": true,
|
|
|
"mbrola_params": "-a 100 -s 120 -p 20 -v mb/mb-fr1",
|
|
|
"picture_height": 1080,
|
|
|
"picture_width": 1920,
|
|
|
"robot_name": "carpi",
|
|
|
"role_minimal_audio": "full",
|
|
|
"role_minimal_video": "full",
|
|
|
"ssl_certificate": "nestorpi.pem",
|
|
|
"stun_url": "stun.l.google.com:19302",
|
|
|
"turn_url": "fmssoftware@hotmail.com:lolilol#numb.viagenie.ca",
|
|
|
"v4l2_dev": [
|
|
|
{
|
|
|
"name": "/dev/video0"
|
|
|
}
|
|
|
],
|
|
|
"video_height": 480,
|
|
|
"video_width": 640
|
|
|
}
|
|
|
|
|
|
The "audio_dev" parameter is the "capture" audio used to connect a microphone and send the recorded
|
|
|
audio to the web user interface.
|
|
|
|
|
|
To get the list of detected audio device, run the NestoRPi Engine, and connect to it using a regular
|
|
|
web browser: https://<IP>:8000/api/getAudioDeviceList
|
|
|
|
|
|
Keep the http_address as it is
|
|
|
The "s" char at the end of the port indicates that the connection is done is a secured way using HTTPS
|
|
|
hw_video_encoder => use the GPU to encode the video and decrease the latency. Set it to false
|
|
|
only if you are NOT using a RPi.
|
|
|
mbrola_params => Parameter used by the synthetic speech.
|
|
|
Picture_height and picture_width is the default resolution used when a picture is taken from the robot.
|
|
|
|
|
|
robot_name: rpi's hostname (in our example, "terminator")
|
|
|
role_* => permission rules. Keep as it is.
|
|
|
|
|
|
ssl_certificate: "lets encrypt" is a good way to generate it: https://letsencrypt.org/
|
|
|
Only if HTTPS is enabled.
|
|
|
|
|
|
v4l2_dev: the webcam device
|
|
|
|
|
|
video_height / video_width: the video resolution. 640*480 is the highest resolution on RPi zero.
|
|
|
On other RPi, you can use 1920*1080
|
|
|
|
|
|
devices.json
|
|
|
{
|
|
|
"L298N": {
|
|
|
"device": "L298N",
|
|
|
"pins": {
|
|
|
"ini1": 7,
|
|
|
"ini2": 0,
|
|
|
"ini3": 2,
|
|
|
"ini4": 3,
|
|
|
"pwm_enA": 5,
|
|
|
"pwm_enB": 4
|
|
|
},
|
|
|
"pwm_hard": false,
|
|
|
"type": "actuator"
|
|
|
},
|
|
|
"mbrola": {
|
|
|
"device": "mbrola",
|
|
|
"type": "actuator"
|
|
|
},
|
|
|
"temp_cpu": {
|
|
|
"command": "echo $((`cat /sys/class/thermal/thermal_zone0/temp` / 1000))",
|
|
|
"device": "command",
|
|
|
"refresh_interval": 4,
|
|
|
"type": "sensor"
|
|
|
},
|
|
|
"wifi_signal": {
|
|
|
"command": "iwconfig wlan0 | grep -Po 'Quality=\\K([0-9]*)'",
|
|
|
"device": "command",
|
|
|
"refresh_interval": 1,
|
|
|
"type": "sensor"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
This file specifies the devices connected to the GPIO pins of your RPi.
|
|
|
The GPIOs number are the one used by the Wiring Pi lib, as described here:
|
|
|
https://raw.githubusercontent.com/ppelleti/hs-wiringPi/master/pin-diagram.png
|
|
|
|
|
|
NestoRPi supports multiple devices, including L298N, relays, servo.
|
|
|
|
|
|
mbrola is used for the synthetic voice.
|
|
|
temp_cpu and wifi signal are sensors data that will be displayed in the web user interface.
|
|
|
|
|
|
tasks_automation.json
|
|
|
{
|
|
|
"log": {
|
|
|
"type": "log"
|
|
|
},
|
|
|
"monitoring": {
|
|
|
"sensors_id": [
|
|
|
"temp_cpu",
|
|
|
"wifi_signal"
|
|
|
],
|
|
|
"shm_path": "/dev/shm/nestor_",
|
|
|
"type": "monitoring"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
tasks_controller.json
|
|
|
{
|
|
|
"L298N": {
|
|
|
"actuator_L298N_id": "L298N",
|
|
|
"type": "L298N"
|
|
|
},
|
|
|
"audio_video": {
|
|
|
"type": "audioVideo"
|
|
|
},
|
|
|
"voice": {
|
|
|
"actuator_mbrola_id": "mbrola",
|
|
|
"type": "voice"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|