Code Monkey home page Code Monkey logo

esp8266-micropython's Introduction

ESP8266 MicroPython Demo

MicroPython demo on NodeMCU with ESP8266 (WiFi). Fake temperature data will be posted to API every 10 seconds.

用 Python 玩硬體:MicroPython 簡介與實作

Setup NodeMCU & Tools

  1. Install tools
    1. esptool for communicating with ESP chips: $ pip install esptool
    2. ampy for serial connection with MicroPython boards: $ pip install adafruit-ampy
  2. Deploy firmware
    1. Plug in the device
    2. Get port name of device: $ ls /dev/tty.*
    3. Download firmware from MicroPython downloads page
    4. Deploy: $ esptool.py --port <port-name> write_flash --flash_size=detect 0 <firmware-file>

Usage

  1. Create an API for posting data, e.g. Firebase
  2. Copy config.py.template to config.py, replace the placeholders with real values
    1. WiFi SSID and password
    2. API (can replace the whole string with your own url if not using Firebase)
  3. Upload code
    1. Get port name of device: $ ls /dev/tty.*
    2. Upload code to board: $ ampy --port <port-name> put boot.py main.py config.py
  4. Reset NodeMCU, i.e. press the reset button, the LED will flash after release; main.py will run, data sent at 10 sec interval
  5. Check API console for the data posted; the LED will also flash after each data upload

esp8266-micropython's People

Contributors

pyliaorachel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.