Skip to content

GPIO configuration

Gunnar Skjold edited this page Apr 20, 2024 · 6 revisions

HAN

Select the pin that your meter is connected to. Normally you will only need a RX pin, but some meters require the device to request data before receiving. A TX pin will then be required, but also a compatible communication protocol needs to be selected in Meter configuration. Uncheck the "pullup" checkbox to disable the default pullup on the RX GPIO.

On all ESP32 chips hardware serial will be used.

On ESP8266 there will be two different types of serial devices in the list:

  • UART - These are available hardware serial ports. It is recommended to use hardware serial for stability
    • UART2 is pin swap of UART0
  • GPIO - General pin on your ESP. Software serial will be set up for this pin

AP button

A button that can be used to swap between normal WiFi mode and AP mode (for configuration). For known devices that have a suitable button, this will be configured by the selection of board type in initial setup. For generic board type this will not be configured by default. The reason behind this is that different development cards may have voltage dividers and pull up/down resistors connected to the configured pin which in turn could render the software unresponsive.

LED

Configuration of the pin where LED is connected. The LED is used to indicate when valid data is received, errors and AP mode

  • LED - A general LED that can be used when a colored LED is not available. Set pin number and check "inv" is signal should be inverted
  • RGB - Color LED used to indicate received data, errors and AP mode. Set pin number and check "inv" is signal should be inverted
    • Green - Valid data received from meter
    • Yellow - AP mode
    • Red - Error messages
      • If no message received from AMS in 30 sec, blink once
      • If MQTT error, blink twice
      • If WiFi not connected, blink three times

Temperature

Configure where DS18B20 sensors are connected. Read more in the Temperature sensors section

Analog temp - Pin where a analog temperature sensor is connected. Read more in the Temperature sensors section

Vcc

Voltage sensing for the power supply for the unit (3.3v).

  • Pin - Select a pin where Vcc is connected. A voltage divider should be used
  • GND resistor - The value of the resistor between the pin and GND, in kohm
  • Vcc resistor - The value of the resistor between the pin and Vcc, in kohm

For ESP8266, the internal voltage sensor is enabled. Some ESP8266 development cards have a voltage divider connected to A0 which will disturb the internal sensor. In these cases, use offset and multiplier to get correct reading.

  • Multiplier - A multiplier to correct the Vcc reading
  • Offset - To offset a incorrect 0 value for Vcc
  • Boot limit - If the voltage is below this limit during boot, the software goes into deep sleep for 10 seconds