Skip to content

ver09934/aquametric

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

aquametric

Stream stage monitoring.

Sensor Code

The code running on the sensor units can be found in /embedded. Everything else is for running the website.

Setup

  • Add config through environment variables (TODO)

  • Add sensor list JSON file

    The following is an example /sensors.json:

    {
        "001": {
            "lat": 42.784723,
            "lng": -73.842862,
            "prettyname": "Test Sensor 1",
            "img": "https://i.picsum.photos/id/724/500/300.jpg"
        },
        "002": {
            "lat": 43.100000,
            "lng": -74.10000,
            "prettyname": "Test Sensor 2",
            "img": "https://i.picsum.photos/id/323/500/300.jpg"
        }
    }
  • Deploy a sensor unit (TODO: Get sensor code into version control)

Running (Development)

$ chmod +x run.sh
$ ./run.sh

Apache Adventures

I suspect that the problem was just the virtualhost configuration, but here are all the steps that were taken:

Python Notes

  • json.load and json.dump use file objects
  • json.loads and json.dumps take/return strings (that's what the "s" stands for)
  • readlines() does not rstrip(), and writelines() does not add newlines