Message - csv text cannot be parsed as a row

Good day to all!
I am parsing the CSV-row from the HTM-page every 2 seconds.
Approximately once per 100 requests, the parsing is does not work correctly and the “list from csv row” block produces a message with an error: csv text cannot be parsed as a row.
Is it possible to check the variable is its syntax correct, to transfer 100% correct CSV to “list from csv row”?
Or is it possible to somehow prevent the “list from csv row” block from displaying an error message?

Thanks114

this sounds like you are trying to parse something, before the data is completely available?
how do you get the data? and where do you parse? somewhere else in another event?
some more blocks might help to understand, what you are doing…

Taifun

Yes, I also think that the error occurs exactly when the data is updated.
This app created about 4 years ago in Appybuilder and is successfully used by many users, the problem arose when switching to the Kodular platform.
I’m sure the parsing error has occurred before. The problem is that Apybuilder ignored it, while Kodular gives an error message that makes work impossible.

The principle of operation is as follows:
I created a controlled device on Arduino with an ESP8266 Wi-Fi module. The CSV row in HEX-format is generated when the data changes (every 2-5 seconds) on the HTM-page located on the internal web-server ESP8266. The Kodular app parse this HTM-page every 2 seconds, finds the CSV-row, converts the HEX to ASCII and creates a list (sometimes an error occurs at this point).

Is there a way to check the validity of a CSV-row inside a variable before creating the List?
This would solve the problem.

Blocks:
001




to find out, what is going on, you additionally could store the received data somewhere, for example in TinyDB or in a file… it would be interesting to know, how the data looks like when the error occurs…
probably it helps to check for the length of the csv row?

Taifun

It seems everything worked out!
More than an hour stable work
Here are 5 data packets, the third package - with an error:

Obviously, the error occurs at the time of data update, when the CSV string is in the process of being overwritten. At the same time, the TAGs of the page and the old and new data are parsed, resulting in a “mess”
I just won’t process a string if it contains text: “[” or “]”
This solution works correctly, if the wrong CSV line comes in, it is simply ignored.

Taifun, thanks for the idea!

1 Like

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