The sensorapp application contains fetcher and server applications for sensor readings, using the SCION network. The application is very simple: It sends a single packet to request information and typically obtains a single packet containing the readings in response.
sudo apt install scion-apps-sensorapp
See Installation for details.
sensorfetcher application sends a 0-length SCION UDP packet to the
sensorserver application to fetch the sensor readings. A string is returned containing all the sensor readings. To keep the application as simple as possible, no reliability is built in – in case of packet loss, the user needs to abort and re-try.
Sample servers are at:
Their readings can be fetched as follows:
scion-sensorfetcher -c 17-ffaa:1:89,[127.0.0.1]:0 -s 17-ffaa:0:1102,[188.8.131.52]:42003
-s specifies the sensor server whereas
-c specifies your machine. The
-c flag can be omitted if a SCION localhost address is configured. To do this, add your SCION host to the
/etc/hosts file. Below you can see an example:
# regular IPv4 hosts # .... # regular IPv6 hosts # .... # SCION hosts 17-ffaa:0:1,[192.168.1.1] localhost
We use sensors from Tinkerforge, and the
sensorreader Python application to fetch the sensor values and write them to
sensorserver application collects the readings and serves them as a string to client requests. To start, we use the following command:
scion-sensorreader | scion-sensorserver -s 17-ffaa:0:1102,[184.108.40.206]:42003 &
If you do not have any sensor information available, then you can use a simple time application that reports the current time on your system:
scion-timereader | scion-sensorserver -s 17-ffaa:0:1102,[220.127.116.11]:42003 &
In these examples,
-s specifies your server address. Again, it can be omitted by specifying a SCION localhost like above. The server then uses localhost to bind to. In this case, the port can be specified with the
scion-sensorreader | scion-sensorserver -p 42003 & scion-timereader | scion-sensorserver -p 42003 &