Examples of Cloud4RPi client library usage on Omega2
opkg update
opkg install wget python3 python3-pip
pip3 install --upgrade setuptools pip
pip3 install cloud4rpi
Download examples:
mkdir cloud4rpi-omega2-python && cd cloud4rpi-omega2-python
repo="https://raw.githubusercontent.com/cloud4rpi/cloud4rpi-omega2-python/master"
wget "$repo/omega2.py" "$repo/control.py"
You can install git if your board has sufficient memory and you prefer using it, and clone this repository with the
opkg install git git-http ca-bundle && git clone https://github.com/cloud4rpi/cloud4rpi-omega2-python.git && cd cloud4rpi-omega2-python
command.
__YOUR_DEVICE_TOKEN__
string in the control.py file with your device token using any text editor (vim, sed or other):
sed -i 's/__YOUR_DEVICE_TOKEN__/replace-this-text-with-your-real-device-token/' control.py
control.py
example:
python3 control.py
Omega LED
variable.You can use this control panel to switch the onboard LED‘s state.
If you have an Expansion Dock, bind three Slider widgets (from 0 fo 255) to
RGB LED
variables to control the dock’s RGB LED color.