Author Topic: Having to reassign USB ports to controllers after reboot  (Read 100 times)

Offline RichLite

  • Newbie
  • *
  • Join Date: Nov 2017
  • Location: Detroit Suburb
  • Posts: 3
  • Kudos: 0
Having to reassign USB ports to controllers after reboot
« on: November 05, 2017, 11:42:01 AM »
I have a small show that is comprised of 2 Renard type controllers and 1 Enttec DMXUSB Pro.  The controllers and show all work.  (I plan to expand and add another Renard type controller to add more pixels.)

The issue I am having is that the controllers are not recognized and/or assigned properly in FPP after a powerup or reboot.  After every powerup or reboot, I have to play games to get the controllers recognized and/or assigned to the correct port in FPP for them to work again. 

To expand on that issue, after a boot, I have to go to the Output Setup and assign all three controllers to ttyAMA0, physically unplug all three controllers from the USB hub, then reboot.  After its back up, I plug in one controller into the USB hub, it is recognized in the Port Output Config, I assign that USB port (example: ttyUSB0 is now selectable) to the respective controller and save.  I then plug in the second controller into the hub, it gets recognized, I update its config and save.  Then repeat with the third.  Now everything works and the show can go on.

Just assigning / reassigning the com ports is not enough, the controllers have to be unplugged, and plugged back in.

In testing, even with only two controllers plugged directly into the FPP, I still have to play games to get them to work properly.

What am I doing wrong or missing?

Thanks for your assistance.


Additional Info:
Pi 3  (USB hub on this Pi.  All controllers connect to this USB hub.)
Vixen 3
Controller 1 = USB to RS485 [renard] PX1(1) >> PX1(2) >> PX1(3) >> PX1(4)
Controller 2 = USB to Xbee Explorer for [Renard] wireless to multiple MiniRen8XBLSDs
Controller 3 = USB to Enttec DMXUSB Pro >> daisy chained to DMX compatible devices

2 additional Pi 3s are used as remotes for video


Offline RichLite

  • Newbie
  • *
  • Join Date: Nov 2017
  • Location: Detroit Suburb
  • Posts: 3
  • Kudos: 0
Re: Having to reassign USB ports to controllers after reboot
« Reply #1 on: November 07, 2017, 05:30:28 AM »
I believe I have narrowed down the issue.  After trying different powered USB hubs, I can get it to work as designed (but not how I want).  😊 
(Not all USB powered hub are the same...  but that is an issue for a different discussion.)

To borrow from another forum, on powerup/reboot: 

the first Device gets ttyUSB0, the second ttyUSB1, and so on. But more importantly, note how timing isn't always the same! When booting up with two devices plugged in, one device might just respond slightly faster than the other. And next time it may be the other way around. That is why the number for x in /dev/ttyUSBx is unpredictable.

/dev/ttyUSBx (x=number)  The problem is that x may change unpredictably, and my issue is just that, sometimes the assignment of 'x' is as expected, and other times, due to timing, a device's 'x' is different.

Is there a way to statically assign devices to specific ttyUSB?

Now that I understand this better, I can image using a power up sequence, such as unplugging all controller USB connections first, (then) power up the FPP Pi, then plug in the controller USB connections to the Pi USB hub in a specific order 1..2..3 so they receive the expected ttyUSBx to match the output configured in FPP.  This isnt too much trouble for my show now as its small, but what happens when it expands, and there are Pis out in the yard in enclosures with multiple USB connections? 

Thank you.


Online CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 142
Re: Having to reassign USB ports to controllers after reboot
« Reply #2 on: November 07, 2017, 09:04:42 AM »
There is probably a way to statically assign the USB device names, but that would require diving into some config files we don't really want to touch.

In the past, we have recommended that prior to configuration, you power on the whole setup (Pi, USB devices, etc.) in the same way it would be powered on after a power outage, etc. to try to make sure that the order the devices are in during configuration time matches the order they would be in after a power outage or planned power off.
-
Chris

Offline RichLite

  • Newbie
  • *
  • Join Date: Nov 2017
  • Location: Detroit Suburb
  • Posts: 3
  • Kudos: 0
Re: Having to reassign USB ports to controllers after reboot
« Reply #3 on: November 08, 2017, 06:12:11 AM »

I dont follow how statically assigning the USB device names would help.  Currently I give them names by inserting a couple of ADD statements in a rules.d file, but this doesnt guarantee a specific ttyUSB.  I use it for troubleshooting.  If a much deeper dive is needed to then assign those names to specific ttyUSB ports, I agree, most likely it is not a place I should go.   :)

I understand the recommendation that prior to configuration to power on the whole setup  But Im still missing something.  With the way ports are assigned in order / timing, there is no guarantee that the assignment will occur the same way on the next power up (or the 'nth' powerup).  Maybe most of the time the USB assignment is consistent, but throw in Murphy, it will not be consistent at the most inopportune time.

 I read posts all the time with shows/Pis on timers and/or powered off daily and powered on the next day (yet dont seem to bump into this issue).  Assuming multiple USB ports are used on at least one of the Pis in a respective show, isnt there a risk (albeit maybe small risk) USB assignment will not match the configuration on the next powerup (example: every 24th time-ish, on the 6th Pi in the system, when the moon is green, the Pi powers up and controller x doesnt sync or the control link to a projector doesnt turn the unit on, then the Pi is rebooted and everything is fine).

As nothing is broken and the equipment/assignment is working as designed, Im confused as to why this is an issue for me, and not other shows (that are conceivably FAR larger).  Just me?   :P

What are best practices being used to get predictable port assignments on each powerup?

Thanks.

Offline jnealand

  • Developer
  • ******
  • Join Date: Aug 2013
  • Location: Kennesaw, GA
  • Posts: 2,173
  • Kudos: 41
Re: Having to reassign USB ports to controllers after reboot
« Reply #4 on: November 08, 2017, 01:37:48 PM »
I will probably be running 12 remote Pis this Christmas, had 5 for Halloween.  I have not used more than 1 USB port since I switched to the Pi3 which has built in wifi.  I do use mote than one USB port when I am setting them up on my workbench, but have never seen the problem you are experiencing.
Jim Nealand
Kennesaw, GA
Lynx, Falcon, XL, FPP

 

Back to top