Giter Site home page Giter Site logo

chleba / esp32modbustestmicropython Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 544 KB

ESP32 TTGO T-Display example with micropython FW. Testing implementation of ModBus library, ST7789 display library with romfonts, WiFi & WebSocket connection and using few threads.

License: GNU General Public License v3.0

Python 99.70% Shell 0.30%
esp32 micropython micropython-esp32 modbus st7789-display ttgo-t-display websockets wifi

esp32modbustestmicropython's Introduction

esp32modbusTestMicropython

Micropython for ESP32 TTGO T-Display with micropython FW. Testing examples with implementation of

  • ModBus library
  • ST7789 display library with romfonts
  • WiFi & WebSocket connection
  • threads

Used libraries

Micropython FW

Used tools

First run / installations

  • connect ESP32 TTGO T-Display with USB to a PC
  • download Micropython FW (v1.19.1>)
  • erase flash on ESP32
    • esptool.py --chip esp32 --port /dev/ttyACM0 erase_flash
  • upload new FW onto ESP32
    • esptool.py --chip esp32 --port /dev/ttyACM0 --baud 460800 -z 0x1000 write_flash ./micropythonfw.bin
  • hard reset ESP32 board
  • via rshell connect to the ESP32
    • rshell -p /dev/ttyACM0 -b 115200
  • board will mount after connecion it's flash disk into a /pyboard/ directory
  • upload files into that directory via cp ./files/* /pyboard/
  • after all files is uploaded you may hard reset the ESP32 board
  • type repl in rshell to see serial outpur
  • type python server.py to run websocket testing server

Usage

This testing App is just trying to make some performance observations. It will make two threads. One with rendering scanned WiFi networks on st7789 display. Second that will work with networking. Board is doing:

  • create two threads
  • create station WiFi
  • every 2.seconds scan WiFi networks
  • every 2.seconds create WebSocket client & connect to WebSocket server to send & recieve message
  • outputing debug messages into a USB serial
  • rendering scaned WiFi's to display
  • creating text file with R/W on flash storage
  • !!! implemented umodbus library BUT getting allocation memory fail error - TODO (need more work with used memory on ESP32 board)

esp32modbustestmicropython's People

Contributors

chleba avatar

Stargazers

 avatar

Watchers

 avatar  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.