<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Lock usb port to a device</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/</id><updated>2020-02-27T15:58:52.773000Z</updated><subtitle>Recent posts to Lock usb port to a device</subtitle><entry><title>Lock usb port to a device</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/?limit=25#569b" rel="alternate"/><published>2020-02-27T15:58:52.773000Z</published><updated>2020-02-27T15:58:52.773000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com9d63d7bf7b1e32467d52cca07f3e44d9fcfc78b0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; KevinR&lt;/p&gt;
&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;I had the same problem. I've had a UART onboard chip and a USB-two-Serial adapter. &lt;/p&gt;
&lt;p&gt;With the help of the CODESYS Support, I've found a solution for this issue.&lt;br/&gt;
I've done following to fix it: &lt;/p&gt;
&lt;p&gt;1.) Use persistent device names - to realize this, check out this blog entry: &lt;br/&gt;
&lt;a class="" href="http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/" rel="nofollow"&gt;http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2.) Edit the CODESYSControl.cfg file and create a "placeholder" name for the symbolic links (e.g. "ttySS"):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;[SysCom]&lt;/span&gt;
&lt;span class="na"&gt;Linux.Devicefile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/dev/ttySS&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;3.) Create the symbolic links&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;sudo&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ttyPersNameX&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ttySS0&lt;/span&gt;
&lt;span class="n"&gt;sudo&lt;/span&gt; &lt;span class="n"&gt;ln&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ttyPersNameY&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ttySS1&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;BR,&lt;br/&gt;
KevinR&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Lock usb port to a device</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/?limit=25#083e" rel="alternate"/><published>2020-02-27T15:58:51.922000Z</published><updated>2020-02-27T15:58:51.922000Z</updated><author><name>ekmekci</name><uri>https://forge.codesys.com/u/ekmekci/</uri></author><id>https://forge.codesys.com0ecd54b6a3645cef2e49b9e408f190b9cad50e7e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a solution about it,&lt;/p&gt;
&lt;p&gt;There is two way to fix one device to one serial port.&lt;br/&gt;
1) fixed by ID&lt;br/&gt;
2) fixed by Path&lt;/p&gt;
&lt;p&gt;On raspberry side,&lt;br/&gt;
go /dev/serial/ path, you can se there are 2 folder inside it&lt;br/&gt;
One of them is by-id&lt;br/&gt;
other one is by-path  both of them gives information about your device which connected usb port.&lt;/p&gt;
&lt;p&gt;I always prefer by-id, recommended to choose by-id. &lt;/p&gt;
&lt;p&gt;After choosing by-id, go into the by-id folder you can see your device information.&lt;br/&gt;
Copy this file name ( Copy whole name )&lt;/p&gt;
&lt;p&gt;You got your device id, and it is time to fix your device id to one port.&lt;/p&gt;
&lt;p&gt;turn raspberry terminal and write this sentence,&lt;/p&gt;
&lt;p&gt;sudo ln -s /dev/serial/by-id/THISPATHFORYOURDEVICEID /dev/THISISYOURSYMBOLICLINKNAME&lt;/p&gt;
&lt;p&gt;now, your device fixed to name of you setted.&lt;br/&gt;
For example,&lt;br/&gt;
1) I have GPS module which works on USB.&lt;br/&gt;
when i looked into the /dev/serial/by-id/ folder i can see the name of the my device  ( My device name is  "usb-u-blox_AG_-_www.u-blox.com_u-blox_GNSS_receiver-if00" )&lt;/p&gt;
&lt;p&gt;2) sudo ln -s /dev/serial/by-id/usb-u-blox_AG_-_www.u-blox.com_u-blox_GNSS_receiver-if00 /dev/XXX&lt;/p&gt;
&lt;p&gt;before these steps, my gps device connected to ttyAMA0&lt;br/&gt;
after these steps, my gps device connected to XXX&lt;/p&gt;
&lt;p&gt;so you can use XXX instead of ttyAMA0. And your device always will fixed to XXX.&lt;/p&gt;
&lt;p&gt;I hope it can help to you&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Lock usb port to a device</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/?limit=25#d197" rel="alternate"/><published>2020-02-27T15:58:49.720000Z</published><updated>2020-02-27T15:58:49.720000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comdcc00a34d7c18f6d293df5078145d2747634f6c2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Alberto,&lt;br/&gt;
Google for 'udev rules' this should point you into the right direction&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Lock usb port to a device</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/f6dc2b239c/?limit=25#6040" rel="alternate"/><published>2020-02-27T15:58:48.944000Z</published><updated>2020-02-27T15:58:48.944000Z</updated><author><name>alverman</name><uri>https://forge.codesys.com/u/alverman/</uri></author><id>https://forge.codesys.comeb8bc90a973f3417387c79da5431923bd14f76ed</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Good morning,&lt;br/&gt;
Do you know if there is a way to lock a usb port to a specific modbus device?&lt;br/&gt;
I have two modbus connection rtu and each one has its Modbus_COM where I check the raspberry serial port (usb).&lt;br/&gt;
Port 1 = ACM0 and Port 2 = ACM1&lt;br/&gt;
Now when I resume the raspberry happens that the doors are changed with the result that the modbus connections do not work.&lt;/p&gt;
&lt;p&gt;How do I block the assignment of ports?&lt;/p&gt;
&lt;p&gt;Thank you, Alberto&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>