VeraBridge Help

Hi guys,

I’m trying to get the VeraBridge working but have been unsuccessful so far. I’m running Cudanet’s Debain server on VirtualBox and have been been able to see and control my Vera2 from AltUI but that’s it.

In following the openLuup user guide (section 5), I see that all the VeraBridge files are there on the server, but the guide doesn’t mention if I am supposed to edit any of those.

In section 6 of the user guide, I have tried running the openLuup_getfiles.lua code but get back the following error:

test@openluup:~/vera/cmh-ludl$ lua openLuup_getfiles.lua
openLuup_getfiles - utility to get device and icon files from remote Vera
Remote Vera IP: 10.0.0.60
lua: openLuup_getfiles.lua:55: error reading remote directory listing
stack traceback:
[C]: in function ‘assert’
openLuup_getfiles.lua:55: in function ‘get_directory’
openLuup_getfiles.lua:62: in function ‘get_files_from’
openLuup_getfiles.lua:81: in main chunk
[C]: ?

Needless to say i’m a noob with this stuff but keen to get this going as my Vera2 is pretty flaky. Any help would be much appreciated!

What firmware version is your Vera 2 running?

At the point where it fails, Vera should have a file [tt]/www/directory.txt[/tt] - are you able to ssh into it and see that, or see it with the HTTP request:

http://10.0.0.60/directory.txt

It’s the latter version which getfiles is trying to use, so I’m guessing that will fail, which actually means that the code to create it earlier has not succeeded. I’ve never had a Vera 2, so don’t know what the differences might be. This is UI5, or earlier ??

[quote=“akbooer, post:2, topic:192315”]What firmware version is your Vera 2 running?

At the point where it fails, Vera should have a file [tt]/www/directory.txt[/tt] - are you able to ssh into it and see that, or see it with the HTTP request:

http://10.0.0.60/directory.txt

It’s the latter version which getfiles is trying to use, so I’m guessing that will fail, which actually means that the code to create it earlier has not succeeded. I’ve never had a Vera 2, so don’t know what the differences might be. This is UI5, or earlier ??[/quote]

I believe it is UI5 although I’m not sure how to tell what version (if there are more specific version numberings).

Yes, i can ssh into the unit and see /www/cmh folder. And I have also attached the directory.txt file from the code above.

Thanks so much for looking at this!

Oh, that’s interesting. So the code HAS produced a directory file AND you can retrieve it with a browser (or did you pull it from ssh) ? I wonder, then, why the update code cannot read it.Is the failure repeatable (I assume so) ?

If you haven’t tried the URL to access the file, give it a go.

Oh, that’s interesting. So the code HAS produced a directory file AND you can retrieve it with a browser (or did you pull it from ssh) ? I wonder, then, why the update code cannot read it.Is the failure repeatable (I assume so) ?

If you haven’t tried the URL to access the file, give it a go.[/quote]

So I have the directory.txt file - is that all I’m looking for? What do I do with that file once I have it?

The point is simply that that file is what the ‘getfiles’ script uses to download the data from Vera. But for some reason, you’re telling me that the script fails, and yet the file is there.

You should be able to access the file via the URL I gave, and that it also what the script does. So if you can access it, the script should be able to. But something is clearly going wrong. Can you confirm that you’ve troied and succeeded viewing the file with that URL?

There’s no problem with manually downloading the files you want using the UI5 interface, but it’s a bit tedious.

[quote=“akbooer, post:6, topic:192315”]The point is simply that that file is what the ‘getfiles’ script uses to download the data from Vera. But for some reason, you’re telling me that the script fails, and yet the file is there.

You should be able to access the file via the URL I gave, and that it also what the script does. So if you can access it, the script should be able to. But something is clearly going wrong. Can you confirm that you’ve troied and succeeded viewing the file with that URL?

There’s no problem with manually downloading the files you want using the UI5 interface, but it’s a bit tedious.[/quote]

So when I run the script, yes it fails with the error above. Every time. But when I used the “http://10.0.0.60/directory.txt”, yes, i was able to see that file.

And yes, i can connect via SSH to the Vera2.

Is the problem that the directory structure is different than your script is anticipating? Or you mention downloading the files - what is involved there? What files do I need?

Thanks

All the script does at that point is use the same URL, so I’m a bit perplexed.

Can I see a console script of your run of openLuup_getfiles?

Did it successfully retrieve anything? Is your files directory empty?

Also, if you look at the script code at the end, then there is a commented out section for UI5. If you uncomment those and comment out the UI7 section then let’s see what happens. This would only affect retrieval of the icons, though…

[quote=“akbooer, post:8, topic:192315”]All the script does at that point is use the same URL, so I’m a bit perplexed.

Can I see a console script of your run of openLuup_getfiles?

Did it successfully retrieve anything? Is your files directory empty?

Also, if you look at the script code at the end, then there is a commented out section for UI5. If you uncomment those and comment out the UI7 section then let’s see what happens. This would only affect retrieval of the icons, though…[/quote]

I’ve attached a console view of it and also tried changing to script to comment out the UI7 and comment in the UI5. No change. And no, no files have been added.

By files directory, i assume you mean /cmh-ludl/files and yes, this is empty. I can’t see anywhere else they might have been put.

OK. So reviewing this thread, it may be a clue, I wonder why you said

Yes, i can ssh into the unit and see /www/cmh folder.

The directory.txt file should have gone into /www/. Is that where you found it?

[quote=“akbooer, post:10, topic:192315”]OK. So reviewing this thread, it may be a clue, I wonder why you said

Yes, i can ssh into the unit and see /www/cmh folder.

The directory.txt file should have gone into /www/. Is that where you found it?[/quote]

No, the directory.txt file was on the Vera2 when i ran “http://10.0.0.60/directory.txt”. But nothing has been downloaded back to the openLuup box.

Truly bizarre. Try this piece of code (put into a file ‘test.lua’ and run with ‘lua test.lua’ in the unix shell.

local http = require "socket.http"
local info, status = http.request "http://10.0.0.60/directory.txt"
print (info, status)

What’s the output?

[quote=“akbooer, post:12, topic:192315”]Truly bizarre. Try this piece of code (put into a file ‘test.lua’ and run with ‘lua test.lua’ in the unix shell.

local http = require "socket.http"
local info, status = http.request "http://10.0.0.60/directory.txt"
print (info, status)

What’s the output?[/quote]

here:
test@openluup:~/vera/cmh-ludl$ lua test.lua

<?xml version="1.0" encoding="iso-8859-1"?> 401 - Unauthorized

401 - Unauthorized

401

Well, that’s your problem. Why is your network not allowing the port 80 access?

That’s a good question. I mean, i can access the UI5 control page at http://10.0.0.60/cmh. And it prints the directory.txt file on screen with http://10.0.0.60/directory.txt.

Is there something in my security settings on the Vera that i have set wrong?

I just ran your test code again from the AltUI Lua Test Code screen and got the following results:

See screen shot…

Yes, so that should work because it is an internal loop back to the same device. It doesn’t actually go through the network to do that.

It looks like some external network config which is stopping this?

Bingo. The problem was my setup on the Vera. I’ve fixe that and now the openLuup_getfiles script has run.

That’s great. Thanks for all your help!

That’s great news! Is the setup issue something which might happen to others and be worth explaining the solution?

I think it was as simple as having the security setting on the Vera switched off. I should have realized that sooner. Thanks for your patience though! I appreciate the help.