ListView Freezing

Hi there!

I need to connect to my ESP32 and I am using Listview to connect. It has been working fine until today. When I start scanning, it shows up but I can't click on it. Then the app freezes and closes every time. I have restarted my app and phone several times and closed the MIT App Inventor App. I checked with the nRF connect app and the ESP32 is connecting fine and sending data correctly

What might the issue be? Here are my for Bluetooth connection:

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.

export_and_upload_aia

.

Motor_Control_App_BLE_2 (1).aia (1.1 MB)

I am receiving a string via BLE with two values separated by a delimiter. The method I used is yielding this result:

The operation select list item cannot accept the arguments: , ["9.55, 12.07"], ["1"]

I would appreciate it if you could also assist with that.

You were not creating a list for that select list item block. You were creating just a piece of text.

I have not seen how you format the strings coming out of your sketch, so I will assume there is no other non-numeric markup other than that comma between the two numbers.

Here is how to parse that:


Motor_Control_App_BLE_211.aia (1.1 MB)

Thank you!

Did you manage to find out why my listview keeps freezing?

Sorry, I don't see anything obvious to me.

Maybe one of the BLE experts on the board has ideas?

Oh okay. How can I get in contact with the BLE experts?

The local custom is to mention some one who made a mistake by name, so they can correct it.
No such person comes to mind, as I am not seeing any mistake in AI2.

Experts read at their own pace, and usually answer if they have something good to offer.

P.S. a nice fresh .aia export AND clear Downloaded Blocks Image (not screenshot) might attract them, like fresh birdseed.

You do not use the lastest version:

grafik

Use the current BLE version:
grafik

and request permission correctly or do not ask for permissions because the current version does it automatically.

1 Like

I just wanted to note on this, the string comes in this format: [["0.00,0.00,0,0.00"]]
. Will making the string a list and splitting it at the comma remove the [[ and ]] and ""?

Let me try this, thanks!

Show your new blocks and export them as an aia too.

Hi there, it worked out well!

I do however have another problem. I am sending data to my ESP32 and data from my ESP32 to the app. I was previously using one characteristic for the communication but when I started sending a bit more data either way, it would freeze up the app. I added a second characteristic but every time I open the app in companion, it crashes. Do you know what the problem might be?

I have attached my code:

BLE_notify.ino (22.4 KB)


Motor_Control_App_BLE_2 (1).aia (1.1 MB)

I am currently doing this and it is working but I think that it might be an inefficient way of doing it that might slow down my programme. Is there a more efficient way to achieve this or is the way that I did it also fine and changing it won't really change the speed of the programme much?

(Note: Please ignore the disabled blocks)

You could replace


with

(draggable)

to make it more robust and reduce block count.

Thanks it works!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.