Then I have a python script that uses bleak to connect to the puck, and listen for that console output, which I then pass along to another toy program.
print ("Connecting to puck " + puck_device.address)
async with BleakClient(puck_device.address) as client:
await client.start_notify(UUID_NORDIC_RX, uart_data_received)
await asyncio.sleep(100000000.0) # Keep the connection alive
await ws_server.wait_closed()
This all works fine for a while, but i've noticed that after a few minutes the speed of the accel data i'm getting starts to slow down, and eventually the connection drops.
Any suggestions on what might be happening? I looked into trying to do this by purely advertising the IMU data and not making an actual two way connection, but it doesn't look like I get a very high frequency signal that way. Just a few updates per second, and I need closer to 10 updates per second.
Thanks! p.s. i'm new to BLE so might be doing this a bit backwards.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have a hobby project where my puck.js sends accel data:
Then I have a python script that uses bleak to connect to the puck, and listen for that console output, which I then pass along to another toy program.
This all works fine for a while, but i've noticed that after a few minutes the speed of the accel data i'm getting starts to slow down, and eventually the connection drops.
Any suggestions on what might be happening? I looked into trying to do this by purely advertising the IMU data and not making an actual two way connection, but it doesn't look like I get a very high frequency signal that way. Just a few updates per second, and I need closer to 10 updates per second.
Thanks! p.s. i'm new to BLE so might be doing this a bit backwards.