Giter VIP home page Giter VIP logo

cloud4rpi-chip-python's Introduction

Cloud4RPi Examples for Next Thing Co. C.H.I.P.

Build Status

This example demonstrates different scenarios of using Cloud4RPi service on C.H.I.P.:

  • Monitoring events
  • Controlling a GPIO pin
  • Monitoring temperature with the DS18B20 sensor

For detailed instructions on how to run this example, refer to the How To article.

Running the Sample Code

  1. Update your system and make sure you have the latest versions of all required software:
    sudo apt update && sudo apt upgrade -y
    sudo apt install python3 python3-pip git -y
    sudo pip3 install --upgrade setuptools pip
  2. If you are going to use GPIO, install the CHIP_IO library using the instructions from the CHIP_IO repository.
  3. Install the Cloud4RPi client library:
    sudo pip3 install cloud4rpi
  4. Clone this repository:
    git clone https://github.com/cloud4rpi/cloud4rpi-chip-python.git && cd cloud4rpi-chip-python
  5. Log into your Cloud4RPi account or create a new one.
  6. Copy your device's Device Token. If you have no devices, create one on the Devices page and copy its Device Token.
  7. Replace the __YOUR_DEVICE_TOKEN__ string in the control.py file with your device token using any text editor (nano, vim, sed or other):
    sed -i 's/__YOUR_DEVICE_TOKEN__/replace-this-text-with-your-real-device-token/' control.py
  8. Run the control.py example:
    sudo python3 control.py
  9. Notice that the device went online and started sending data.
  10. Go to the Control Panels page and add a new control panel.
  11. Add a new Gauge widget and bind it to the CPU Temp variable.
  12. Add a new Switch widget and bind it to the LED On variable.
  13. Add a new Text widget and bind it to the STATUS variable. Configure different colors for "IDLE", "RING" and "BOOM!" strings.
  14. If you have DS18B20 sensor connected to your C.H.I.P., add a new Chart widget and bind it to the Room Temp variable.

You can use this control panel to monitor variables and control a logical state on a hardware pin.

See Also

cloud4rpi-chip-python's People

Contributors

himura2la avatar sky3d avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

houdang

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.