Error downloading data from vera : Handler failed

hi,

i have a problem with one grap.
When i tri to retrieve data of one channel i have this error message => “Error downloading data from vera : Handler failed”
All work perfectly with others channels.

i look the file with Winscp and it seems good

Can you help me ?

Have you looked at the log to see if there are any related error messages?

where is this log ?

Have a look here to see some ways to access it…
http://forum.micasaverde.com/index.php/topic,7750.msg148655.html#msg148655

ok i find the log
i see some errors but i dont know how to correct them …

OK - one channel doesn’t work? What is the channel name?

I’m guessing at “Ardui Hum” or “Ardui Temp” or both??

Looking at the config file, it looks like these devices have returned “Not a number” as their data at some stage. The code has then incorrectly set up the config info with a lookup table (which I currently don’t fully understand as I have no examples of these tables in my recordings but they seem to help enumerate alpha based data).

Later on when the returned data is correct, the data is used to index this table. However the table should be indexed with an integer, not a decimal number complete with one decimal point - hence the error messages you see. Regardless these tables are not required for these two channels.

I would do the following:

Check all the data files for these two channels and see if they contain a unix date followed by “nan”. If so these lines should be deleted.

Back up the config data “dataMineConfig.json” found under the /dataMine directory.

Cut & paste the config data into this site and reformat using the Validate button:

Remove the lines (only where they coincide with the “NAN” as seen below):

"Alpha": 1,

and

, <----- note the comma to be removed "Lookup": { "NAN": 1 }

Re-validate then re-upload the config file back to Vera.

You may have to do the same thing for “config.json” files found under “/dataMine/dataBase/x” where x is the channel numbers, which are 57 & 58 in your case.

After uploading restart the Luup engine.

Don’t blame me if my suggested fix(s) doesn’t work - I’m just guessing.

It would be better if the channels could be deleted from the configuration and then added back in via the GUI to refresh them - but that doesn’t appear to be possible.

Also the Arduino stuff may need safety code for handlings NaNs from the sensors.

Here is some test code that illustrates the dataMine coding problem for those interested. Refer also to line 1050 in “L_DataMine1.lua”

[code]
–local lul_value_new = 8.34
local lul_value_new = ‘nan’
–local lul_value_new = 0/0

luup.log('A NaN number: '…tostring(0/0))

if (tonumber(lul_value_new) == nil) then
luup.log(‘Result is nil’)
else
luup.log('Result is OK: '…tostring(lul_value_new))
end

return true[/code]

Thank you for your answer
It works like a charm now :slight_smile: