Jump to content

USB unplug notifications ?


jreveane

Recommended Posts

Hi,

 

I'm accessing Linux brickd running over TCP/IP. I using both the Brickviewer and a small C client.

Trying to stop the Linux brickd service, I can observe that the Brickviewer and my C clients get notified properly.

However, if I unplug the TKF stack from the USB host port, this is not reflected either on Brickviewer or my small client.

Please not that I'm not trying to disconnect the bricklets themselves, which is not supported and I guest could damage the whole stack, and which is already the subject of an other thread,  but simply perform a valid USB device unplug.

So, should I use a specific API call to get notified by brickd that the USB stack is gone ?

Thanks.

Link zu diesem Kommentar
Share on other sites

The events of stopping brickd and unplugging a stack from USB is delivered with different callbacks.

 

If you stop brickd, it'll close all open client connections. Your program and brickv will receive a disconnected callback for this event.

 

If you unplug a stack from USB then brickd will send you an enumerate callback with type disconnected for this event. In brickv this event is used to remove the affected Bricks and Bricklets from the devices list.

 

If this is not working in brickv then there might be a problem with USB hot(un)plug detection on your Linux system. You can take a look at the brickd log at /var/log/brickd.log, as brickd logs USB device arrival/removal.

Link zu diesem Kommentar
Share on other sites

brickd is relying on udev events to be notified about USB device arrival/removal.

 

The kernel message sound like the musb driver is not handling the disconnect properly. In the end there is no udev event send for this USB device removal and brickd does not get notified about it.

 

I'm afraid there's not much I can do here.

Link zu diesem Kommentar
Share on other sites

Hi,

 

Thanks for your reply. I get bunch of "Bable Interrupts" with this BBB platform.

As soon as this happens, the only way to recover seems to power cycle the BBB.

I get better results with the Raspberry Pi for the moment and I will probably

give up on the BeagleBone Black then.

Things will get simpler (I hope), when the RED brick will be available.

Thanks for your help.

 

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...