Users that have any vested interest in the data that is sent to the Gateway server from the nodes can access that data through a website, also served from the Pi. Django provides the framework for the website, which is implemented largely in Python, however some HTML and CSS is required within the Python template language to get web pages to render as desired.
As shown above in early versions of the website design, the site can be accessed to view such things as data from the trails and status of the nodes (such as battery readings). It can also be used by admins to control the nodes remotely, allowing for power cycling and putting nodes in a low-power state. This is highly beneficial due to the size of the trail, the distance between nodes, and the time it would take to access and maintain them on foot.
The figure above shows the admin message page. As shown, it displays all messages sent from a node to the Gateway regarding informations, warnings, and errors.
Hardware maintenance can be performed remotely through the Node Down maintenance page, where the user can press a reset or power button to power cycle a mode in a bad state, given that the state in which it is in is recoverable.
Almost every page has a map with each node displayed, including the node status page above. Users can interact with this map by dragging it around, zooming in and out, and clicking on a blue marker, which represents a node. Clicking on a marker makes a popup which displays getting information about the corresponding node. In the above example, a user clicked on Node 1, and is looking at the status, which is set to okay. This map is powered by a library called leaflet.js. Its basemap is OpenStreetMap. A demo of leaflet.js is below:
Gateway Node and Website Risks
- Security
- SSH Keys are required to login via SSH
- SSH and HTTP ports are not default
- IP addresses are banned after multiple failed attempts
- Unneeded ports are CLOSED, or hidden behind the router's firewall
- Hard Drive Space
- 11 GB left on pi (should be plenty)
- Can upgrade SD card
- Can use external Hard drive as primary hard drive
- SD card will only be for booting
- Lack of Processing Power
- No problems yet
- Database, Website, and Gateway Program can each go on their own pi if needed
- Code is cross-platform (for Linux), "easy" to upgrade to a more powerful system
- Will most likely be a low traffic site
- Gateway Program uses no CPU unless something is happening
- PI is stripped down
- No GUI, several things are not installed
Testing Strategy for Gateway and Website
Unit Tests will be written to find small bugs early. At present time, C++ has been used to write upwards of 180 unit tests. The debug console can be used to run manual integration tests, and tests exist so far for sending email, sending SMS, logging error messages, sending UART messages, and shutting down Gateway processes.
Security testing will involve allowing a small team of RIT security majors to penetration test the server, reporting any flaws in design.