Receiving String data from ESP32 Bluetooth and making it into coordinants

I need some serious help with this code. We are trying to recieve coordinates from our GPS module and send it through bluetooth from our ESP32. We are using string data. We have it connected but we cant get the data. Any tips? Heres the blocks for the majority of it.

welcome Brock..

This community discussion might be helpful Connecting ESP8266 (NodeMCU) with Android app (MIT APP inventor) especially the longitude and latitude from a gps module



might help

Your BLE event that receives stringValue lists is ignoring its incoming BLE data stream entirely.

That's a list, with at least 1 item..

Show the items in a Label.Text or ListView Elements so we can see how they look, then decide on how to extract longitude and latitude.

Upload your sketch also, so we can have better chances of predicting what the input stream will hold.

Do you want the Arduino code? Sorry, I'm new to MIT App Inventor Lingo.

Here I can send both the Arduino code and the MIT app Inventor code if you wanna take a look at it or have some additional suggestions.

GPS_2_copy.aia (219.8 KB)

BluetoothAndGPSWorking.ino (3.3 KB)

Hi @BrockD,
i've just given a (very) quick sight to your .ino code.

As a general hint don't use the delay() function that very often (it depends on which board and which level of compiler) it completely blocks the CPU of the board, therefore preventing serial ad BT transmissions, sensors acquisition, etc.
In place of that you can use your own:

void Delay(unsigned long timeout)
unsigned long now = millis();
while (( millis()-now) < timeout); // do nothing while maintining the CPU alive

Typical use:
Delay(1000); // wait 1 second

Probably this does not solve the issue, but it is a good practice to avoid the use of the standard delay() that often creates weird behaviours.

Thank you! I will take that into account!

1 Like

but, please take also in account what @ABG has already said.

For futrher aid, you might want to have a look to the example that I've posted a few days ago about a use case of a BLE Tx-Rx between AI2 and ESP32 in UART mode:

Hoping it can help.

1 Like