User Tools

Site Tools


carberry:rpi:daemons:carberry

The Carberry daemon

To simplify the interaction between Linux world and Carberry, we have developed a Linux daemon that:

  • Starts on poweron.
  • Opens the serial port twards Carberry.
  • Exposes a TCP/IP server at port (7070) on localhost 127.0.0.1.
  • Allows multi client connection.
  • Dispatches events coming from Carberry to all clients connected.

Downlaod the daemon

Click here to download the carberry daemon, or follow installation steps below:

Build the daemon

Enter home directory:

cd /home/pi/

Download the daemon:

curl -O -J http://www.carberry.it/down.php?download_id=709

Untar the file:

tar -xvf carberry_d_1.1.tar

Build the daemon

cd /home/pi/carberry_d
gcc -o carberry carberry.c

Add execution rights to just built carberry

sudo chmod +x /home/pi/carberry_d/carberry

Try to execute carberry:

/home/pi/carberry_d/carberry

You will see something like this:

pi@raspberrypi ~ $ /home/pi/carberry_d/carberry
Carberry Started
  

Kill process with CTRL-C.

Install the daemon

Move the service file in /etc/init.d

sudo mv /home/pi/carberry_d/carberry.sh /etc/init.d/carberry

Add execution rights to the service script

sudo chmod +x /etc/init.d/carberry

Install with:

sudo update-rc.d carberry defaults

Service operations:

sudo service carberry stop
sudo service carberry start
sudo service carberry restart

Start service with:

sudo service carberry start

Reboot system:

sudo reboot

Check the daemon

Check daemon execution

ps aux | grep carberry

You will see:

pi@raspberrypi ~/carberry_d $ ps aux | grep carberry
root     29523  0.0  0.0   2576   360 ?        S    14:35   0:00 /home/pi/carberry_d/carberry
pi       29657  0.0  0.1   3568   832 pts/0    S+   14:36   0:00 grep --color=auto carberry

The daemon is correctly installed.

carberry/rpi/daemons/carberry.txt · Last modified: 2016/05/02 17:18 by Simone Rinaldi