mit-cml / appinventor-extensions

Source code of extensions published for MIT App Inventor
Apache License 2.0
85 stars 93 forks source link

Event of readstring is not running #59

Open ellelili2025 opened 2 years ago

ellelili2025 commented 2 years ago

Describe the bug

There is a thread on the community site regarding event of readstring is not running

Affects

Please refer to https://community.appinventor.mit.edu/t/uart-with-micro-bit-and-app-inventor/8935/18 for details. MicroBitReceiveText.aia.zip

Extension with UART service

com.bbc.microbit.profile-20200518.aix.zip

microbitRW_2.aia.zip

xyyshh commented 2 years ago

@ellelili2025 Hi Li. I have looked through the link. They said the StringsReceived block from BLE extension and the TXCharacteristicReceived block from Microbit_Uart extension do not work. They also said the BytesReceived block from BLE extension works. But all the three blocks do not work for me, which means I can't receive any bytes or strings from the micro:bit V2 or V1 to my phone. I have tried a lot but I did not find where the problem is. May I ask what can I do for this issue? I'm not quite sure about that. Thank you very much.

ellelili2025 commented 2 years ago

@xyyshh Does BluetoothLE1.bytesreceived work for you? If it doesn't work for you. Could you provide more details? errors? Also which version of microbit did you use? Could yo also try with the extension I attached in the issue?

xyyshh commented 2 years ago

@ellelili2025 Dear Li, BluetoothLE1.bytesreceived does not work for me. I have tried both V1 and V2 with the code you attached and they had the same performance. When I just connected to the microbit, there occured an error "Error 9011 in extension BluetoothLE: Unknown Characteristic" on my phone (app inventor). Then I pressed the button on microbit to let it send string to my phone. But I didn't receive the string and there was also no error.

I also tried the extension you attached and it also didn't work. For V2, there was no string received and also no error. But I cannot connect to V1 with the extension. When I click connect button, the app crashed.

ellelili2025 commented 2 years ago

@xyyshh I will look at this and get back to you.

ellelili2025 commented 2 years ago

@xyyshh Could you please try project microbitRW_2.aia that I just attached. Refer to this thread in the community site for more details. https://community.appinventor.mit.edu/t/communicate-with-micro-bit/31120/3

xyyshh commented 2 years ago

@ellelili2025 microbitRW_2.aia works well on my phone and I can receive bytes from bicrobit. Thank you very much.