Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cloud4RPi Library and Examples for ESP8266 with MicroPython

License

NotificationsYou must be signed in to change notification settings

cloud4rpi/cloud4rpi-esp8266-micropython

Repository files navigation

Build Status

Running the Sample Code

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

    >>>fromnetworkimportWLAN>>>STA=WLAN(0);STA.active(1)>>>STA.connect('__SSID__','__PASSWORD__')>>>STA.ifconfig()# Outputs the network configuration. If it is not valid, wait and re-execute
  2. Download theMQTT library and upload it to your ESP8266 with the namemqtt.py using theWebREPL.

  3. Clone this repository or downloadcloud4rpi.py and themain.py files.

  4. Log into your Cloud4RPi account orcreate a new one.

  5. Copyyour device'sDevice Token.

  6. Edit themain.py file. Enter your Wi-Fi network data and paste theDevice 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 inmain.py.

  8. Transfer thecloud4rpi.py and editedmain.py files to your ESP8266.

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

    >>>importmachine>>>machine.reset()
  10. Check that thedevice goes online and starts sending data.

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

  12. Add twoSwitch widgets and bind them to theLED variable.

  13. Add a newText widget and bind it to theButton 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

About

Cloud4RPi Library and Examples for ESP8266 with MicroPython

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp