Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.25 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.25 KB

IOT_senseHat

The raspeberry pi Hat used in this example is the Sense Hat. The Sense Hat has several sensors on it:

  • Humidity
  • Pressure
  • Temperature
  • Compass

Also the sense Hat has:

  • a led matrix
  • a joystick (not used in that example)

This project has two parts:

The hardware used on the Rest server are:

  • Humidity
  • Pressure
  • Temperature

Project dependencies

The project use the python module sense_Hat that you can install on debian:

sudo apt-get install sense-Hat

Also, this project use web.py as a web server for building an API rest.

pip install web.py

How to use

To start the web server

python rest_server.py [PORT]

The web server automatically starts using your private ip and not the local host. The default port is 8080

The Rest server has 4 calls:

  • humidity
  • pressure
  • temperature
  • all_sensors

For example

http://ip:8080/humidity

The response is in JSON format:

{"code":200,"status":"ok","sensor":"[type_sensor]","value":[sensor_reading_value]}