Author Topic: VeraBridge Credentials  (Read 835 times)

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
VeraBridge Credentials
« on: February 09, 2018, 02:00:53 am »
The OpenLuup log shows I'm getting a 401 error when trying to retrieve devices using VeraBridge (I currently cannot migrate any devices).  When I pasted the Http Wget command from the log into a browser, I'm prompted for my Vera credentials.  Once I enter the credentials I get a valid response.  If I don't enter credentials, I get a 401 error.

I don't see a username/password variable in AltUi to address this, or is there something I missed here....


Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #1 on: February 09, 2018, 03:14:07 am »
I've not seen this before.  It may be another 'feature' of tightening Vera security.  Can you say what versions of both Vera and openLuup?

The VeraBridge plugin can provide username/password variables if needed.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: VeraBridge Credentials
« Reply #2 on: February 09, 2018, 05:19:06 pm »
I have two Vera lites.  One is slaved to the other.  Both are running the latest firmware-- 1.7.1017.
openLuup (18.2.8)
[8246] Alternate UI (GitHub.master)
[VeraBridge] VeraBridge (18.2.5)


The odd thing about the credential prompt is that only one of my Veras prompts me for a login and password when going directly into UI7 from the browser.  So I don't think it's a firmware issue as this has been the case for years now, through many firmware upgrades.  I've looked in the UI7 interface for any differences between the two veras and I don't see any settings that could effect credentials--except for the "lock down your vera" switch.  I have this setting off, though, like most settings, I played with it in the past.

Here are the relevant openLuup log entries:

2018-02-09 13:54:39.473   openLuup.server:: WGET status: 401, request: http://10.17.XX.XX/port_3480/data_request?id=user_data2&output_format=json&ns=1
2018-02-09 13:54:39.473   luup_log:5: v18.2.5
2018-02-09 13:54:39.473   luup.set_failure:5: status = 2
2018-02-09 13:54:39.473   luup.variable_set:5: 5.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 2 now: 2 #hooks:0
2018-02-09 13:54:39.473   luup.variable_set:5: 5.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 1518158625 now: 1518213279 #hooks:0


2018-02-09 14:10:31.200   openLuup.server:: GET /data_request?id=action&output_format=json&DeviceNum=5&serviceId=urn:akbooer-com:serviceId:VeraBridge1&action=GetVeraFiles HTTP/1.1 tcp{client}: 0x20fd41e8
2018-02-09 14:10:31.202   luup.call_action:0: 5.urn:akbooer-com:serviceId:VeraBridge1.GetVeraFiles
2018-02-09 14:10:31.203   openLuup.server:: request completed (65 bytes, 1 chunks, 1 ms) tcp{client}: 0x20fd41e8
2018-02-09 14:10:31.204   luup_log:5: getting files from /etc/cmh-ludl/
2018-02-09 14:10:31.221   openLuup.server:: WGET status: 401, request: http://10.17.XX.XX/port_3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunLua&Code=%0a%20%20local%20lfs%20%3d%20require%20%22lfs%22%0a%20%20local%20f%20%3d%20io%2eopen%20%28%22%2fwww%2fdirectory%2etxt%22%2c%20%27w%27%29%0a%20%20for%20fname%20in%20lfs%2edir%20%28%22%2fetc%2fcmh%2dludl%2f%22%29%20do%0a%20%20%20%20if%20fname%3amatch%20%22lzo%24%22%20or%20fname%3a%20match%20%22png%24%22%20then%0a%20%20%20%20%20%20f%3awrite%20%28fname%29%0a%20%20%20%20%20%20f%3awrite%20%27%5cn%27%0a%20%20%20%20end%0a%20%20end%0a%20%20f%3aclose%20%28%29%0a%0a%20%20
2018-02-09 14:10:31.221   luup_log:5: error creating remote directory listing: 401
2018-02-09 14:10:31.221   openLuup.context_switch::  ERROR: [string "[5] I_VeraBridge.xml"]:672: attempt to index local 'info' (a nil value)
2018-02-09 14:10:31.222   openLuup.scheduler:: job aborted : [string "[5] I_VeraBridge.xml"]:672: attempt to index local 'info' (a nil value)

And here's the browser response if I plug the same HTTP call into a browser, and then enter credentials at the prompt:


<u:RunLuaResponse xmlns:u="urn:schemas-micasaverde-org:service:HomeAutomationGateway:1">
<OK>OK</OK>
</u:RunLuaResponse>

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #3 on: February 09, 2018, 05:42:29 pm »
I'm now really confused.  You have two bridged Veras, so one of your Veras (possibly both if you have bridged both ways) shows ALL your devices. 

Assuming youre only bridged one way, which of the two Veras requires a password?  Does the other one work OK with openLuup?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: VeraBridge Credentials
« Reply #4 on: February 09, 2018, 06:23:46 pm »
Only the main vera requires a password.  The secondary slaved vera does not prompt for credentials.  I have no idea why the devices behave this way.

In a browser, the main vera shows all my zwave devices from both veras.  The secondary vera shows only its own native devices.

