Have unfortunately not the knowledge to write a corresponding plugin.
I use the board via a shellscript.
A plugin would be better …
documetation: https://s3-ap-northeast-1.amazonaws.com/sain-amzn/20/20-018-929/20-018-929.zip
SainSmart Ethernet-Control-Module-Plugin
Have unfortunately not the knowledge to write a corresponding plugin.
I use the board via a shellscript.
A plugin would be better …
documetation: https://s3-ap-northeast-1.amazonaws.com/sain-amzn/20/20-018-929/20-018-929.zip
@weini You don’t need to write a plugin. You can use pimatic-shell-execute to control the relays using curl commands as the web interface is very simple to use.
http://192.168.1.4/30000/00 : Relay-01 OFF
http://192.168.1.4/30000/01 : Relay-01 ON
http://192.168.1.4/30000/02 : Relay-02 OFF
http://192.168.1.4/30000/03 : Relay-02 ON
http://192.168.1.4/30000/04 : Relay-03 OFF
http://192.168.1.4/30000/05 : Relay-03 ON
…
http://192.168.1.4/30000/14 : Relay-8 OFF
http://192.168.1.4/30000/15 : Relay-8 ON
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
depending on what you want to do and how many relays you want to switch. i am using ESPimatic to switch a 4x relais. it’s based pn an esp266 chip with built in wifi. with this hardware you will save some money and do not need any lan cables.
here’s our ESPimatic forum https://forum.pimatic.org/category/25/espimatic
here’s the git repo https://github.com/koffienl/ESPimatic
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
Thanks for your answers, I have 2x 16 relayboards in use.
I already use shellexecute, but with ip / port / 99 the status of the relays can be queried.
It was just a suggestion of me to create a plugin because I think for someone who knows how it goes, it is not too much difficulty.
The problem is, however, that command 99 is poorly documented. Maybe you can post some sample response data for the command along with current state of the relays? This’ll be great.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
ok, i switched Relay 1,2 and 15 on
with the command http://192.168.0.112/30001/99 I get as answering text following link >> 1100000000000010192.168.0.112&PassWord << as the login page http://192.168.0.112/30001
@weini said in SainSmart Ethernet-Control-Module-Plugin:
ok, i switched Relay 1,2 and 15 on
with the command http://192.168.0.112/30001/99 I get as answering text following link >> 1100000000000010192.168.0.112&PassWord << as the login page http://192.168.0.112/30001
I think this can be used to query the status with pimatic-shell-execute. Can please execute the following on the raspi command line and post the output? Thanks
curl -s -H 'Accept:' 'http://192.168.0.112/30001/99'
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
pi@raspberrypi:~ $ curl -s -H ‘Accept:’ ‘http://192.168.0.112/30001/99’
<small><a href=“http://192.168.0.112/30001”></a></small><a href=“http://192.168.0.112/30001/0000010000000000192.168.0.112&PassWord”>0000010000000000192.168.0.112&PassWord</a><p>
Relay 6 is on
The next problem is, all boards have the same MAC address…
I can only control one board (i have two), when i switched one board i have to wait 1 to 2 minutes until the second responds…
@weini said in SainSmart Ethernet-Control-Module-Plugin:
Relay 6 is on
That’s great. You can read the relay status for relay number 6 as part of ShellSwitch getStateCommand as shown below. Make sure you have html2text
installed. You can install it with following command: sudo apt-get -y install html2text
curl -s -H 'Accept:' 'http://192.168.0.112/30001/99' | html2text | cut -c6
The next problem is, all boards have the same MAC address…
That’s bad luck and it seems to be a know problem with this device. If you have the chance to return the devices you should do that because you’ll not be able to use more than one device on the same network. It might be able to change the MAC address but I could not find documentation for this. It is possible to setup a fixed IP address as described in the following video - https://www.youtube.com/watch?v=hT78mp7ApK0
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law