title: USB modem multiple ttyACMx change after reconnection
body: <p>I'm connecting a Gemalto (Cinterion) modem, by USB, to my Embedded Linux (2.6.31), running BusyBox and mdev.</p>
  
  <p>The modem creates ttyACM [0-6], where '0' is used for the pppd.
  I'm getting dis and re-connections every now and then (1 hour, 1 day...).
  The whole system is more complex - another embedded device is connected to the modem on a RS232 interface, bla-bla-bla.</p>
  
  <p><strong>My problem:</strong></p>
  
  <p>When a disconnect and reconnect occur, the pppd isn't quick enough to die and free ttyACM0, so ttyACM [1-7] are created. Next time it may be [0, 2-7] or [3-8], no concrete algorithm to it.</p>
  
  <p><strong>I tried</strong> updating a simlink (to /dev/ttyMyModem), but the same 'no concrete algorithm' issue... all the interfaces are the same - CDC-ACM (are they not???).</p>
  
  <p><strong>My current approach:</strong></p>
  
  <p>A bash script, wrapping pppd, with an endless loop, waiting on the exit of the pppd (which stays in foreground, "nodetach" in my options file).
  When pppd dies I remove the driver (modprobe -r cdc_acm), delete all nodes (rm /dev/ttyACM*), reinstall the driver (modprobe cdc_acm) and run the pppd.
  I put 1-2 second delays between what was needed.</p>
  
  <p>This solution takes 2-4 iterations to reconnect (don't know why it doesn't work on the first), but seems stable.</p>
  
  <p><strong>My question:</strong></p>
  
  <ul>
  <li>Am I inventing the wheel?</li>
  <li>Is this solution stable? Good for production?</li>
  <li>Have I missed a 'buzz word' on my search in Google?</li>
  </ul>
  
  <p>Please don't be harsh with me...</p>