Esp8266 make list read second screen

hello, I am a little lost, can you enlighten me?
I have an esp which sends me the weather data.

void loop() {
  clockdate();
  TEMP_Ext = readtemperature(0);
  TEMP_Int= readTEMPInt();
  HUM_Int= readHUMInt();
  liste_donnees = "<h1>"+String(maDate)+","+String(monHeure)+","+String(TEMP_Ext)+","+String(TEMP_Int)+","+String(HUM_Int)+" </h1>";
  html = html1 + liste_donnees + html2;

I get them in my app like this (screen1),
I make a list to save.

I read them with the tinydb in my screen 2
only when I want to read my list does it give me no data? however, I have the information in my label.

thk.

Hi

If Label_debug on Screen1 confirms the stored data as you require, but the data does not load on Screen2, it is possibly because of the TinyDB Namespace - which should be identical on for both Screen's instances of TinyDB1. (Assuming you have actually dragged TinyDB1 to both Screens).

thanks for your reply, i have good data displayed in my second screen. I have both tinydb with the same tag.
it is the construction of the list in the first screen that should not be compliant, I think. So that in my second screen I have the data, but the application tells me that it is not a table. it puts empty!
I am a little lost.

I solved part of my problem, I had my clock which reset my table.
now i think i've found the problem, i would need a list list.
I have 24 lines, with 6 data in each line. how do you do that?
Thanks for reading.

As you wrote. A list of lists. You make a list with 24 items and each item is a list with 6 items.

yes, I can do it manually. but here I receive the data from the ESP, I don't really know what to do.

It depends how is the data arrive? Not necessarily have to be list list. I made my previous app with tinydb values. Sent from the ESP8266 with JSON format and separated by key. Like this


But there are other ways. As i said depends on how the data arrive. It can be a list, but the separation of the elements is your job. It can be comma separated char stream or anything.

Here is an other method. If you have values separated by any character.



The separator can be anything you want.

You did not show us the contents of a typical responseContent from the Web1.WhenGotText event.

hello, thank you for your answers, my data arrives like this:
date, time, temp ° 1, temp ° 2, temp ° 3, hum1, hum2?
tout ces donnée sont des chiffres, le text est là pour l'explication.
merci

You wrote 24x6. How is this make that amount of data? How do you handle now? As ABG wrote, what is in your Web1.WhenGotText block now?

For complex data transmission, nothing beats JSON.
Start at
https://www.json.org/json-en.html
then
http://ai2.appinventor.mit.edu/reference/other/json-web-apis.html

1 Like

I manage to display the get text on my tel, but not in inventor.
how do we do? thank you.

hello here I succeeded;
this is what the gettext of the web block gives me.
it is the line at the bottom (date, hour, t ° 1, t ° 2, t ° 3, Hu1, hum2)
thank you

Sans titre

From your image, it looks like your data is between <h1> and <
(It doesn't show more), and its a CSV row.

Here is a procedure to extract (scrape) from web text all occurrences of text between a given prefix ('<h1>') and suffix ('<')


The output is a list, in expectation of finding more than 1 hit, so use the output in a for each loop.
Sample usage: The build server is currently busy. Please try again in a few minutes

1 Like

thank you for your answer yes the data is between h1> and <
I will study your proposal thank you