Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

So, I did a quick test and it sounds that brickd does not get notified of the USB unplug event.

Running dmesg, I got this line only:

[time stamp] musb_stage0_irq 790: unhandled DISCONNECT transition (a_idle)

 

BTW, I'm using a BeagleBone Black running Debian.

Thanks.

 

 

 

Posted

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.

Posted

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.

 

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...