SharkRF IP connector Server Guide

Instructions for installing and configuring the SharkRF IP Connector software on a Raspberry Pi - by VE3xx (DEC-2018)

These instructions assume that:
- you are logging into the RPi as "pi" at the console, rather than connecting in using VNC or SSH
- you do NOT change accounts from "pi" to the SuperUser
- you have opened up a console window

----------------------------------------
Section 1: Updating the operating system
----------------------------------------
type in: sudo apt-get update
type in: sudo apt-get upgrade

https://github.com/VE3OY/srf-ip-conn-srv
---------------------------------------------------------------------
Section 2: Installing the programs we need to compile the source code
---------------------------------------------------------------------
type in: sudo apt-get install make
type in: sudo apt-get install cmake

-------------------------------------------
Section 3: Installing the Apache Web Server
-------------------------------------------
type in: sudo apt-get install apache2 -y

Once the installation has completed, check that the web server is running correctly by:
- opening the Chromium web browser software
- type in "http://localhost/" into the address bar and press ENTER

If everything is functioning properly, you should see the Apache Debian Default Page.

The default root directory for your web server can be found in the directory "/var/www/html".
This is where you will serve any documents, including the IP Connector Dashboard (more later on this below).

-------------------------
Section 4: Installing PHP
-------------------------
type in: sudo apt-get install php libapache2-mod-php -y

The SharkRF IP Connector software depends on PHP being installed.

-----------------------------------------------------------
Section 5: Downloading the SharkRF IP Connector source code
-----------------------------------------------------------
type in: cd /var
type in: mkdir /var/sharkrf
type in: cd /var/sharkrf
type in: git clone https://github.com/sharkrf/srf-ip-conn-srv
type in: git clone https://github.com/sharkrf/srf-ip-conn
type in: git clone https://github.com/zserge/jsmn

-----------------------------------------------------
Section 6: Compiling the SharkRF IP Connector program
-----------------------------------------------------
type in: cd srf-ip-conn-srv/build
type in: SRF_IP_CONN_PATH=/var/sharkrf/srf-ip-conn JSMN_PATH=/var/sharkrf/jsmn ./build-release.sh

Unless there were errors, the compiled program can now be found in "/var/sharkrf/srf-ip-conn-srv/build/Release".
If everything went well, continue onwards!
type in: cd ~

-----------------------------------------------------------------
Section 7: Creating a user that will run the IP Connector program
-----------------------------------------------------------------
type in: adduser sharkservice
- when prompted, set a strong (easily remembered) password for this new user
- skip the remaining questions

type in: cd /var
type in: chown sharkservice:sharkservice sharkrf -R

-------------------------------------------------
Section 8: Copying the default server config file
-------------------------------------------------
type in: cd /var/sharkrf/srf-ip-conn-srv/build/Release
type in: mv config-example.json config.json
type in: chmod 755 config.json
type in: mv /var/sharkrf/srf-ip-conn-srv/build/Release/config.json /var/sharkrf/srf-ip-conn-srv/config.json
type in: cd /var/sharkrf/srf-ip-conn-srv
type in: ls -la config.json
If you see this file listed, then everything went OK.

---------------------------------------------------
Section 9: Modifying the server program config file
---------------------------------------------------
type in: cd /var/sharkrf/srf-ip-conn-srv
type in: leafpad config.json

Edit this file:
- Change "max-clients" to 10 (maximum number of clients that can connect to the server)
- Change "max-api-clients" to 10
- Change "server-password" to something strong and easily remembered

** THIS NEXT SETTING IS VERY IMPORTANT **
- Change "api-socket-file": "/var/sharkrf/srf-ip-conn-srv.socket"

- Change "server-name" to whatever you would like to show on the Dashboard
- Change "server-desc" to whatever you would like to show on the Dashboard
- Change "server-contact" to your e-mail address

Save your work and exit.

-------------------------------------------------------------------------------
Section 10: Configuring the server program to start automatically after a REBOOT
-------------------------------------------------------------------------------
Note: In order to start the server program with the "sharkservice" user, we have to be logged in AS that user.

type in: su sharkservice
Your prompt should show "sharkservice" on the command prompt"
type in: crontab -e

Move your cursor to the bottom of the screen using your arrow keys.
type in: @reboot /var/sharkrf/srf-ip-conn-srv/build/Release/srf-ip-conn-srv -c /var/sharkrf/srf-ip-conn-srv/config.json
Add an extra blank line after your command.

Press CRTL + "O" to save your work.
Press CTRL + "X" to exit the editor.

** IMPORTANT **
type in: exit
Your prompt should show "pi" on the command prompt"

--------------------------------------------------------------------
Section 11: Copying the Dashboard files to the web server directories
--------------------------------------------------------------------
type in: cd /var/www/html
type in: cp /var/sharkrf/srf-ip-conn-srv/dashboard/* /var/www/html/dvr

------------------------------------------
Section 12: Setting up the web server files
------------------------------------------
type in: cd /var/www/html
type in: cp config-example.inc.php config.inc.php
type in: leafpad config.inc.php

** THIS NEXT SETTING IS VERY IMPORTANT **
Edit this line to read:
$config_api_socket_file = '/var/sharkrf/srf-ip-conn-srv.socket'

Save your work and exit.

type in: cd /var/www
type in: chown www-data:www-data html -R

----------------------------
Installation is now complete
----------------------------
At this point:
- the server program has been installed, configured and set to auto-start
- you have also assigned a newly created user (sharkservice) to run the server program
- you have copied the Dashboard programs to the web server directories

A post-installation check:
- opening the Chromium web browser software
- type in "http://localhost/dvr" into the address bar and press ENTER

You should now see your IP Connector Dashboard, and see the information

on screen updating (uptime, etc).





SharkRF OpenSPOT OpenSPOT2 openSPOT3 Users Support Group
OpenSPOT@groups.io
https://groups.io/g/OpenSPOT
******  share this with others  *******


Discussion or Technical Questions 


No comments:

Post a Comment

Thanks for your comments, Comments may take a day to show up
.
Digital Ham Radio / Amateur Radio
https://groups.io/g/DigitalHamRADIO

SharkRF openSPOT
https://groups.io/g/OpenSPOT
.