Skip to main content

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")

Manually

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.

Metadata

Release files for micropython-async-websocket-client 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for micropython-async-websocket-client 0.3.4
File Size Uploaded
micropython_async_websocket_client-0.3.4.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for micropython-async-websocket-client 0.3.4
File Interpreter ABI Platform
micropython_async_websocket_client-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / micropython_async_websocket_client-0.3.4.tar.gz

Download URL micropython_async_websocket_client-0.3.4.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
664edcd5ff01fb85de9cb2c059912866ecb9ea6c51baa1eb07247e093e91ed03
BLAKE2b-256 checksum
How to use checksums
b889504fa417dfe5a9380bfcfe93089af032ac6e40b349e008a85201c46585aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / micropython_async_websocket_client-0.3.4-py3-none-any.whl

Download URL micropython_async_websocket_client-0.3.4-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fac6cd254779e38242dc4977f49bc4bf06a2e73e497976d4dd8dd87684d85bd
BLAKE2b-256 checksum
How to use checksums
8e41a1b376ef39e49aeb0ebf1dfef20feb666a56b1d0549005041083c4d5d957
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page