In my yocto - image (which is nearly the same as the meta-iot-example), there is no ttyUSB.
Usb Hid Keyboard Barcode Scanner Mod Module SizeSo my question is, if there is another way to get the data from the barcode scanner Here some addional and maybe helpful informations: rootiot2000: lsmod Module Size Used by i2cdev 4898 0 galileogen2fake 880 0 galileouiogpio 1756 0 uio 6565 1 galileouiogpio spidev 4995 0 galileospi1spidev 916 0 adc1x8s102 3646 0 industrialiotriggeredbuffer 969 1 adc1x8s102 kfifobuf 2279 1 industrialiotriggeredbuffer industrialio 33236 3 industrialiotriggeredbuffer,adc1x8s102,kfifobuf ID 13ba:0018 should be the barcode scanner: rootiot2000: lsusb Bus 002 Device 002: ID 13ba:0018 Bus 001 Device 001: ID 1d6b:0002 Bus 002 Device 001: ID 1d6b:0001 I am grateful for any suggestions.So far the code only prints out each digit the scanner reads (and a newline when the scanner sends the enter key), but I think its a good starting point.
The USB descriptors show the barcode reader is not in USB HID keyboard mode so the sketch will not work. Debug that ONE thing until that ONE thing works reliable - repeat. Usually scanners are connected to a PC where the PC acts as the USB-host- controller anything similar to a keyboard or a mouse acts as an USB-host and requieres an USB-host- controller as only the USB-host- controller can initiate communication. The libraries names.hid.h sound like these libraries act as USB-host. If you really want to work with the USB-interface of the scanner I guess your arduino needs libraries that act as USB-host- controller This is another example that tinkering with microcontrollers is not superstandardised as USB-devices that are intended to be plugged into a PC-USB-socket or at least something PC-like like a rasperry pie Ordeiod etc. If no USB-host- CONTROLLER -libs are written for Arduino I guess it will be much easier to use a second serial interface. So changing to an ESP32 board which has GPIO-pins 16 17 (which us Uart 2) connected or an Arduino Mega 2560 which has four hardware UARTS will be easier to use. If I use a Arduino Mega 2560 what is a difference from Arduino uno. ![]() A serial interface based on pure software (softwareserial) must have some processor-time to make it work and the baudrate cant be very high. While your Arduino is delay-ING nothing serial can be received through a software-serial interface. Which means the processor can be busy with other things and still can receive serial bytes on four interfaces at the same time (almost) in parallel. As the processor can NOT predict when serial data will rush in the processor has to be prepared all and any time for receiving. Usb Hid Keyboard Barcode Scanner Bluetooth On BoardESP32-boards that have already WiFi and Bluetooth on board are at 10 to 15 Euros. As long as the higher electricity consumption of the ESP32 (needs up to 300 mA) is not a problem my opinion is: the ESP32 is the better Arduino. Testdebug that ONE thing until that ONE thing works reliable - repeat. The sad thing is: only the REAL professionals write code this way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |