from numato_eth.eth import Eth_Module

#Please change the number of Relays and COM Port accordingly.

Gpio = Eth_Module(numberGpios=16, deviceIP="192.168.10.190", username="admin", password="admin")

print(Gpio.dev_info())

#To get the version of the module
print(Gpio.ver())

#To get the Device Id 
print(Gpio.id_get())

Gpio.id_set("12345678")
print(Gpio.id_get())

print(Gpio.usr_get())
Gpio.usr_set("admin")
print(Gpio.usr_get())

print(Gpio.pass_get())
Gpio.pass_set("admin")
print(Gpio.pass_get())

#To turn on a single Gpio & read the status

for i in range(0,16):
    if(i>=10):
        i=chr(i+55)
    Gpio.gpio_set(i)

for i in range(0,16):
    if(i>=10):
        i=chr(i+55)
    print(Gpio.gpio_read(i))

for i in range(0,16):
    if(i>=10):
        i=chr(i+55)
    Gpio.gpio_clear(i)

for i in range(0,16):
    if(i>=10):
        i=chr(i+55)
    print(Gpio.gpio_read(i))

for i in range(0,16):
    if(i>=10):
        i=chr(i+55)
    print(Gpio.adc_read(i))


print(Gpio.gpio_readall())
Gpio.gpio_iodir("0000")
Gpio.gpio_iomask("ffff")
Gpio.gpio_writeall("a234")
print(Gpio.gpio_readall())

#To get the Module status
print(Gpio.info())

print(Gpio.notify_get())
print(Gpio.notify_set(0))

Gpio.reboot()

