Ok, I think I fixed it! Maybe good a work around for the rest who are looking for this solution. Here my tutorial:
Step 1:
In this step we are going to find the information to identify our USB serial device.
Using putty or your favorite ssh client, run:
sudo lsusb -v | more
find and note these values for each of your device:
*idVendor (without „0x“)
*idProduct (without „0x“)
*iSerial (if this is zero, you can ignore it)
I found these values for my RS485 converter:
idVendor: 0403
idProduct: 6001
iSerial: A9U95FZF
Step 2:
In this step we are going to create a rule for the udev to make a symlink. I wanted the name symlink ttyUSB-MBclima so I can easily remember and recognize it. Of course you can enter your own name
Run:
sudo nano /etc/udev/rules.d/99-usb-serial.rules
Add the following line with the values for each device you found:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A9U95FZF", SYMLINK+="ttyUSB-MBclima"
Step 3:
Now we are going to restart your device and check if the symlinks are created:
Run:
cd /dev
ls -l
the last command will give you a list of all the files in this directory. look for something like this:
lrwxrwxrwx 1 root root 7 Mar 6 18:17 ttyUSB-MBclima -> ttyUSB0
this is your symlink.
Step 4:
Make the script:
Make a script and add this:
$rightTTYport = "/dev/".exec("readlink /dev/ttyUSB-MBclima");
IPS_SetProperty(50297 /*[MB_Clima]*/, "Port", $rightTTYport);
Change the following values to the right values as it is configured in your setup:
- ttyUSB-MBclima (the name of the symlink you have created in step 2)
- 50297 /[MB_Clima]/ (the objectID of used serial connection in „I/O instances“)
Step 5:
Run the script at startup of IP-symcon
Go to „Core Instances“ > „Events“ and add the created script to „Startup Script“ field.
That’s it! I tested it and it works like a charm!