Giter Club home page Giter Club logo

waybot's Introduction

Waybot ๐Ÿ“ˆ

A web app to monitor sensor data form Waybot traffic 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

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โ€”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 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.

imagemagick/graphicsmagick for creating assets -> 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:

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 line

Here's how to specify app version from bash history:

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

waybot's People

Contributors

johnelliott avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.