My Bluetooth App does not respond

Good morning, my application with communication with arduino via bluetooth stops responding when receiving data, but it connects, only when receiving it stops, can anyone help me??

Welcome to the App Inventor Forum :grin:

In the first instance Carlos, we need to see your Blocks:
Right-mouse in the Blocks work area and select "Download Blocks as image"
download blocks

UploadToTopic

We also need precise information about your hardware:

  1. Smartphone: Make/Model/Android Version/Bluetooth Version
  2. Arduino: Model and on Board Bluetooth Version or Bluetooth Module Make/Model/Bluetooth Version

It's possible that the data is arriving too fast to be processed before the next data packet arrives. Rule of thumb:

  1. Send data over the longest time interval practical to the Project. Don't send every two seconds if every 20 minutes would suffice.
  2. The time interval in the App for receiving the data should be set 20% faster than the time interval of the data sent to allow the App to process the data.

Another possibility is a miss-match of data type, e.g floats sent when integers expected. Also, your data may be exceeding the data packet limit of 20 bytes - only send data, no decorations or names/labels. If sending float or double values, reduce the number of decimal places.

Hello Cris,

These are the blocks used.
I'm also using Arduino mega 2050 and bluetooth module HC-06, the data sent comes from an accelerometer MPU-6050.

It came to work the first time, but it suddenly stopped.

...OK, you cannot receive data via a Button Block, you need a Clock Timer Block that first checks if bytes are available before reading.

So we probably need to see your Arduino Sketch too.

Here is an example Project that uses a Clock Timer for data receiving.
BT_Basic_Setup_Receive.aia (7.2 KB)

ACDT_-_acelerometer.ino (2.7 KB)

This the Sketch of Arduino

Right, so your Arduino is sending text - therefore that's the type that the App should receive (actually as per my example file).

There is no time interval control in the Sketch Loop, hence why the App does not respond - it is flooded with data.

A part of that issue is the different triggers for sending data. If more than one is true, they should be sent together in the same packet - however, you are only sending "Batida", there is no distinction between the triggers.......

ACDTacelerometerMod.ino (4.4 KB)