Sending Packets from App to Arduino via Bluetooth

Have any of you messed with Bluetooth to Arduino/ESP32 communication? I’m building an app on MIT App Inventor that has three buttons and three sliders sending info the ESP32. The problem I have is that I need to send six different sets of info, but the sliders all send 0-255 and the buttons could be anything. What is the proper way to send packets that the ESP32 an differentiate what slider is sending the number?

I set the App to send different groups of numbers and then mapped them in Arduino back to 0-255, but it seems like a hack.

Prefix each value with an ID in the App and separate them in the Arduino Sketch on receive.


Thanks for the comment! So send them as a string and separate them on the arduino end?

Yes indeed - how did it go?

I’m still trying to wrap my head around how it works. Thanks for asking! I have done a ton of Arduino/ESP side programming, but have only used serial for debugging. I’m getting confused as to what exactly is going on and how to implement it in a way that makes sense to me. seems everyone has a different way of going about it. I’m stubborn though. I will get it!

Hello..i also have a query to add. I already know how the serial communication with Arduino works. I'm worried about the code/commands required to receive data from the Bluetooth connection.

Can assure that the HC05 can handle the kind of protocol being used? In the post I found it says it doesn't use ASN.1 or Zigbee. I assume it is a custom protocol. Oh and it is binary based. Does this matter?

Here examples of HC06, similar to HC05