Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Cloud4RPi Library and Examples for ESP8266 with MicroPython

Build Status

Running the Sample Code

  1. Connect your MicroPython-enabled ESP8266 to a Wi-Fi network and configure it for WebREPL. You can do it by accessing the console via the serial port and executing the following commands:

    >>> from network import WLAN
    >>> STA = WLAN(0);
    >>> STA.connect('__SSID__', '__PASSWORD__')
    >>> STA.ifconfig()  # Outputs the network configuration. If it is not valid, wait and re-execute
  2. Download the MQTT library and upload it to your ESP8266 with the name using the WebREPL.

  3. Clone this repository or download and the files.

  4. Log into your Cloud4RPi account or create a new one.

  5. Copy your device's Device Token.

  6. Edit the file. Enter your Wi-Fi network data and paste the Device Token into the required variables.

  7. Connect the LED to GPIO12 and a button to GPIO16. If you need to use other pins, change the corresponding variables in

  8. Transfer the and edited files to your ESP8266.

  9. Reset the ESP8266. You can use the console for this:

    >>> import machine
    >>> machine.reset()
  10. Check that the device goes online and starts sending data.

  11. Go to the Control Panels page and add a new control panel.

  12. Add two Switch widgets and bind them to the LED variable.

  13. Add a new Text widget and bind it to the Button variable. Configure different colors for the "true" and "false" strings.

You can use this control panel to control the LED and see when the button is pressed.

See Also


No releases published


No packages published