Unable to get UART to receive

Hey,

I’m really struggeling to get my esphome to receive something over UART.

I bought a IR-Read-Head to connect to my smart meter (hardware:controllers:ir-schreib-lesekopf-ttl-ausgang [wiki.volkszaehler.org]).

It’s wired correctly to the RX-Pin of my Wemos D1 Mini, but I’m unable to see at least a byte being received via uart.

What did I try?

  • The smart meter sends IR data (verified with phone camera)
  • With my multimeter I could see the voltage on the RX Pin drop from 3.3V slightly every second (the sending interval of the smart meter)
  • I double checked the communication settings (9600 Baud, 7E1) with the specification of the smart meter
  • I tried all combinations of INPUT_PULLUP, INPUT, inverted for the pin
  • I activated software uart - was hoping to see more debug output. But it doesn’t show any.
  • Instead of the UART platform, i tried the remote_receiver, which logged me tons of received signals, so something seems to be received via infrared - just not ending in UART.

This is my config right now:

esphome:
  name: "stromzaehler"

esp8266:
  board: esp01_1m

[...]

uart:
  id: uart_bus
  baud_rate: 9600
  rx_pin: 
    number: GPIO03
  data_bits: 7
  parity: EVEN
  stop_bits: 1
  debug:
    after:
      timeout: 100ms

I have no idea how to debug this further… is there a way to get more debug-information about what’s going on inside the uart (maybe checksum mismatch, wrong baudrate, whatever)…

Anyone an idea how to debug this further?

Thanks, David

Start with hardware, then protocol, then software.

One question - does the sensor really output RS232 data at a known rate (e.g. 96008N1), or is the UART really just a GPIO used to bit-bang read an arbitrary protocol (similar to remote control IR codes)?

  • Connect the sensor head to something else - e.g. a USB FTDI serial board set to 3V3.

  • Reverse Tx / Rx

  • Change bps speed - do you get anything? Even noise should generate rubbish.

  • Link Tx to Rx to check your terminal emulator

  • Is the signal inverted? (mark-space would be wrong)

  • Try a sound card as a crap oscilloscope?

  • Use the FTDI board to send known serial to ESPhome

The “sound card as oscillosope” tip was great… i tried it and saw that my settings are right.

I solved the problem, it was actually just a stupid error on my side. For UART Input to be logged, the dummy_receiver in esphome needs to be enabled. I did it and now everything works fine.