raspberrypipress / gsw-micropython-on-raspberry-pi-pico-2e

Code and resources for Get Started with MicroPython on Raspberry Pi Pico, 2nd Edition
3 stars 1 forks source link

[Errata]:Error with standard blue tooth code #4

Closed andrewpbrooker closed 1 month ago

andrewpbrooker commented 1 month ago

Contact Details

andrewpbrooker@gmail.com

What format of the book has this error? You may select more than one option.

PDF

Page Number or Section

251

Detailed description

Hi I downloaded the Bluetooth temperature client and and temperature code off github.

I ran the temperature code on one Picow which I powered from a power bank I connected another picow to my RPi 4B and run Thonny and loaded the client

For a few seconds it works fine and then I get -

Traceback (most recent call last): File "", line 56, in File "uasyncio/core.py", line 1, in run File "uasyncio/core.py", line 1, in run_until_complete File "uasyncio/core.py", line 1, in run_until_complete File "", line 52, in main File "aioble/client.py", line 251, in read TypeError: can't convert NoneType to int

The only thing I changed was it didn't recognise asyncio so I changed it to -

import uasyncio as asyncio

Its the latest firmware - picow-130263.uf2

Programs - BLE_Tempature.py and BLE_Temperature_Client.py

I would like to use the code as a basis for a remote for my robot cat

Really can't see what I could have done wrong

Any ideas please ?

Thanks

Andy Brooker

andrewpbrooker commented 1 month ago

Hi

I am sorry I think I know what the problem was

Found firmware v1.23 and that seems to work !

Sorry again

Andy

bjepson commented 1 month ago

Hi @andrewpbrooker, I'm sorry you're having trouble with the example. From the version you mentioned, it sounds like you might be using the PicoW-BLE custom firmware, but we only test the book with official MicroPython releases (see pages 13-17 in the printed book). Could you grab the latest PicoW firmware from https://micropython.org/download/rp2-pico-w/rp2-pico-w-latest.uf2 and try that?

Thanks,

Brian