Coder Social home page Coder Social logo

ht_sensor_api's Introduction

Installation

To install use sudo make install.

Example Code

Examples for using this library are located in /example.

Config File

Config files are written in CSV format as follows:

Driver Library (BSH, NXP, LSM), Sensor Type (Gyr, Acc, Mag), I2C Address, X Offset, Y Offset, Z Offset

Example: example/config.txt

Runnning the web app

  • First install node & npm (node version 10.8.0 is recommended) on development machine
  • Next navigate to cloud_app/front_end and run npm install
  • After the installation completes run npm run build
  • After the build copy over all code to the RPi for this you can use rsync in a similar fashion to the following rsync -arv -e ssh --delete --exclude={'HT_Sensor_API/cloud_app/front_end/node_modules', 'HT_Sensor_API/cloud_app/back_end/node_modules'} HT_Sensor_API/ [email protected]:~/HT_Sensor_API
  • ssh into the pi and run sudo make install in the HT_Sensor_API directory
    • If a linking error occurs you may need to install additonal libraries
      • sudo apt-get install wiringPi
      • sudo apt-get install i2ctools
    • If an error occurs about the HTSensors.service not existing this may need to be commented out of the Makefile until after the first build (I'll likely be changing this from a systemd service as this is kind of silly to be running all the time)
  • once the library is build and installed navigate to cloud_app/socket_server and run make
  • after the application is built run it with ./ht_socket
    • There are some bugs with the HTSensors service you may need to restart it every time you boot the pi or rerun the socket server. To restart run sudo systemctl restart HTSensors.service to start it run sudo systemctl start HTSensors.service (this will change soon).
  • Now back on the development machine navigate to cloud_app/back_end and run node index.js
  • Now you can navigate to localhost:3000 and explore the web app

Important Info about sensor config

The web app loads its sensor config from cloud_app/config.txt if sensors are in the config file but are not connected to the RPi the system will not work. Please ensure that the config file matches the physical connections. To test if the sensors are connected you can run i2ctools -y 1 it will output sensors connected to the i2c line and their address.

ht_sensor_api's People

Contributors

broha22 avatar grossbei avatar igrossberg23 avatar

Watchers

 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.