Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankkkkk/python-hhc-n10
Python lib to pilot an HHC-N10 "ethernet relay"
https://github.com/frankkkkk/python-hhc-n10
hhc-n10 hhc-n1o n8i8op relay
Last synced: 10 days ago
JSON representation
Python lib to pilot an HHC-N10 "ethernet relay"
- Host: GitHub
- URL: https://github.com/frankkkkk/python-hhc-n10
- Owner: Frankkkkk
- Created: 2021-09-10T16:22:10.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-10T05:04:46.000Z (over 1 year ago)
- Last Synced: 2024-11-01T12:05:21.674Z (19 days ago)
- Topics: hhc-n10, hhc-n1o, n8i8op, relay
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-hhc-n10
## What is this lib ?
This library is made to communicate with HHC-N10 devices. They are relays that can be toggled via ethernet (TCP/IP).## How to install the lib ?
You can get it from [pypi](https://pypi.org/project/python-hhc-n10/) like so:
```
pip3 install python-hhc-n10
```## How to use the lib
```python3
import time
from hhcn10 import hhcn10h = hhcn10.HHCN10()
h.set_relay(True)
print('The relay is: ' + str(h.read_relay()))time.sleep(1)
h.set_relay(False)
print('And now the relay is: ' + str(h.read_relay()))
```Please note that the implementation of their TCP stack is finnicky and only accepts 5 parallel connections. If you try to open too many sockets at once the relay will hang for some time.
## Default params
The relay default's IP is `192.168.0.105/24`. If your computer is not in this same subnet, you'll need to add a static route + a static IP in the same subnet as this relay. You can then change the device's IP using the `change_ip(addr, netmask, gw)` method.