I tried switching pins to TX and RX, manually telling the logger to use UART1, but I still have nothing on the logs.
Am I missing something obvious? (yes, the GM67 Bar Code has been setup to use the TTL 232 Interface… this sets: Serial port related configuration: Baud rate:9600, Data bit:8, Verification: No, Stop bit:1)
Thank you
EDIT: start logs with logger on UART1 and uart pins TX and RX:
I tried using your working config for my bar code scanner. The scanner is a different model, but I don’t think that is an issue as I can see the bar codes I scan show up in the logs. What I am not seeing is the scanned code in home assistant. The text sensor just stays at unknown all the time in Home Assistant. It seems like I am close to having it working I just don’t know esphome well enough to figure out what to adjust. I tried changing the delimiter in the uart section to \r as that shows up in the logs, but it didn’t help.
Not sure it this is still relevant to you, but I had the same problem: values weren’t sent to Home Assistant. I created the lambda code myself. So no need for the external component. This is my working code:
Edit: added a character count to avoid misscans. Bar code is 13 characters, but 14 are read from the uart including the r.
I had a similar struggle to get it working, but I’m using a GM60 barcode scanner module. I had to modify the lambda slightly, to remove the length checking and then I started to get barcodes read into the logs and published to a text sensor.
I’m using an esp32 d1 mini and hardware UART1 for the connection to the GM60.
I was originally trying to use a guide i found that is in German, but it appears it is for an older version of esphome and I currently don’t have the knowledge to update it SmartHome Yourself - Barcode Scanner for ESPHome
Over the last couple of days I have been troubleshooting a new setup with a GM67 scanner, I expected this to be easy because I am using code that has been running flawless for several years (apart from some minor tweaks, my code is similar to what you have published).
I finally identified the issue as a problem with the factory settings of the GM67. What I did was enable config and reset to factory using the barcode in the manual. That did not work even though the manual says factory uses UART/ 9600 by default
My problem was solved by manually configuring the scanner : setup on, factory reset, UART mode, 9600 baud. No other changes, everything worked.