Replies: 4 comments 6 replies
-
FYI, at Pybricks, we have a command line tool for the LWP3 protocol. So you can change the hub name like this: $ pipx run pybricksdev lwp3 repl
[10:03:15.207] INFO: scanning...
[10:03:19.020] INFO: found device
[10:03:19.892] INFO: connected
Type message and press ENTER to send. Press CTRL+D to exit.
>>> HubPropertyRequestUpdate(HubProperty.NAME)
[10:04:51.276] INFO: sending: HubPropertyRequestUpdate(<HubProperty.NAME: 1>)
[10:04:51.328] INFO: received: HubPropertyUpdate(<HubProperty.NAME: 1>, 'truck2')
>>> HubPropertySet(HubProperty.NAME, "truck")
[10:05:27.854] INFO: sending: HubPropertySet(<HubProperty.NAME: 1>, 'truck')
>>> HubPropertyRequestUpdate(HubProperty.NAME)
[10:05:36.262] INFO: sending: HubPropertyRequestUpdate(<HubProperty.NAME: 1>)
[10:05:36.329] INFO: received: HubPropertyUpdate(<HubProperty.NAME: 1>, 'truck')
>>> As for your script, I would try putting a sleep right after And I would check your byte strings. For example the first byte of |
Beta Was this translation helpful? Give feedback.
-
pybricksdev lwp3 repl crashes with
I just tried all the hypothesis in here in my program.... but it does not seem to fix. |
Beta Was this translation helpful? Give feedback.
-
Another thing, I decided to try with a CityHub instead of the Remote and the cityhub replies to me, although it does not change its name. It replies with b'\x05\x00\x050\x05', I think five is generic error ... |
Beta Was this translation helpful? Give feedback.
-
AAAAAaaaaaaaaaaaaaaaaaaaaaa! Stupid me!!!! Should be b'\x05\x00\x01\x01\x02', instead of b'\0x05\0x00\0x01\0x01\0x02'!!! |
Beta Was this translation helpful? Give feedback.
-
Description
I am trying to change a Lego Remote Handset name (currently named AAA).
By looking at LW3P docs, it is very easy to do.
I tried with nRF Connect and, at the first attempt, I was able to read a write the Remote name.
As much as I try it with windows/bleak, I cannot do it ...
Can you help me? What am I doing wrong?
Thank you very much!!
Notice in the output below that I get proper notifications after connection but I do not get any notifications after sending the command to read the name. In nRF Connect the command to read the name resulted in an immediate reply with current Remote name...
Program:
Output with no DEBUG:
Output with DEBUG:
Beta Was this translation helpful? Give feedback.
All reactions