<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydpee6a3d58yahoo-style-wrap" style=""><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"></div>
        <div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">> But I need to go a step further. To assign a name like "NW-FOO" to the XDS110 in the NW corner of my "test range" I'd need to interpose in Udev somehow so it could do the thing to determine which is which.</span></span><br></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><br></span></span></div><div style="">Right, so are you saying that you do not have unique serial #'s?. The technique described relies on specific devices with serial numbers, so if you have to change an Arduino Nano out for instance, you would also need to change the rule to use the new serial number. UDEV is extremely flexible and I haven't even touched the surface of it, so if you write more generic rules to just capture Arduino vs XYX, then I am sure you could find a rule to increment your naming. I used this technique to utilize the serial number to always connect to a specific name. It worked quite well for fixing reconnects where it would normally increment. However, it still did not fix just plain disconnects common in USB. I am not a fan of the USB software layer and I absolutely despise its physical connections. Having said all that I still use it in many ways, I have to, it's all there is for many things. And this solution described with UDEV and serial #'s actually worked quite well at solving the vast majority of issues and was quite stable. Probably fine for non-critical uses.</div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><br></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span>Example FTDI Serial #</span></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span><br></span></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span>ATTRS{serial}=="A600G5OZ"</span><br></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span><br></span></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">>I regret going with Ubuntu 18.04 </span></span><br></span></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span><br></span></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span>You are making me feel better about keeping my Ubuntu 16 or is it 14? Anyway, I am done with Ubuntu. it drives me crazy in the same way that windows does, by making decisions for you and assuming the user needs to be probed constantly to act. I have always been a RedHat person, but thanks to Rpi and many other embedded devices, I am now a HUGE fan of Debian. I will not be going to Ubuntu for new installs unless I am setting it up for non-technical users, then Ubuntu is still the #1 go to. For me though, Ubuntu just annoys the crap out of me in so many ways. The problem with RedHat (Centos) is it just doesn't keep up to date for newer software, so I have to use something else for that. It has been Ubuntu, but now it's Debian.</span></span></span></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><br></div>
        
        </div><div id="yahoo_quoted_2189028457" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Wednesday, February 27, 2019, 8:55:07 PM EST, Pete Soper via TriEmbed <triembed@triembed.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv4464107310"><div>
    On 2/27/19 7:16 PM, John Vaughters via TriEmbed wrote:<br clear="none">
    <blockquote type="cite">
      </blockquote></div><div><div class="yiv4464107310ydpb1feb1dyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;">
        <div><br clear="none">
        </div>
        <div>Pete,</div>
        <div><br clear="none">
        </div>
        <div>If you are using the same USB devices all the time and do
          not expect changes, consider doing udev rules. Below is an
          article I wrote about it. Basically it recognizes your USB
          device based on certain ID's and you can name the device
          whatever you want. As far as communicating, "expect" scripts
          is as good as any tool I can think of. The only thing that is
          probably </div>
      </div>
    
    Thanks. That's a nice how-to and will make it easy to differentiate
    between the TI XDS110 debug probes and Beaglebone boards that both
    manifest as /dev/ttyACMn and between instances of custom devices and
    the Arduino Nano's I'm using to run some motors that both manifest
    as /dev/ttyUSBn. But I need to go a step further. To assign a name
    like "NW-FOO" to the XDS110 in the NW corner of my "test range" I'd
    need to interpose in Udev somehow so it could do the thing to
    determine which is which. For the XDS110 there's a TI program that
    (if you repeat it enough times: flaky as heck) puts out strings
    including the ID string, but for the custom device I need to use
    expect to poke something into the port and get back the ID (and same
    for the Arduino motor controllers). <br clear="none">
    <br clear="none">
    So the question is whether there's a hook mechanism with Udev that
    would allow running a command as a side effect of the device's
    detection and name assignment under /dev. Especially if that could
    be run as root I could create the symbolic link and properly set its
    group id. Or maybe the invoked program/script could simply rename
    the device after it's probed it?<br clear="none">
    <br clear="none">
    I agree that USB has got further to go. I regret going with Ubuntu
    18.04 for my latest PC 'cause Code Composer Studio seems to be much
    less able to manage the debug probes than when it's running on
    16.04. Over on the TriLUG list there's been griping about 18.04
    having regressions and that matches my experience.<br clear="none">
    <br clear="none">
    -Pete<br clear="none">
    <blockquote type="cite">
      <div class="yiv4464107310ydpb1feb1dyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;">
        <div>better is Tera-Term, but that is strictly windows. It is
          quite good though and I wrote a tool to run scripts to 300
          edge routers using Tera-Term. One thing I used to do is use
          "socat" to send the serial device to a raw TCP port and
          communicate over the network. In general I do everything I can
          to not communicate to USB devices due to their constant
          connection issues. I prefer using UART if possible. </div>
        <div><br clear="none">
        </div>
        <div>Good Luck,</div>
        <div><br clear="none">
        </div>
        <div>John Vaughters</div>
        <div><br clear="none">
        </div>
        <div><a rel="nofollow" shape="rect" class="yiv4464107310enhancr_card_1654028628" target="_blank" href="http://combustory.com/wiki/index.php/Arduino_Communications_Device_Naming_with_udev">Arduino
            Communications Device Naming with udev - Combustory</a><br clear="none">
        </div>
        <div><br clear="none">
        </div>
        <div class="yiv4464107310ydp4a2558cyahoo-link-enhancr-card yiv4464107310ydp4a2558cymail-preserve-class yiv4464107310ydp4a2558cymail-preserve-style" id="yiv4464107310ydp4a2558cenhancr_card_1654028628" style="max-width:400px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;" data-url="http://combustory.com/wiki/index.php/Arduino_Communications_Device_Naming_with_udev" data-type="YENHANCER" data-size="MEDIUM"><a rel="nofollow" shape="rect" class="yiv4464107310ydp4a2558cyahoo-enhancr-cardlink" target="_blank" href="http://combustory.com/wiki/index.php/Arduino_Communications_Device_Naming_with_udev" style="text-decoration:none !important;color:#000 !important;">
            <table class="yiv4464107310ydp4a2558ccard-wrapper yiv4464107310ydp4a2558cyahoo-ignore-table" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400">
                    <table class="yiv4464107310ydp4a2558ccard yiv4464107310ydp4a2558cyahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224,                       228, 233);border-radius:2px;" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" valign="top" class="yiv4464107310ydp4a2558ccard-primary-image-cell" style="background-color:rgb(0, 0, 0);background-size:cover;position:relative;border-radius:2px 2px 0px 0px;min-height:175px;" height="175" bgcolor="#000000" background="https://s.yimg.com/lo/api/res/1.2/0JuqABn.q7h8Y4tT6WUzcA--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/http://combustory.com/wiki/skins/common/images/poweredby_mediawiki_88x31.png.cf.jpg">
                            <table class="yiv4464107310ydp4a2558ccard-overlay-container-table yiv4464107310ydp4a2558cyahoo-ignore-table" style="width:100%;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" valign="top" class="yiv4464107310ydp4a2558ccard-overlay-cell" style="background-color:transparent;border-radius:2px 2px 0px 0px;min-height:175px;" bgcolor="transparent" background="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png">
                                    <table class="yiv4464107310ydp4a2558cyahoo-ignore-table" style="width:100%;min-height:175px;" height="175" border="0"><tbody><tr><td colspan="1" rowspan="1" class="yiv4464107310ydp4a2558ccard-richInfo2" style="text-align:left;padding:15px 0 0 15px;vertical-align:top;"><br clear="none">
                                          </td><td colspan="1" rowspan="1" class="yiv4464107310ydp4a2558ccard-actions" style="text-align:right;padding:15px 15px 0 0;vertical-align:top;"><br clear="none">
                                          </td></tr></tbody></table>
                                    </td></tr></tbody></table>
                          </td></tr><tr><td colspan="1" rowspan="1">
                            <table align="center" class="yiv4464107310ydp4a2558ccard-info yiv4464107310ydp4a2558cyahoo-ignore-table" style="background:#fff;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0 0 2px 2px;border-top:1px solid rgb(224,                               228, 233);" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"><br clear="none">
                                  </td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0;">
                                    <h2 class="yiv4464107310ydp4a2558ccard-title" style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;color:rgb(38, 40,                                       42);">Arduino Communications
                                      Device Naming with udev -
                                      Combustory</h2>
                                  </td></tr></tbody></table>
                          </td></tr></tbody></table>
                  </td></tr></tbody></table>
          </a></div>
        <div><br clear="none">
        </div>
        <div><br clear="none">
        </div>
      </div>
      <div class="yiv4464107310yahoo_quoted" id="yiv4464107310yahoo_quoted_1531166218">
        <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
          <div> On Wednesday, February 27, 2019, 4:41:50 PM EST, Pete
            Soper via TriEmbed <a rel="nofollow" shape="rect" class="yiv4464107310moz-txt-link-rfc2396E" ymailto="mailto:triembed@triembed.org" target="_blank" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> wrote: </div>
          <div><br clear="none">
          </div>
          <div><br clear="none">
          </div>
          <div>
            <div dir="ltr">It's been many years since I used the Unix
              "expect" command but that was <br clear="none">
            </div>
            <div dir="ltr">the industrial strength solution for
              automated interaction with a serial <br clear="none">
            </div>
            <div dir="ltr">connection such as via ssh where you specify
              a "script" of "this is <br clear="none">
            </div>
            <div dir="ltr">sent, this is what's received back",
              interactions and the logic to take <br clear="none">
            </div>
            <div dir="ltr">actions based on the interaction details.
              What's out there now that I <br clear="none">
            </div>
            <div dir="ltr">should be using, or is this still the best
              way to go? My host <br clear="none">
            </div>
            <div dir="ltr">environment choices are Linux or Cygwin
              (inside a VM).<br clear="none">
            </div>
            <div dir="ltr"><br clear="none">
            </div>
            <div dir="ltr">My situation is that I have three or four
              flavors of device that I need <br clear="none">
            </div>
            <div dir="ltr">to connect to with either ssh or a terminal
              emulator where a script of <br clear="none">
            </div>
            <div dir="ltr">some sort dictates what I have to send and
              what I expect back. This, in <br clear="none">
            </div>
            <div dir="ltr">turn, is to deal with the musical chair
              situation with USB connections <br clear="none">
            </div>
            <div dir="ltr">such as when I get intermittent electrical
              service from Duke Energy (at <br clear="none">
            </div>
            <div dir="ltr">no extra cost!) I've got an automated test
              system where there are, for <br clear="none">
            </div>
            <div dir="ltr">example, /dev/ttyACM{0,1,2,3,4,5,6,7},
              /dev/USB{0,1,2,3}, etc, and I <br clear="none">
            </div>
            <div dir="ltr">need to establish and keep fresh meaninfully
              named symlinks that get <br clear="none">
            </div>
            <div dir="ltr">associated with the right devices assigned
              randomly by system startups, <br clear="none">
            </div>
            <div dir="ltr">being forced to unconnect/reconnect cables,
              etc.<br clear="none">
            </div>
            <div dir="ltr"><br clear="none">
            </div>
            <div dir="ltr">.<br clear="none">
            </div>
            <div dir="ltr">Thanks,<br clear="none">
            </div>
            <div dir="ltr">Pete<br clear="none">
            </div>
            <div dir="ltr"><br clear="none">
            </div>
            <div dir="ltr"><br clear="none">
            </div>
            <div dir="ltr">_______________________________________________<br clear="none">
            </div>
            <div dir="ltr">Triangle, NC Embedded Computing mailing list<br clear="none">
            </div>
            <div dir="ltr"><br clear="none">
            </div>
            <div dir="ltr">To post message: <a rel="nofollow" shape="rect" ymailto="mailto:TriEmbed@triembed.org" target="_blank" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a><br clear="none">
            </div>
            <div dir="ltr">List info: <a rel="nofollow" shape="rect" target="_blank" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br clear="none">
            </div>
            <div dir="ltr">TriEmbed web site: <a rel="nofollow" shape="rect" target="_blank" href="http://TriEmbed.org">http://TriEmbed.org</a><br clear="none">
            </div>
            <div dir="ltr">To unsubscribe, click link and send a blank
              message: mailto:<a rel="nofollow" shape="rect" ymailto="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" href="mailto:unsubscribe-TriEmbed@bitser.net">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<div class="yiv4464107310yqt6502418103" id="yiv4464107310yqtfd87928"><br clear="none">
            </div></div><div class="yiv4464107310yqt6502418103" id="yiv4464107310yqtfd12177">
            <div dir="ltr"><br clear="none">
            </div>
          </div></div><div class="yiv4464107310yqt6502418103" id="yiv4464107310yqtfd84156">
        </div></div><div class="yiv4464107310yqt6502418103" id="yiv4464107310yqtfd31716">
      </div></div><div class="yiv4464107310yqt6502418103" id="yiv4464107310yqtfd48051">
      <br clear="none">
      <fieldset class="yiv4464107310mimeAttachmentHeader"></fieldset>
      <pre class="yiv4464107310moz-quote-pre">_______________________________________________
