Skip to main content

Asynchronous websocket client for ESP32 controller.

Project description

This module is only for micropython!

micropython-async_websocket_client

This module is designed for ESP32 (and other) controllers.

Target: create and keep alive connection channel with websocket server.

You may send captured data from controlled devices through this channel to server and accept managing signals on your controller.

This data channel works as background task while main control cycle is running too. The break of websocket channel doesn't corrupt main cycle of control.

Module supports TLS with both client and server certificates.

This project based on:

https://github.com/danni/uwebsockets

https://github.com/peterhinch/micropython-async

My gratitudes to authors.

requirements

This module is designed and tested on ESP32S-WROOM-32.

Development and tests were done based on ESP32-20250415-v1.25.0.bin.

installation

Through network

Run this commands on your controller:
You have to reflash your board with [micropython](https://micropython.org/).
Details are explained in https://github.com/Vovaman/start_ESP32_with_micropython.
You may use VSCode as explained in link above or use `picocom` tool (also explained) to connect your board and run python console (REPL) on it.
So, after you are in your board...
>>> import network
>>> wifi = network.WLAN(network.STA_IF)
>>> wifi.active(1)
>>> wifi.connect(<name_of_your_wifi_net>, <wifi_password>)
>>> import mip
>>> mip.install("github:Vovaman/micropython_async_websocket_client/async_websocket_client/ws.py")

Manual

You have just copy ws.py file to /lib folder in controller.

Example with mpremote:

$ mpremote fs mkdir /lib
$ mpremote fs cp async_websocket_client/ws.py :/lib/

All needed dependencies are in firmware.

example

An example of how to use this module can be found in the https://github.com/Vovaman/example_async_websocket.

Use this example instead of documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micropython_async_websocket_client-0.3.2.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file micropython_async_websocket_client-0.3.2.tar.gz.

File metadata

File hashes

Hashes for micropython_async_websocket_client-0.3.2.tar.gz
Algorithm Hash digest
SHA256 7db6ef567086d9d8de5bc201943774a4c1e3d9f6db4b4cee00f425d4594a562f
MD5 4837b9336f6d22f478a285925a2b516e
BLAKE2b-256 1ede7c10b089f1c7e640d5f7b4010e781d287a18381164587eb343bff18076cc

See more details on using hashes here.

File details

Details for the file micropython_async_websocket_client-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for micropython_async_websocket_client-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 038a1e875af179b81a7b19d1d5cba2586e397d3bcac4200d80faf03a84194d57
MD5 729b5b9726e2f3204fdab3324de0de1d
BLAKE2b-256 7e96670c0a4fcd345c67f8faddfa6748b1f77d08cc6086c6113ccf291a7a30aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page