- Notifications
You must be signed in to change notification settings - Fork17
Examples of Cloud4RPi client library usage on Raspberry Pi
License
NotificationsYou must be signed in to change notification settings
cloud4rpi/cloud4rpi-raspberrypi-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Cloud4RPi Examples forRaspberry Pi
This example demonstrates different scenarios of using Cloud4RPi service on Raspberry Pi:
- Monitoring events
- Controlling a GPIO pin
- Monitoring temperature with the DS18B20 sensor
For detailed instructions on how to run this example, refer to theHow To article.
- Update your system and make sure you have the latest versions of all required software:
sudo apt update&& sudo apt upgrade -ysudo apt install python3 python3-pip git -ysudo pip3 install --upgrade setuptools pip - Install the Cloud4RPi client library:
sudo pip3 install cloud4rpi
- Clone this repository:
git clone https://github.com/cloud4rpi/cloud4rpi-raspberrypi-python.git&&cd cloud4rpi-raspberrypi-python
- Log into your Cloud4RPi account orcreate a new one.
- Copyyour device'sDevice Token. If you have no devices, create one on theDevices page and copy itsDevice Token.
- Replace the
__YOUR_DEVICE_TOKEN__string in thecontrol.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 - Run the
control.pyexample:sudo python3 control.py
- Notice that thedevice went online and started sending data.
- Go to theControl Panels page and add a new control panel.
- Add a newGauge widget and bind it to the
CPU Tempvariable. - Add a newSwitch widget and bind it to the
LED Onvariable. - Add a newText widget and bind it to the
STATUSvariable. Configure different colors for"IDLE","RING" and"BOOM!" strings. - If you haveDS18B20 sensor connected to your Raspberry Pi, add a newChart widget and bind it to the
Room Tempvariable.
You can use this control panel to monitor variables and control a logical state on a hardware pin.
About
Examples of Cloud4RPi client library usage on Raspberry Pi
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