Triangle, NC Embedded Computing mailing list

To post message: <a rel="nofollow" shape="rect" class="yiv4464107310moz-txt-link-abbreviated" ymailto="mailto:TriEmbed@triembed.org" target="_blank" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a>
List info: <a rel="nofollow" shape="rect" class="yiv4464107310moz-txt-link-freetext" target="_blank" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a rel="nofollow" shape="rect" class="yiv4464107310moz-txt-link-freetext" target="_blank" href="http://TriEmbed.org">http://TriEmbed.org</a>
To unsubscribe, click link and send a blank message: <a rel="nofollow" shape="rect" class="yiv4464107310moz-txt-link-freetext" ymailto="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe" target="_blank" href="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe">mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe</a>

</pre>
    </div></blockquote><div class="yiv4464107310yqt6502418103" id="yiv4464107310yqtfd27601">
    <br clear="none">
  </div></div></div><div class="yqt6502418103" id="yqtfd85005">_______________________________________________<br clear="none">Triangle, NC Embedded Computing mailing list<br clear="none"><br clear="none">To post message: <a shape="rect" ymailto="mailto:TriEmbed@triembed.org" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a><br clear="none">List info: <a shape="rect" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br clear="none">TriEmbed web site: <a shape="rect" href="http://TriEmbed.org" target="_blank">http://TriEmbed.org</a><br clear="none">To unsubscribe, click link and send a blank message: mailto:<a shape="rect" ymailto="mailto:unsubscribe-TriEmbed@bitser.net" href="mailto:unsubscribe-TriEmbed@bitser.net">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br clear="none"><br clear="none"></div></div>
            </div>
        </div></body></html>