Code Monkey home page Code Monkey logo

iot's Introduction

iot

IoT example (GrovePi+/SenseHat)

Library Required

  • Sense Hat ( included in RASPBIAN STRETCH 2018-03-13 )
    sudo apt-get install sense-hat 
  • GrovePi
    sudo curl -kL dexterindustries.com/update_grovepi | bash
    sudo reboot
  • Paho
    sudo pip install paho-mqtt

Running

  • Use 'git clone' to get the whole folder to local
  • Run 'set_sense.sh' or 'set_grove.sh' accroding the type your sensor board
  • Run 'iot_pub.py' to publish data
    • The status of middle button of joystick will be published (Sense Hat)
  • Run 'iot_sub.py' to subscribe and display data
    • Use Up, Down, Left or Right to switch displayed info (Sense Hat)
    • Cover light sensor to switch displayed info (GrovePi+)
  • Press Ctrl+C on console to exit the program

Code

  • iot_pub.py
    • Publish sensor data to AWS broker.
    • Topic:
      iot/temperature/client_id     (GrovePi+/SenseHat)
      iot/humidity/client_id        (GrovePi+/SenseHat)
      iot/button/client_id          (GrovePi+/SenseHat)
      iot/potentiometer/client_id   (GrovePi+)
      iot/pressure/client_id        (SenseHat)
      iot/compass/client_id         (SenseHat)
      ...
  • iot_sub.py
    • Subscribe to iot/+/ to receive data from specific client

TLS certificates

All certificates should be placed in cert folder.

CARoot.pem CA file
**********-certificate.pem.crt Client Certificate file
**********-public.pem.key Client Public Key (unused for client)
**********-private.pem.key Client Private Key

Broker Info

Server a1zd8y5etgd1ze.iot.ap-northeast-1.amazonaws.com
Port 8883

MQTT.fx Settings

MQTT.fx Settings

iot's People

Contributors

zhezhang77 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.