Remote GPIO Control

ESPTerm provides a simple API to remotely control and read GPIO pins GPIO2, GPIO4, and GPIO5. The main use of this API is to remotely reset a device that communicates with ESPTerm through the UART.

GPIO2 is normally used for debug UART, so when used as GPIO, debug logging is disabled. You can configure the pin functions in System Settings.

The GPIO control endpoint is `/api/v1/gpio`, with optional GET arguments:

A quick example: `/api/v1/gpio?do4=1&pulse=500` sends a 500ms long positive pulse on GPIO4.

The GPIO endpoint always returns a JSON object like this: `{"io2":0,"io4":1,"io5":0}`, showing the current input levels. Input reading works always, regardless of the GPIO settings.