Skip to content

cloud4rpi/cloud4rpi-common-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud4RPi Common Examples

Build Status

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
  2. Install the Cloud4RPi client library:
    sudo pip3 install cloud4rpi
  3. Clone this repository:
    git clone https://github.com/cloud4rpi/cloud4rpi-common-python.git && cd cloud4rpi-common-python
  4. Log into your Cloud4RPi account or create a new one.
  5. Copy your device's Device Token. If you have no devices, create one on the Devices page and copy its Device Token.
  6. Replace the __YOUR_DEVICE_TOKEN__ string in the minimal.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/' minimal.py
  7. Run the minimal.py example:
    sudo python3 minimal.py
  8. Notice that the device went online and started sending data.
  9. Go to the Control Panels page and add a new control panel.
  10. Add a new Gauge widget and bind it to the Room Temp or Outside Temp variable.

You can use this example as a starting point for your own code.

For platform-specific examples, refer to the following repositories:

See Also