Paso 2: Instalar el WebService
Descargar el webservice
wget http://www.phidgets.com/downloads/libraries/phidgetwebservice.tar.gz
entonces
tar zxvf phidgetwebservice.tar.gz
mueva en la carpeta descomprimida en este ejemplo
cd phidgetwebservice-2.1.8.20150410/
Desde el directorio desempaquetado del código fuente del WebService, ejecute:
./configure
make
sudo sudo make install
Esto compila el ejecutable phidgetwebservice21 y lo coloca en /usr/bin/phidgetwebservice21
Crear un fichero para la gestión de arranque y parada para el webservice
sudo nano /home/pi/phidgetwebservice
con este contenido
#!/bin/sh ### BEGIN INIT INFO # Provides: phidgetwebservice # Required-Start: $network $remote_fs # Required-Stop: $network $remote_fs # Should-Start: avahi # Should-Stop: avahi # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Phidget WebService # Description: Phidget WebService for controlling Phidgets over the network. ### END INIT INFO DESC="Phidget WebService" NAME=phidgetwebservice BIN=phidgetwebservice21 DAEMON=/usr/bin/$BIN PIDFILE=/var/run/$NAME.pid CFG=/etc/default/$NAME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 # load config pws_port="5001" pws_serverid="" pws_password="" [ -f $CFG ] && . $CFG start() { [ -z "$pws_port" ] || OPTIONS="-p $pws_port " [ -z "$pws_password" ] || OPTIONS="$OPTIONS-P $pws_password " if [ -z "$pws_serverid" ]; then OPTIONS="$OPTIONS -n $( hostname )" else OPTIONS="$OPTIONS -n $pws_serverid" fi echo -n "Starting $DESC: " start-stop-daemon -S -b -q -p $PIDFILE -m -x $DAEMON -- $OPTIONS && echo "OK" || echo "ALREADY RUNNING" } stop() { echo -n "Stopping $DESC: " start-stop-daemon -K -q -p $PIDFILE -x $DAEMON && echo "OK" || echo "NOT RUNNING" } case "$1" in start) start ;; stop) stop ;; restart|force-reload) stop sleep 1 start ;; *) echo "Usage: $0 {start|stop|restart}" esac exit 0
le dan permiso ejecutable
sudo chmod -R 0755 /home/pi/phidgetwebservice
intente iniciar con el comando
sudo sh phidgetwebservice start
Para iniciar automáticamente el servicio web
sudo mv /home/pi/phidgetwebservice /etc/init.d/phidgetwebservice
sudo insserv -d phidgetwebservice
reinicio de frambuesa
sudo reboot