Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiagocoutinho/us2n
micropython bridge between UART and TCP for the ESP32
https://github.com/tiagocoutinho/us2n
bridge esp32 micropython tcp uart wifi
Last synced: 12 days ago
JSON representation
micropython bridge between UART and TCP for the ESP32
- Host: GitHub
- URL: https://github.com/tiagocoutinho/us2n
- Owner: tiagocoutinho
- License: gpl-3.0
- Created: 2017-11-26T22:49:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-16T16:50:14.000Z (almost 7 years ago)
- Last Synced: 2024-04-22T12:33:34.650Z (7 months ago)
- Topics: bridge, esp32, micropython, tcp, uart, wifi
- Language: Python
- Size: 28.3 KB
- Stars: 20
- Watchers: 5
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - us2n - MicroPython bridge between UART and TCP for the ESP32. (Libraries / Communications)
README
# micropython ESP32 UART to TCP bridge
A micropython server running on an ESP32 which acts as a bridge
between UART and TCP (LAN/WLAN).## Installation
Follow steps to install *esptool* and *micropython for ESP32*.
Then...
* clone me, oh please, clone me!
```bash
$ git clone [email protected]/tiagocoutinho/us2n
```* Create a file called `us2n.json` with a json configuration:
```python
import json
config = {
"name": "SuperESP32",
"verbose": False,
"wlan": {
"sta": {
"essid": "",
"password": "",
},
},
"bridges": [
{
"tcp": {
"bind": ["", 8000],
},
"uart": {
"port": 1,
"baudrate": 9600,
"bits": 8,
"parity": None,
"stop": 1,
},
},
],
}with open('us2n.json', 'w') as f:
json.dump(config, f)```
* Include in your `main.py`:
```python
import us2n
server = us2n.server()
server.serve_forever()
```* Load the newly created `us2n.json` to your ESP32
* Load `us2n.py` to your ESP32
* Load `main.py` to your ESP32
* Press reset
The server board should be ready to accept requests in a few seconds.
## Usage
Now, if, for example, your ESP32 UART is connected to a SCPI device,
you can, from any PC:```bash
$ nc 8000
*IDN?
ACME Instruments, C4, 122393-2, 10-0-1```
That's all folks!