Koukaam NETIO-230B

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
HTPCanwender
Posts: 48
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Koukaam NETIO-230B

Post by HTPCanwender » Mon Mar 31, 2014 6:58 am

I wrote a short script to switch the ports of a Koukaam NETIO. A description of the NETIO can be found at:

http://www.koukaam.se/kkm/showproduct.p ... le_id=1502

I found some python code for the NETIO at

http://waky.num.math.uni-goettingen.de/ ... /netio230a

but I am not able to use it.

My script just sends the commands via Telnet and does not care about the answer. I am not a prgrammer, so I am not able to develop a plugin. Before using the code, the NETIO has to be configured with the web Interface.

Code: Select all

# NETIO 230B Port switching

import telnetlib

host = "192.168.1.70"  # has to be configured with the web Interface of the NETIO
port = "1234"          # has to be configured with the web Interface of the NETIO
user = "admin"         # has to be configured with the web Interface of the NETIO
password = "admin"     # has to be configured with the web Interface of the NETIO

# uncomment one of the following lines to select a command
command = "1uuu"  # Port1 on
# command = "0uuu"  # Port1 off
# command = "u1uu"  # Port2 on
# command = "u0uu"  # Port2 off
# command = "uu1u"  # Port3 on
# command = "uu0u"  # Port3 off
# command = "uuu1"  # Port4 on
# command = "uuu0"  # Port4 off

tn = telnetlib.Telnet(host, port)
tn.write("login " + user + " " + password + "\n")
tn.write ("port list " + command + "\n")
tn.write("quit\n")
tn.close()

Post Reply