MIT App Inventor 2 & Highcharts data.csv configuration with RSSI and Distance Variables

Now the list only gets the first pair then doesn't get updated anymore and it gives the same error.

Regarding your Initiate_ChartMaker_Clock blocks ... once you fix the issue Taifun pointed to, make the event handler look like the Clock.Timer in the simulation or it the Clock will not work properly.

The two Block sets highlighted with a green arrow are necessary to prevent the chart from using bad data and to avoid flickering. They ensure changes only happen when the length to the data changes. Again, be aware the 'simulation' assumes your app is posting your data to a Label. I used Label5. which sets dataCSV to the contents of the label; then immediately sets dataList as indicated. This has to happen in the simulation and I assume it is necessary in your app. If I had an esp32 I certainly would have done this differently, so I created a simulation on the assumption you created a list of pairs.

Thank you but I do not get what I need to do.

You are using 3 different globals, 2 of them which I don't have while I only use 2 globals.

I have the DataList global but I'm missing the "DataCsv and DataLength"

Just create variables the "DataCsv and DataLength" ... you can see how it was done in the simulation Blocks and aia. You will need to do something similar. Does that help?

To make it work you will have to have a correct DataList

1 Like

Yup. Thank you.

Yup, still not working and the same error :expressionless:

And also one more error now together with that one because why not

Sorry, that response is expected. You will not get a graph until your DataList is valid.

Something is still wrong with the Blocks posted as #50. There is something wrong with you TextDataReceived Block. Taifun pointed to a potential problem in #49.

The only way to do this is to use DoIt. Give yourself perhaps a coding break perhaps; someone tomorrow who has lots of Bluetooth/Arduino experience possibly can tell you what to do and he is probably now asleep. I expect the issue is something like converting a list to csvtable but I do not know. :frowning:

1 Like

I don't understand what can be wrong here, I fixed that problem that @Taifun mentioned as well and still not getting anything.

This is the way my project looks right now, if it helps:

DFPS_APP_EN (1).aia (22.0 KB)

The error I receive after data from esp32 comes in is:

as already mentioned earlier (in red)


EDIT: and (blue) what's that? you should add the items to the list only once...

it might help to learn how to work with lists and lists of lists...

Taifun

1 Like

Please DoIt with the TextDataReceived block attached to list from csv table. Then when you have it post the text here. that looks like ,[0,2 -17 .... it appears the first 'pair' is not posting although subsequent data appears fine.

It appears you did not 'fix' it ... see what he recommended

as far as I can see, that block has not changed. :cry: Did you post the wrong image?

1 Like

@Taifun recommeded to invert these two blocks from what I understood:

And I did that already (it was global text in fron of list and data list was placed in front of item)

After doing what you said (I think) the first error that appear as soon as I turn on the companion is this one:

Screenshot_20

Then, after data from Esp32 is being received, which stops being received after the first pair comes in I get this error:

Screenshot_21

The DoIt results:

Text from DoIt:

Do It Result: "0, 2
"
---

I also fixed the blocks @Taifun x-ed, now it looks like this:

I also added an empty list as well, as @Taifun suggested, here:

Btw: Thank you guys for having the patience to help a newbie, I apreciate every given answer and I hope it may help others like me to better understand how to do such things as well.

I've just noticed something but I don't know if it's wrong or not, if I just start the companion but not connect to the Esp32, for whatever reason the chart picks up the name I have set up for my label:

Also, I don't see anything wrong with the way the text is formatted, it should work but it doesn't:

I am getting the values exacly in the format you suggested @SteveJG shouldn't it work already?

I don't understand what it doesn't like, my values come exacly as they should based on your example and still doesn't work..

Screenshot_35

Screenshot_37

Screenshot_38

What exacly is the problem with the way the values are formated? I showed all my blocks, even uploaded the project and no one seems to be able to let me know what I am doing wrong, I don't understand why is it so hard to fix my code and sadly no suggestion works.

I tried to list to rows, same error. I feel like this ain't even the problem, something else must be hapening somewhere and I uploaded my project so someone that wants to help may look into it and tell me what I did wrong.

If anyone knows exacly what the problem is please let me know else I won't try anything just to see what happens anymore because my project got messed up and even the csv file check stopped working after all the things we've tried so I went back to the initial version.

Whoever wants to help has my code at their disposal.

DFPS_APP_EN.aia (21.3 KB)

I just realized that always adding a trailing \n to each pair's text is sloppy.
It leaves you with a trailing \n at the end of the CSV table text that might poison any list from csv table block.

Abandoning file storage while accumulating, and replacing it with list row addition should avoid this.

1 Like

My dear, if you mean to delete that block, we already deleted it previously, together with the Join block and global text above, the code returned the same annoying listing error.
Mind you, that is the only place where the "\n" block was used.

My Esp32 ouputs the values to the App in the form of text in exacly this form:

-x,x
-x,x
-x,x

etc.

Is this the problem?

Maybe people thought my Esp32 Arduino code delivers CSV or some kind of table, it doesn't. It simply outputs the values by sending text exacly in that form above.

Then the app somehow adds these straight brackets to it and transforms it into some kind of string, without separating the two pairs, and instead of going down it makes it like this:

[-x,x -x,x -x,x]

etc.

From what @SteveJG suggested, the correct format would be the one with a comma after the first two values, like this (please correct me if I'm wrong or if this ain't even necessary):

[-x,x , -x,x , -x,x]

etc.

I see you are expecting a message delimiter


but I don't see where you have set the BlueTooth Client Delimiter to 10, to catch println() \n.
Capture

Oops, never mind, I see it in Screen1.Initialize.

1 Like

If you require screens from my phone as well with how the app works at the moment and what does it shows on my phone screen when pressing the connect button or after connecting please let me know, I understand that without a Bluetooth device like the Esp32 and without having the Arduino code to work with, debugging of my code can be difficult which is why I am willing to do anything I can to assist debugging. In case my Arduino code is needed I can share that here as well, anything just to make it work.