https://github.com/khudaibirdin/micropython_nats_client
Library to create micropython NATS publisher.
https://github.com/khudaibirdin/micropython_nats_client
iot m2m micropython micropython-esp32 nats nats-client
Last synced: about 1 month ago
JSON representation
Library to create micropython NATS publisher.
- Host: GitHub
- URL: https://github.com/khudaibirdin/micropython_nats_client
- Owner: khudaibirdin
- License: mit
- Created: 2025-09-11T05:57:14.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-13T13:06:00.000Z (9 months ago)
- Last Synced: 2025-09-19T14:36:03.212Z (9 months ago)
- Topics: iot, m2m, micropython, micropython-esp32, nats, nats-client
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Description
To collect data from the MCU on Micropython, there are only libraries with support for the MQTT protocol. Undoubtedly, this protocol is well suited for IOT interaction.
At the moment, it is possible to collect data using EDA systems, such as NATS, which is lightweight and the most modern and fastest.
The library allows you to implement the NATS PUBLISHER client in Micropython.
# Usage
## Installation
Copy micropython_nats_client folder into mcu directory.
## Pub to NATS
```python
from nats.publisher import Publisher
NATS_HOST = "192.168.31.102" # nats server host
NATS_PORT = 4222 # nats server port
# implement ethernet connection via Wi-Fi/LAN
np = Publisher(
host=NATS_HOST,
port=NATS_PORT
)
np.send(
topic="test",
msg=f"Test message"
)
```