Giter VIP home page Giter VIP logo

Comments (3)

fhold avatar fhold commented on August 26, 2024

Any news on this? I'm also looking for a solution

from barcodebuddy-homeassistant.

juancb avatar juancb commented on August 26, 2024

Overview of solution

If you have a USB barcode scanner, like the Bur3069-2d wireless USB barcode scanner that I'm using, you only need to expose the /dev/input/eventX device as in the Barcode Buddy Docker Documentation to the Docker container. This is done via the config.json by forking this repository and making the change.
Here is my change to the config.json

  "devices": [ "/dev/input/event0" ],
  "environment": {
    "ATTACH_BARCODESCANNER": "true"
  },

I have no idea how Homeassitant works under the hood so I don't know if there's a way to expose those config.yaml variables to the UI to allow the user to set their input, but that would be one way to make this easier for users. I started looking at these docs, but they only scratch the surface. I'll keep looking but hopefully someone with a better working knowledge of HA can chime in.

Determining your input device

If you are running on a Raspberry Pi without a keyboard, mouse, or anything other than the barcode scanner that might show up as an HID device, then you can stick to using /dev/input/event0. Otherwise, you'll have to figure out which event device to use.

# ls -l /dev/input/event*
crw-rw----    1 root     input      13,  64 Sep 19 02:07 /dev/input/event0

You can verify that the device is your barcode scanner by dumping the device on your screen and scanning a barcode. If you see a bunch of garbage after pulling the trigger, you'll know you have the correct device; you might want to try if you have more than one device to ensure the output isn't a coincidence.

# cat /dev/input/event0
M'cc    ��%M'cc �       �M'cc   M'ck    ��%M'ck �       M'ck    M'cs    ��#M'cs ��M'cs  M'c?{   ��#M'c?{        �M'c?{  M'cU    ��'M'cU ���M'cU M'c    ��'M'c ��M'c  M'c
��'M'c  ���M'c  M'c>    ��'M'c> ��M'c>  M'c     ��'M'c  ���M'c  M'c     ��'M'c  ��M'c   M'c     ��#M'c  ��M'c   M'c     ��#M'c  �M'c    M'cc    ��#M'cc ��M'cc  M'cL    ��#M'cL     �M'cL   M'c�    ��'M'c� ���M'c� M'c     ��'M'c  ��M'c   M'c     ��#M'c  ��M'c   M'c~    ��#M'c~ �M'c~   M'c1    ��$M'c1 �M'c1   M'c�    ��$M'c� M'c�    M'c     ��'M'c      ���M'c  M'c

Root access

For troubleshooting or if you have more than one input device, you'll need SSH root access to the Raspberry Pi and HomeassistantOS; this was an infuriating process for me trying to follow the official developer documentation scouring the forums until I ran across the HassOS SSH Port 22222 Configurator. Using that approach worked for me, the only trick there is that you must disable "Protection Mode" for it to work. After you run it without protection mode, you only need to hard reboot twice to get SSHD to come up and ready to accept your private key.

from barcodebuddy-homeassistant.

saya6k avatar saya6k commented on August 26, 2024

Hi, any update to this feature? I want to add USB barcode scanner to this addon.

from barcodebuddy-homeassistant.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.