GPIO mode: input or output?
Posted: 14 May 2021, 14:18
Today I tried to assign a GPIO as a switch. My intention was to be an output switch.Defined a new task, gpio15 as "switch", "normal switch". After that tried the toggle command via http. Response: "Failed" in browser. In log we have:
58221346: HTTP: GPIOtoggle,15
58221347: HTTP after parseTemplate: GPIOtoggle,15
58221349: Command: GPIOtoggle
58221350: GPIOtoggle,15
58221351: Par1: 15 Par2: 0 Par3: 0 Par4: 0 Par5: 0
58221352: GPIO : port#15 is not an output port Strange...
Tried with http commands:
http://192.168.4.32/control?cmd=GPIO,15,0
http://192.168.4.32/control?cmd=GPIO,15,1
Response OK: After that device responds normally on gpiotoggle command: FEATURE REQUEST
One more proof to REDEFINE the switch plugin. As INPUT PORT or as OUTPUT PORT.
58221346: HTTP: GPIOtoggle,15
58221347: HTTP after parseTemplate: GPIOtoggle,15
58221349: Command: GPIOtoggle
58221350: GPIOtoggle,15
58221351: Par1: 15 Par2: 0 Par3: 0 Par4: 0 Par5: 0
58221352: GPIO : port#15 is not an output port Strange...
Tried with http commands:
http://192.168.4.32/control?cmd=GPIO,15,0
http://192.168.4.32/control?cmd=GPIO,15,1
Response OK: After that device responds normally on gpiotoggle command: FEATURE REQUEST
One more proof to REDEFINE the switch plugin. As INPUT PORT or as OUTPUT PORT.