Usage of both dongles in 'Gateway Bundle'

edited June 2019 in Hardware

I've been writing and testing code on the hardware from the mbient store's 'gateway bundle.' I've gotten a single device to the point I need, so now I'm expanding to multiple devices across multiple dongles.

With both dongles plugged in, both show up using lsusb and hciconfig -a (I also see a 3rd hci device for the built in adapter). When I set up my code to connect to one MMR on each dongle, I noticed that the blue led only flashed on a single dongle while streaming data. I checked in btmon and sure enough, I only saw data coming in from one hci device (but I verified that I was getting data from both MMRs). I changed my code to use one dongle and the built in adapter, and in that case I saw both expected hci devices in btmon. Looking more closely at hciconfig I noticed that both dongles had the same BD Address (I also have another pair of dongles from a second bundle, all 4 had the same address). It looked like the address clash was causing the dongles to fail to initialize properly.

I ended up having to give each dongle a unique address using the code and instructions found here. My issue is "solved" in the sense that after this change, I can use each dongle and see the blue connection led while streaming data, but I'm wondering if I should've even had to do this? I'd expect the bundled hardware you guys sell to work out of the box without low level changes like this, so I'm thinking I may have worked around an issue that shouldn't have occurred in the first place.

Comments

  • edited June 2019
    • Do you have an output from hciconfig that shows that you are describing?
    • Were the adapters inserted before powering on the hub?



    Adapters should have unique MAC addresses.

  • @Eric,
    No they don't necessarily have unique mac address but they will get a unique hci # assigned by the OS so @gwenger could have used that instead.

  • Here is the terminal output from before and after I changed the addresses. At this point, I have given all of my dongles unique addresses. The 'before_change' picture is immediately after a system power cycle when both dongles were inserted before powering down.

    I am using your Python bindings, and I have been referencing the dongles by their hci #. The described behavior happened when I passed hci_mac='hci0' and hci_mac='hci1' when setting up my two MMRs. When I did that, all of the messages in btmon came from hci1, but I definitely got streaming data from both sensors. When I ran again after changing hci0 -> hci2 (the built in), I got btmon messages from both hci1 & hci2.

    Based on the output in 'before_change' it looks like one of the adapters isn't getting set up properly. I tried inserting a 3rd dongle, and the hciconfig info looked similar (namely, the dongle showed up with the name CSR8510 A10, instead of raspberrypi #X like the working adapters). Individually, each dongle works correctly.

    Also, thanks for that initial prompt response @Laura, made me chuckle enough to take a screen shot!

  • Definitely make sure the dongle is supported first. Not all dongles are supported (there's a link to a list on our tutorials).
    Don't forget to update everything as well: https://mbientlab.com/tutorials/Linux.html#dongles
    Maybe just a reboot ... it seems something is wrong at the OS level. I always reboot my system after I update it when i put in new dongles. It's never really plug and play with linux tbh.

  • @Laura said:
    Definitely make sure the dongle is supported first. Not all dongles are supported (there's a link to a list on our tutorials).

    @gwenger said:
    I've been writing and testing code on the hardware from the mbient store's 'gateway bundle.'

    I would assume that the bundled dongles are supported.

    @Laura said:
    Maybe just a reboot ... it seems something is wrong at the OS level. I always reboot my system after I update it when i put in new dongles. It's never really plug and play with linux tbh.

    @gwenger said:
    The 'before_change' picture is immediately after a system power cycle when both dongles were inserted before powering down.

    I've power cycled many times, this was just one example.

    I can't reproduce the issue right now because I've given each dongle a unique address, but if I have time I'll change them back to the same address and try to give more log info of what went wrong.

    Similar to my previous post, this may not be an issue with your code base directly. I was just posting in the forum to alert you to a bug I may have found and either:
    a) document the fix I came up with to help simplify sticking it in your tutorial (if it's normal, as you initially said @Laura, it may as well go in the tutorial IMO)

    or

    b) suggest a change you could make to your bundled hardware before you ship it to the customer, if it turns out that all devices must actually have unique hardware addresses to work out of the box

  • a) I already have it in my tutorial to refer to the dongles in a per hci# basis, you shouldn't have to change the mac address. That being said, I will add it as a side note.
    b) it is not possible as we do not own these dongles and they come as-is.

Sign In or Register to comment.