I need a way to give my ESP8266's (and 32's also I assume) unique names in my /dev folder when I attach them to my USB hub.
PlatformIO wants to upload code to the ESP8266 using the moniker /dev/ttyUSB0 (or /dev/ttyUSBn.) I'm pretty sure if I created a SYMLINK called ESP8266_HomeStat PlatformIO would be happy with that.
Currently, when I attach one esp8266 I see ttyUSB0 show up in the /dev dir, then when I attach a second esp, I get ttyUSB1. This is as expected.
However, when I attach them in a different order the names get reversed, also, as expected.
I am attempting to use /etc/udev/rules.d to make a SYMLINK such that when I attach a device I get a second moniker /dev/ESP8266_HomeStat for example
I tried the following in a file called /etc/udev/rules.d/10-my_8266_homestat.rules ...
Code: Select all
ACTION=="add", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="ESP8266_HomeStat"Is there another ATTRS{something or other} I can use?
Failing that, I see in https://www.reactivated.net/writing_udev_rules.html I can launch a script when a device is attached. Is there a way I can use a shell script to get the MAC address from the device and create a unique moniker in my /dev dir?
Thanks, Mark.
