print(conf["pin"])
- # Export pin, write value, unexport
+ # Export pin, configure, write value, unexport
open_ssh(server, "echo " + str(conf["pin"]) + " > /sys/class/gpio/export")
- open_ssh(server, "cat /sys/class/gpio/gpio" + str(conf["pin"]) + "/value")
+ open_ssh(server, "echo high > /sys/class/gpio/gpio" + str(conf["pin"]) + "/direction")
+ open_ssh(server, "echo " + str(state) + " > /sys/class/gpio/gpio" + str(conf["pin"]) + "/value")
open_ssh(server, "echo " + str(conf["pin"]) + " > /sys/class/gpio/unexport")
COMMANDS = {