BLE add on - "Register for Bytes" block crashes code

Hi all,

I'm trying to design a user interface app for a design project. The app is supposed to be able to connect via Bluetooth Low Energy to an external microcontroller (we are using a BlueNRG-LP development board) and send and receive bytes of data based on the user's activity.

I'm new to MIT app inventor and coding user interface apps in general, so it might be something silly I've done.

Right now, the app can connect successfully to the BlueNRG-LP as long as I don't have a RegisterForBytes block in the code. I have the RegisterForBytes block being called when we connect to the device right now; when it's enabled, the app crashes upon connection. When I comment it out, the app connects without a problem. This is an issue, because I need the app to be able to send and receive bytes for it to work.

Additionally, when I try to send bytes, I get the error message "invalid long" followed by the last 10 digits of the UUID I specified. I don't know what this error is supposed to mean, since that's not the data I'm trying to send.

I'm attaching my code as a png file so any of you can look at it. Any help would be appreciated. Thanks!

I'm no BLE expert, but I have seen how event blocks inform their code of input data.

The circled usage makes no sense.

This event block is informing you about the incoming data, for your benefit, and you try to tell it to ignore the evidence of its own eyes?