Asynchronous websocket client for ESP32 controller.
Project description
micropython-async_websocket_client
This module is designed for ESP32 (and other) controllers. Goal: 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.
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-20220618-v1.19.1.bin.
installation
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 upip
>>> upip.install('micropython-async-websocket-client')
All needed dependencies are in esp32-20220618-v1.19.1.bin.
example
Sample using of this module is in https://github.com/Vovaman/example_async_websocket.
0.2.0
Fix for big data packet. Author: mutatrum
0.1.9
Method close()
is added and example project (see link above) is changed
to demonstrate it.
0.1.8
Partial support for wss protocol is added. Author: huytranle
Disclaimer! Server and client certificates verification is not supported in this version. Waiting for new micropython release...
0.1.7
Websocket can send custom headers to server in handshake
function. Author: pluzmedia
0.1.6
First release.
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
File details
Details for the file micropython-async_websocket_client-0.2.0.tar.gz
.
File metadata
- Download URL: micropython-async_websocket_client-0.2.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d2ffa961cb23885cea45b00281c4220cc77e31d8828d7a4dac4ec6135f123d |
|
MD5 | 288054e993c2d74e097795440ec833e4 |
|
BLAKE2b-256 | 1807a63ab7bd2a7d6caaf501239a61a71289852dee0697f54a264d75d7bcfa41 |