UART: Cant receive text with delimiting character


I am trying to send 9 different values ​​with , as delimiting character.

But it will not separate the values.

I have followed the guide from: Controlling LEDs via UART — Exchanging Text-based Data Between Two Boards — XOD

Down in the left corner you can see that I am receiving data. Marks with a red square
Picture of XOD program:

I send the text via MIT app inventory over bluetooth.
Picture of MIT appinventor program:

Anyone have an idea for the problem?

I assume the lower nodes are parse-number. This uses C++ function atof() to convert string to floating-point number. Your string is in Hex, which atof is going to see as “not a number” because it starts with “x” or special character, so zero will be returned.

The gweimer/utils library has a hex-to number function that will help with the first value, but it is going to return an error for the 2nd value & your string doesn’t include any more commas, so it would appear there is something wrong with either the sending code or the communication between boards.

Thank you for responding.

So if i understand it correctly. It is not possible to seperat the variables?

I will try it out tomorrow. And post again with further update.

Hello again.
I have tested your suggestion without success.
I have tested the connection in the Arduino IDE, there I can receive/send data

In the picture you can see I get the same value all the time:

Hope it makes sense

I found a solution to the problem.

look at the pictures:


Hope others can use it if they are still facing the same problem

Your fix implies that XOD was not understanding “end of line”; perhaps appinventory needs to have explicit “send end-of-line character” added for read-line to work?

I wasn’t saying it is not possible to separate variables, I was only saying that the string you displayed had special characters & only 1 comma, so XOD was not going to see more than 2 variables since you were telling XOD to split on commas.

I changes some nodes in XOD.
Im now using Read-bytes instead of read-line and added accumulate-string.

Because the accumulate-string is told that the data consists of 17 units, i guess it then knows thats is the end of line/end point of data

Im not that familiare in programming, i do mostly hobby stuff. So i might not be right in my assumption.

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