Raspberry Pi C-Server Sensor Application with websocket

Raspberry Pi C-Server Sensor Application with websocket

Getting pressure and temperature measurements from the Raspberry PI Sense Hat

code_ws_sensor.zip

ws_sensor.svg

REM : sensor access functions ( c language) can be found at : https://github.com/davebm1/c-sense-hat

you’ll have to install :

sudo apt-get install libi2c-dev

After websocket handshaking, the RPI gets measurements with I2C bus and sends them to the client through the websocket.

httpDynServerWs_sensor.c
Le fichier iot/linux-server-programming/rpi-c-server-sensor-app/code_ws_sensor/httpDynServerWs_sensor.c n'a pas été trouvé à l'emplacement spécifié.
www/wsAppli.html
Le fichier iot/linux-server-programming/rpi-c-server-sensor-app/code_ws_sensor/www/wsAppli.html n'a pas été trouvé à l'emplacement spécifié.

Adding LED Control

GPIO CONFIG

$ nano /etc/profile.d/gpio_config.sh

#! /bin/bash
cd /sys/class/gpio/
echo 4 > export
cd gpio4
echo out > direction
echo 1 > value
cd ~

code_ws_sensor_led.zip

for led config, have a look at : dynamic_http_server.html

ws_sensor_led.svg

www/wsAppliLed.html
Le fichier iot/linux-server-programming/rpi-c-server-sensor-app/code_ws_sensor_led/www/wsAppliLed.html n'a pas été trouvé à l'emplacement spécifié.

Adding Database Management

code_ws_sensor_led_db.zip

Let’s use a lightweight database : sqlite3

# RPI TERM
$ sudo apt-get install sqlite3 libsqlite3-dev

Cross Compiling and Debug

please have a look at : https://web.enib.fr/~kerhoas/ide/rpi-cross-development

code_ws_sensor_led_db_cross_dev.zip