13.07.2019, 15:12
(This post was last modified: 13.07.2019, 15:17 by Carlos Padilla.)
Hi, I share with you the script by event that works to turn an EPSON projector on and off using snmp.
Code:
val=event.getvalue()
require('snmp')
conn, err = snmp.open({
version = snmp.SNMPv1,
community = 'public',
peer = '192.168.0.248',
})
assert(conn, err)
if val==true then
vbIn = {
{oid = "1.3.6.1.4.1.1248.4.1.1.2.1.0", type=snmp.TYPE_INTEGER, value = "1"}
}
vbOut, err, index = conn:set(vbIn)
else
vbIn = {
{oid = "1.3.6.1.4.1.1248.4.1.1.2.1.0", type=snmp.TYPE_INTEGER, value = "0"}
}
vbOut, err, index = conn:set(vbIn)
end
conn:close()