I just tried to bridge to my slave vera and it works just fine....  All of the secondary vera devices loaded into Altui.  The master-slave connection between the two veras is one way only.
« Last Edit: February 09, 2018, 06:29:38 pm by Buxton »

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: VeraBridge Credentials
« Reply #5 on: February 09, 2018, 06:40:10 pm »
Though all seems to function fine, I am getting a further error when doing a "reload luup engine" from the misc dropdown:

the log entry is:

2018-02-09 15:36:00.854   luup_log:5: registering with AltUI [3] as Data Storage Provider
2018-02-09 15:36:00.854   luup.register_handler:5: global_function_name=HTTP_VeraBridgeMirror_10.17.XX.XX, request=HTTP_VeraBridgeMirror_10.17.XX.XX
2018-02-09 15:36:00.854   openLuup.context_switch::  ERROR: ./openLuup/luup.lua:466: bad argument #2 to 'format' (string expected, got nil)
2018-02-09 15:36:00.854   openLuup.scheduler:: job aborted : ./openLuup/luup.lua:466: bad argument #2 to 'format' (string expected, got nil)

I tried this several times and I get the same error and log entry each time I fire the reload command.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #6 on: February 10, 2018, 03:00:43 am »
Thanks for that. I'll take a look.  I have had to make a few changes to the bridge recently because of upcoming Vera changes.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #7 on: February 10, 2018, 08:39:01 am »
I fixed this in the latest development branch (2018.02.10)

You should now get a valid error message... I'd be very interested in seeing what it is!
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: VeraBridge Credentials
« Reply #8 on: February 10, 2018, 06:38:02 pm »
I still get an error on a reload, though the bridge plugin is working fine (for the vera that does not require credentials) and there are no errors in the log when changing a given device state.  The response of a device to a change is instantaneous, which is very impressive.

Here are the log entries for the reload error as well as some console screenshots:

2018-02-10 14:35:37.641   luup.register_handler:5: global_function_name=HTTP_VeraBridgeMirror_10.17.XX.XX, request=HTTP_VeraBridgeMirror_10.17.XX.XX
2018-02-10 14:35:37.642   luup.call_action:5: 3.?.RegisterDataProvider
2018-02-10 14:35:37.642   openLuup.scheduler:: [5] VeraBridge device startup completed: status=true, msg=OK, name=VeraBridge
2018-02-10 14:35:37.642   openLuup.server:: new client connection from 10.17.XX.XX: tcp{client}: 0x2072d398
2018-02-10 14:35:37.642   openLuup.server:: GET /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=top%20-n%201&_=1518301641175 HTTP/1.1 tcp{client}: 0x2072d398
2018-02-10 14:35:37.643   openLuup.servlet:: No handler for data_request?id=lr_ALTUI_Handler
2018-02-10 14:35:37.643   openLuup.server:: request completed (153 bytes, 0 chunks, 0 ms) tcp{client}: 0x2072d398
2018-02-10 14:35:38.018   openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=302014295&Timeout=60&MinimumDelay=1500&_=1518301641176 HTTP/1.1 tcp{client}: 0x2072d398
2018-02-10 14:35:38.520   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2018-02-10 14:35:38.539   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v2.14 now: v2.14 #hooks:0

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #10 on: February 11, 2018, 02:37:01 am »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #11 on: February 11, 2018, 08:03:30 am »
I still get an error on a reload, though the bridge plugin is working fine (for the vera that does not require credentials) and there are no errors in the log when changing a given device state. 

Yes, this one was my fault: a typo not caught by the syntax checker or testing.  In fact, it would have stopped mirroring of variables back to the Vera working, but if you're not using that, then you wouldn't have noticed.

Quote
The response of a device to a change is instantaneous, which is very impressive.

Good news... that's what we aim for!

Thanks and karma for such excellent diagnostic reporting to help me find and fix this: in latest development branch 2018.02.11.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: VeraBridge Credentials
« Reply #12 on: February 11, 2018, 11:55:11 pm »
You're more than welcome. Amazing work here. I will load the latest development version and test as soon as I have a chance.

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: VeraBridge Credentials
« Reply #13 on: February 14, 2018, 01:08:53 am »
I'm still getting an error with the latest development branch.  The Verabridge device label lights up red, and an OS error message appears, on a manual luup reload.  From digging through the stack, it looks like it comes back to the way altui is handling images. But I could be completely wrong as execution is fairly complicated.  But if so, it could be the fault of the hardcoded url in "J_ALTUI_uimgr.js" for "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/less/" which currently doesn't point to anything.

I tried going through the FortAwesome github repository, but without knowing what was intended for fonts, I can't make a call on the new url naming conventions that appear to be in place for the Font-Awesome repo (directory structure is now very different.)

Also, there is an "intro.png" missing from the cmh-ludl/icons directory--which is throwing an exception-- file not found.
« Last Edit: February 14, 2018, 01:10:42 am by Buxton »

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6152
  • Karma: +275/-69
  • "Less is more"
Re: VeraBridge Credentials
« Reply #14 on: February 14, 2018, 02:10:26 am »
This looks like an AltUI issue, which is way out of my understanding.  It might be caused by a missing file, but I couldn't say.  @amg0 is needed here, but probably isn't looking with a thread topic like this.

Suggest you start a topic in the AltUI Board with a more explicit title, or PM him, pointing to this thread.
« Last Edit: February 14, 2018, 05:05:05 pm by akbooer »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.