To run the HTTP server:
python3 http_server.py
Ideally these processes should run on startup, for this we use systemctl
.
For example to configure a unit for the voice_action_server
:
-
Create the
.service
:# voice-action_server server sudo vim /lib/systemd/system/voice_action_ctl.service
With the following content:
[Unit] Description=Python voice to action service After=multi-user.target [Service] Type=idle User=pi StandardOutput=file:/home/pi/RaspVan/logs/voice_action_server.log StandardError=file:/home/pi/RaspVan/logs/voice_action_server_err.log ExecStart=/usr/bin/python3 /home/pi/RaspVan/voice_assistant/voice_action_server.py [Install] WantedBy=multi-user.target
-
Reload the systemctl daemon:
sudo systemctl daemon-reload
-
Enable the service
sudo systemctl enable voice_action_ctl.service
To start manually and test proper functioning:
sudo systemctl start voice_action_ctl # start the service
journalctl -u voice_action_ctl # show the logs
systemctl status voice_action_ctl # check status of the service
Similarly should be done for the HTTP python server
.
In addition we can configure an Apache server displaying several stats about the RaspberryPi: (temperature, work load, memory load, etc).
Refer to GumCP for instructions.
-
Lights:
Update: Instead of using the MOSFET configuration, is prefered using an array of relays because of encapsulation. Switching times increase when using relays but encapsulation of the devices makes life easier. We use these relays.
Connections are done from the raspberryPi GPIO pins to the positive side of the lights circuit (high-side switch) using a p-channel MOSFET transistor. Discussion on low-side or high-side switching are out of the scope of this readme document.
An schematic view of the switch mechanism follows (from this partsim project):