-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect consistently on Pi 4 #110
Comments
I read somewhere recently that there was issues with the Bluetooth firmware on RPi 3/4 and rolling back the firmware fixed the connectivity issues. |
Thanks for this. I see a somewhat similar firmware issue here: And here: I attempted a rollback to the same firmware version specified in that thread:
That did not resolve the issue for me. However, it may have helped. I'm now able to reliable and repeatedly connect to the hub for any amount of time, disconnect, and reconnect again using const noble = require('@abandonware/noble');
noble.on('stateChange', async (state) => {
console.log("Starting...")
if (state === 'poweredOn') {
console.log("Scanning...")
await noble.startScanningAsync();
}
});
noble.on('discover', async (h) => {
if (h['address'] == {hub address here} ) {
console.log(h['address'])
await noble.stopScanningAsync();
await h.connectAsync();
console.log("Connected")
await new Promise(r => setTimeout(r, 8000));
console.log("Disconnecting")
await h.disconnectAsync();
await noble.startScanningAsync();
}
}); I still see the same behavior as before using node-poweredup. |
I was able to get this working by rolling back the Bluetooth firmware specifically. If others are trying to solve this, here is the solution that worked for me:
I then rebooted to make sure the new (old) firmware was in use. |
I've been working on getting this running on a Pi 4, and I'm having difficulty connecting using the example code. I'm using a PUP Hub with a linear motor and train motor attached. This is the output that I see when I run the example code from the readme using
sudo node ./example.js
:There is a multiple second delay (~6 seconds) between each hub discovery. During that time,
connect()
is attempted and the hub LED becomes solid white, but then goes back to flashing. After many attempts, the hub will usually connect and be controllable. Once properly connected, the connection is stable. I've successfully used it for around an hour without issue.The following have already been tried:
I've looked around for similar issues, and it looks like this may be an underlying issue with Noble:
abandonware/noble#99
Does anyone have ideas on how to begin to address this?
More details
The output of
uname -a
is:The complete output of
sudo DEBUG=* node example.js
is included here. In this case, a successful connection was made after 4 attempts.The text was updated successfully, but these errors were encountered: