Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnelliott/waybot
π² π Arduino-powered, web-enabled DIY vehicle traffic counter
https://github.com/johnelliott/waybot
ansible arduino data-capture nodejs raspberry-pi serialport
Last synced: 14 days ago
JSON representation
π² π Arduino-powered, web-enabled DIY vehicle traffic counter
- Host: GitHub
- URL: https://github.com/johnelliott/waybot
- Owner: johnelliott
- Created: 2017-04-08T23:09:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-02T18:44:15.000Z (over 6 years ago)
- Last Synced: 2024-11-06T13:26:50.041Z (2 months ago)
- Topics: ansible, arduino, data-capture, nodejs, raspberry-pi, serialport
- Language: JavaScript
- Homepage:
- Size: 10.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Waybot π
A web app to monitor sensor data form [Waybot traffic counter](https://github.com/johnelliott/wb-counter).
### About
This app tries to load fast by using small assets, compression and some initial markup and CSS before the react app starts. A service worker caches assets on supported clients.### System Diagram
![diagram of waybot system](https://github.com/johnelliott/wb-web/blob/master/2016-system.jpeg "Waybot system 2016")### Origins
This app started as a way to experiment with node, websockets and chart libraries running and ran locally with the counter connecting directly to the server process. Later I re-did most of the code to use PouchDB, redux and react on the client and deployed it to a cloud server. This required a serial-http bridgeβ[wb-upload](https://github.com/johnelliott/wb-upload)βto bring the data to the server.## Development
- CouchDB is required for local development.
- I used Let's Encrypt for TLS certificates. For local development on mac, add the certificates to the mac keychain app to satisfy the browser security settingsβthe green lock in the URL bar.Check out [faker.sh](https://github.com/johnelliott/wb-web/blob/master/faker.sh) to see what the app might see from a traffic counter. This shows the data the app processes.
## Deployment
Deploy to a snowflake server with [Waybot deploy](https://github.com/johnelliott/wb-deploy).imagemagick/graphicsmagick for creating assets -> [image-resizer.sh](https://github.com/johnelliott/wb-web/blob/master/image-resizer.sh)
gzip for the compression npm scripts# Waybot config with Ansible (needs update)
## Use
Use with ansible 2.0+No inventory or configuration file is committed.
Hosts in the example are configured with SSH.## Examples
Example ansible inventory file `inventory`:
```
[edges]
raspberry-pi[cloud]
wb-cloud-server
```Example ansible configuration file `ansible.cfg`:
```
[defaults]
hostfile = inventory
```Example playbook run for `edges` raspberry pi uploaders:
```bash
ansible-playbook edges.yml --extra-vars='{"api_host":"http://apihost.cool:1337/api","serial_port":"/dev/ttyACM1"}'
```
Can also use extra-vars.json file with `[email protected]` on the command lineHere's how to specify app version from bash history:
```bash
ap cloud.yml --extra-vars='{"app_version":"skeumorphize"}'
```wow, so problems in NVM land and NPM module land
also how to to SSL in a smart way? `server_cert_path`don't forget to template in symlinks to letsencrypt
# CHIP notes
I needed to install wireless tools and do https://github.com/fordsfords/wlan_pwr to try to adjust wlan power for power savings... this may need to go off in production/dev/ttyACM0 is the usb port with arduino
chip $ lsusb on the chip confirms
thirteen $ ap chips.yml --ask-become-pass to start installing node