[Noise] Linux laptop BLE with OpenBCI GUI on Gangion
Hello,
I'm looking for any help / guiding with a problem I'm experiencing.
I've just recently bought a Ganglion board. I'm still trying different setups (ExG) with my board. But with the current price of OpenBCI products I'm considering buying more. That's why I ask for help, hoping to resolve the problem faster than by researching it only myself (and before the sale ends ). I've read the forum ("Ganglion" and "OpenBCI GUI" categories) topics but couldn't find a similar issue / helpful answers (other than using a BLED112 device).
The problem is: noise when using a Linux computer.
I don't know how to describe the noise so I screen captured the GUI:
- Windows without noise — download link: windows.mp4
- Linux with noise — download link: linux.mp4
Screenshot of the noise. Yet, it is not very regular, please see the video if you can.
Both laptops are:
- the same model (Gigabyte G5 MF)
- on the same desk
- using the same (only one I own) Ganglion board
The only difference is the operating system OpenBCI GUI is running on.
OpenBCI GUI works on Windows out of the box.
On Linux I:
- use Fedora 38
- start LE scan with
bash
$ bluetoothctl
menu scan
transport le
back
scan on
- this is enough to get OpenBCI GUI to find and connect to Ganglion
- to be able to start the stream from Ganglion, I run the GUI either with
sudo
or SELinux in permissive mode (both ways work)
Could you please hint me (or just answer ) on what is the reason that LE scan generates such noise and how to get rid of it?
What might also be helpful:
- keeping Linux laptop on active BLE scan does not impact Windows<>Ganglion signal at all
- terminating scan by closing
bluetoothctl
interactive utility kills OpenBCI GUI<>Ganglion connection - the connection method I used is what I found on https://stackoverflow.com/a/65587222
Regarding BLED112
From what I've read on the forum so far, the issue might be resolved by just connecting Ganglion to the laptop after purchasing a USB BLED112 device. However in my case, hardware (Bluetooth in laptop) is not the issue. The same hardware (I currently have the comfort of having my own and my wife's laptop) running Windows works perfectly. It could be a firmware issue (Bluetooth implementation on Linux), but I hope it's a software problem that could be resolved by connecting to Ganglion board from Linux differently.
Comments
Hi Aleksander,
The BLED112 is very low cost and available directly from electronics distributors in Poland, such as Mouser:
https://www.mouser.pl/new/silicon-labs/silicon-labs-bled112-dongle/
https://www.mouser.com/c/?q=bled112
That is the first thing I would try, because as you guess, the Bluetooth support is very different in Windows vs Linux, and this dongle re-routes that Bluetooth traffic so that it looks like a plain usb serial port device. Thus no dependency on internal OS Bluetooth libraries, firmware, etc.
William
Hi William,
thank you for a quick response.
I've actually purchased the dongle before opening the discussion (I expect to have it delivered by Tuesday), sorry for not mentioning it. Hope finding a store in Poland did not take you much time, sorry again. But I'm thankful for the link, so I can confirm that I've bought the one that should work :-) (the same you've linked to, but in another store).
Sure, it's not that expensive (still, with taxes and shipping it costed me $42.77) but I really don't like the idea of buying a device just to circumvent my lack of knowledge. I'd much rather pay (even more) to know how to make it work with the hardware I own, hardware that is fully functional. I don't like the dirty hack nature of this "solution to the problem". And yes, I acknowledge that using a dongle is actually the official connection method in the documentation :-), but I assume it's for the sake of the out of the box consumer satisfaction and not a technical requirement.
Nevertheless, I've bought the dongle to have it around if I'd ever wanted to use OpenBCI with a Mac.
I'd still very much like to know how to properly use the (functional) Bluetooth chip (it is Intel AX211 in my G5 MFs but I doubt that the solution is that device-specific) with OpenBCI Ganglion on Linux.
When deciding to post on the forum, I hoped (and still do :-) ) that I'm just a new OpenBCI user, and other, more experienced OpenBCI Linux users have already encountered this issue, found its source and solution and will be kind enough to share here.
If you can, please, as an administrator, keep the discussion "open", as that is how I see it (despite purchasing a dongle).
Nothing about the dongle is a 'dirty hack'. There is considerable acceptance testing that happens with Windows. That program does not exist for Linux variations. What is being tested is BOTH the hardware and the drivers / libraries interfaces all working in different conditions. It may be possible to get a given Linux implementation working, I would recommend checking on Fedora user discussion forums to ask if other Fedora users may have workarounds.
As well, you might find it works on Ubuntu and not Fedora, etc.
See section 18 on this page,
https://truelist.co/blog/linux-statistics/
Please don't take it personally. I never suggested it is OpenBCI who should be responsible for making GUI work with Bluetooth chips under different OSes. You are a great company and project, doing great work. I understand that there is room for passion, but there also has to be room for economics.
I also know that, from your point of view, utilizing a dongle is a reasonable abstraction level. It doesn't change the fact though, that, from my point of view, buying hardware to solve a firmware/software/knowledge problem sure is a dirty hack. I'm not that eco-conscious, but even I seek comfort in knowing that this additional hardware I bought will probably be indispensable with my 2020 Mac anyway.
I did not contact OpenBCI's customer service about the topic — I know it is by no means the company's duty to make stuff work on Fedora*. But what I also know, is that this hardware is capable of working properly.
Given it's OpenBCI and not some "AppleBCI", I strongly believe that, in the OpenBCI community, there are not only consumers, but also people who research the problems they encounter. And among them: Linux users. I hope somebody has already had this issue on Linux, and could please share their insights.
* If anybody had success with built-in Bluetooth chip on any Linux distro — please share, it should make finding the culprit and workarounds for other distros easier. I've just tried Ubuntu 23.10 but couldn't start the stream (console output with BLE scan on and without scan).
@Andrey1994 Parfenov (Brainflow developer) and Richard @retiutut (GUI developer), would you have any tips or suggestions on how Aleksander (in Poland) might have better luck with his Linux laptop built-in Bluetooth working with GUI / Brainflow Ganglion-Native mode?
https://brainflow.readthedocs.io/en/stable/SupportedBoards.html#ganglion-native
It works perfectly with Windows and the GUI. He has already ordered a BLED112 dongle, and we expect that will likely be a workaround. But he is frustrated that this laptop cannot support the internal Bluetooth hardware under Linux (Ubuntu and Fedora both fail in different ways.) Maybe you might recommend a discussion forum for ANY Linux distro that may have tips for him.
Take a look at his first post above in this thread. Under Fedora, the GUI does connect successfully to his Ganglion, but he gets very weird noise pulses in the time series. Movies included. It looks to my unexperienced eye like the Ganglion may be repeatedly re-initializing the ADC chip.
Regards, William
Thank you very much William!
I asked the question on the Brainflow Slack 'askhelp' channel, and got reply from Andrey,
You can sign up for Brainflow Slack access from this page,
https://brainflow.org/
Also contains link to docs.
Thank you for all the help. I wouldn't have summarized my question better. I've created an account on Brainflow's Slack to see any answers should anyone else respond.
I can have access to Raspberry: 4B and Zero W during the weekend, so I'll try that. Hopefully it could be a helpful starting point. Even though that failed attempt by Andrey is not very optimistic.
Best regards
Seems likely the Zero would be underpowered for running the GUI. Even the 4B will not match performance of your laptop. Note that there are no pre-built GUIs for Raspberry. You have to build yourself.
https://docs.openbci.com/Software/OpenBCISoftware/GUIDocs/#running-the-openbci-gui-from-the-processing-ide
You're right. I'll will only try to connect and record a couple of seconds worth of signal from Ganglion without GUI on headless Zero if 4B were to fail (whether any of the Raspberries' Bluetooth chips are capable of connecting, regardless of Linux Bluetooth stack used, is unknown to me, unlike on my laptop).
P.S. I've just received the dongle — works out of the box on Fedora, as expected. What seems interesting to me (but my knowledge is limited in this area), is that leaving native Bluetooth LE scan on does not result in any noise added to the signal received through the dongle.
My guess is that your Fedora Bluetooth driver or library, was forcing the Ganglion firmware to keep reinitializing itself. The pulses looked suspiciously like ADC startup transients. The dongle is connected to the usb serial port on the computer. So can even plug into the 4B.