I bought some weeks ago a Ethernet-controllable 2-relay board. While my Chinese Top Seller could not provide any documentation for the item I had to find things myself.
The default IP for the device is 192.168.1.100. To control the device with my Linux device I found a nice Python script sr-201-relay. Since we know the IP of the board we can get rest of the configuration:
$ python sr-201-relay.py 192.168.1.100 config ip=192.168.1.100 netmask=255.255.255.0 gateway=192.168.1.1 (unknown)= power_persist=0 version=931 serial=XXXXX50E35000000 dns=192.168.1.1 cloud_server=connect.tutuuu.com cloud_enabled=0 cloud_password=(not-sent)
Excellent! Now we can change the network settings to suit with my LAN:
$ python sr-201-relay.py 192.168.1.100 gateway=0.0.0.0 $ python sr-201-relay.py 192.168.1.100 dns=0.0.0.0 $ python sr-201-relay.py 192.168.1.100 ip=192.168.2.11 $ python sr-201-relay.py 192.168.1.100 reset
First I tried to make sure the device does not reach Internet and finally I set a static IP from the correct LAN.
The script offers methods to turn relays on (closed) and off (open):
$ python sr-201-relay.py 192.168.2.11 close:1 $ python sr-201-relay.py 192.168.2.11 status relay status: 1-closed 2-open 3-open 4-open 5-open 6-open 7-open 8-open $ python sr-201-relay.py 192.168.2.11 open:1 $ python sr-201-relay.py 192.168.2.11 status relay status: 1-open 2-open 3-open 4-open 5-open 6-open 7-open 8-open