Chat freely about anything...

User avatar
By blavery
#32081 I have two devkit 1.0 devices (different manufacturers), the ones usually shipped as nodemcu, and three CP2102 usb-uart modules for connecting to other ESP versions. CP2102 (the USB-uart chip on each) unfortunately all ship from factory with same serial number "0001". So neither Windows nor Debian could tell them apart! Further, in Linux, unplugging would likely give a different ttyUSBx a moment later.

Here is how I solved this mess to (1) assign separate serial numbers and (2) lock in a fixed device name in linux.

Serial:
I downloaded CP2102's configuration utility an721sw.zip from here:
http://www.silabs.com/pages/Silabs-Search.aspx?q=an144sw
(I HAD been hunting for an144sw from untold google search results, but an144sw appears way obsolete and unfindable.)
It includes linux & mac & windows versions. I very quickly used the windows one: CP21xxCustomizationUtility.exe
Very simply, edit the 0001 to read 5431 or whatever takes your fancy, and press Program bar. In about 10 seconds a short log message appears, and it's all over. I set a unique serial for all my CP2102 devices.

Fixed port device name:
(Windows, I usually don't use, but the linux ttyUSBx renumbering was annoying, both in ESPlorer and Arduino IDE.)
I created /etc/udev/rules.d/99-usb-serial.rules with this content:
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0001", SYMLINK+="ESP-uart0"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0749", SYMLINK+="ESP-uart1"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="5113", SYMLINK+="ESP-uart2"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="1274", SYMLINK+="ESP-uart3"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0401", SYMLINK+="ESP-dk1-a"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="2994", SYMLINK+="ESP-dk1-b"

Now each uart might give unpredictable ttyUSBx number, but it also gets a fixed symlink or alias name, tied to serial number.

What's solved?
- ESPlorer recognises, and I can run multiple together.
- esptool OK
- Arduino ESP8266 version? FAIL, it can't see the symlink.

If I change the symlink name to ttyUSB88 or a similar up-out-of-the-way number, arduino is happy again, it can find it. I should rename all those symlinks in that style.

References I found:
http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/
http://www.remoteqth.com/wiki/index.php?page=How+to+set+usb+device+SerialNumber
User avatar
By Emitter
#47476 Hi, I should have read your article a little earlier, since I had the same problem with two "Ltd FT232 USB-Serial" and finally came to the same solution.

Maybe it is worth mentioning that you can get a nice kernel output of the individual ATTRS{idVendor}, ATTRS{idProduct} and ATTRS{serial} when running "dmesg --color --follow" and then plugging in the usb device.