Barcode Scanner DE2120 - Get/Set Serial Number (or ID)

Hello,

I am using n.8 DE2021 barcode scanners in USB-COM mode.

I need to be able to distinguish the individual readers, is it possible to do this by assigning them a Serial Number or a unique ID?

I would like to program a unique SN for each reader so as to activate them in desired order.

Does the Base Software already have an ID to read?

Thanks for collaboration.

I don’t have more than one to test, but I’d assume that each will be assigned the same hardware ID; what you could do is:

  1. Plug them in 1 at a time, noting which COM port each is assigned

  2. Label each scanner with its associated COM port

  3. Open several terminals to interface with each COM port/scanner individually

  4. Leave them plugged in forever :-p

Or just use an arduino or similar to control them individually with code

Arduino https://github.com/sparkfun/SparkFun_DE … no_Library

Python https://github.com/sparkfun/DE2120_Py

Thanks TS-Russel,

unfortunately the PC does not recognize the devices and assigns the same COM to multiple devices, I’ll try to explain better.

I have two readers A and B:

  • Connect A and receive COM6

  • I disconnect A and connect B, the same COM6 is assigned to B.

I’m not sure that every time the PC is turned on, the COMs are assigned randomly. I need to be certain of the devices and their location/COM.

I will do some tests but it would be better to get/set a serial number for each device.

Thanks again.

Hi,

These devices don’t have any logic built in to store a unique ID.

The USB port management is something that is managed by your operating system. If different ports get a different address after reboot, this is expected behavior (the essence of what USB is). How you could tweak it, depends on your OS. You could try figuring out how to fix the names of your USB devices in your OS.

For example under Linux, you could use udev rules. Here’s an interesting discussion on the topic:

https://unix.stackexchange.com/question … tatic-name

You could then walk through the attributes using something like

udevadm info –attribute-walk –path=/dev/ttyS0

(or whatever the ports are named)

… and see if something is different per device.

I think the easier solution might be to indeed go over UART and connect each of the devices to some small Arduino (compatible) device. If you use something like an RF Nano to communicate, they even become wireless (RF) with a range of tens of meters. https://www.anyonecanbuildrobots.com/po … he-rf-nano

I just tried scanning the version number bar code for the two devices I had here.

Don’t know if it’s a coincidence, or if the last part is some kind of increment counter.

These are the 2 scan results:

firmware;sg2238u210a312g180-20210108

firmware;sg2238u210a312g180-20210517

So I’m not sure if the last part (2021XXXX) is purely the production date, or an actual serial number for that year.