Page 1 of 2

SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 21 Jul 2015 11:51
by fableman
When I do: http://10.10.10.80:8083/ZAutomation/api ... command/on

I recive: {"data":null,"code":401,"message":"401 Unauthorized","error":"Not logged in"}

I can't find any information regarding this, or where to set user access...

Please help..

SOLVED READ LAST POST!

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 21 Jul 2015 12:35
by fableman
If I goto: http://10.10.10.80:8083/smarthome/

and create a user: me
with pass: me1234

And try this:
http://me:me1234@http://10.10.10.80:808 ... command/on

Still not working from other IP/client on same LAN

Authentication is messy and not working at is should anymore!!!
Or how should I login and verify my self now??? All this was working before...

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 21 Jul 2015 12:42
by fableman
I have the module Z-Wave Network Access Active.


Enable Z-Wave API
Handler HTTP requests to /ZWaveAPI/* and /ZWave//*

Allow public access to Z-Wave API
Do not ask for authentication to access Z-Wave API

Create virtual devices in Home Automation engine
Without this Z-Wave devices will be visible only in Expert UI and via Z-Wave API

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 21 Jul 2015 13:00
by fableman
If anyone have a solution I will be very happy, I put alot of time and coding my own controlls and now after upgrading I can't send remote commands any more :(

Is it safe to downgrade? I read about corrupted admin accounts...

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 21 Jul 2015 20:19
by fableman
Sorry but getting abit desperate now!!

I tried to downgrade to last working version 2.0.1-rc31 and now:
Log file:
[2015-07-21 19:15:10.983] [core] Executing script: /* Start Core/Base */ ...
[2015-07-21 19:15:10.995] [core] Executing script: /* Start Core/Collection */ ...
[2015-07-21 19:15:11.007] [core] System: Loading Config
[2015-07-21 19:15:11.011] [core] System: Loading Boot Scripts
[2015-07-21 19:15:11.020] [core] System: Boot folder is empty
[2015-07-21 19:15:11.023] [core] System: Registering Models
[2015-07-21 19:15:11.033] [core] Executing script: /* System: User Model */ ...
[2015-07-21 19:15:11.041] [core] Executing script: /* System: Users Collections */ ...
[2015-07-21 19:15:11.049] [core] {"dataSource":"memory","public":false}
[2015-07-21 19:15:11.053] [core] Executing script: /* System: User Model */ ...
[2015-07-21 19:15:11.055] [I] [core] Executing script: /* System: Users Collections */ ...
[2015-07-21 19:15:11.064] [I] [core] {"dataSource":"filesystem","file":"users","public":true}
[2015-07-21 19:15:11.064] [I] [core] System: Registering Handlers
[2015-07-21 19:15:11.068] [I] [core] Executing script: /* System: Loaded Cors Handler */ ...
[2015-07-21 19:15:11.070] [I] [core] Executing script: /* System: Loaded Cors Handler */ ...
[2015-07-21 19:15:11.072] [I] [core] Executing script: /* System: Loaded Rest Handler */ ...
[2015-07-21 19:15:11.074] [I] [core] Executing script: /* System: Loaded Cors Handler */ ...
[2015-07-21 19:15:11.076] [I] [core] Executing script: /* System: Loaded Cors Handler */ ...
[2015-07-21 19:15:11.083] [I] [core] Executing script: /*** Z-Way HA Virtual Device base class *************************************** ...
[2015-07-21 19:15:11.089] [I] [core] Executing script: /*** Z-Way DevicesCollection class ************************************ ...
[2015-07-21 19:15:11.107] [I] [core] Executing script: /*** Z-Way HA Controller class module ***************************************** ...
[2015-07-21 19:15:11.111] [I] [core] Executing script: /*** Z-Way HA Controller class module ***************************************** ...
[2015-07-21 19:15:11.115] [I] [core] Executing script: /*** Z-Way HA Automation module base class ************************************ ...
[2015-07-21 19:15:11.120] [I] [core] Executing script: /*** Main Automation storage module ***************************************** ...
[2015-07-21 19:15:11.135] [I] [core] Executing script: /*** Main Automation webserver module ***************************************** ...
[2015-07-21 19:15:11.138] [I] [core] Executing script: // Make this testable by pulling in underscore from the parent module ...
[2015-07-21 19:15:11.144] [I] [core] Executing script: /*** Main Automation storage module ***************************************** ...
[2015-07-21 19:15:11.166] [E] [core] result: Error: TypeError: Cannot read property 'indexOf' of undefined
at new AutomationController (automation/classes/AutomationController.js:48:74)
at automation/main.js:283:22

Downgrade not working and my z-wave controlled house is dead! :(

Need help........

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 21 Jul 2015 20:32
by fableman
upgraded to : z-way-server-RaspberryPiXTools-v2.0.2-rc1-12-g8364373.tgz

But still this problem:

root@zwave-raspberrypi:~# curl -s -LN --globoff http://10.10.10.80:8083/ZAutomation/api ... ommand/off

{"data":null,"code":401,"message":"401 Unauthorized","error":"Not logged in"}

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 21 Jul 2015 22:46
by fableman
I found a solution / workaround..

Turn switch device 29 off from bash:
curl -s -LN --globoff 'http://10.10.10.80:8083/ZWaveAPI/Run/de ... 37].Set(0)'

Turn switch device 29 on from bash:
curl -s -LN --globoff 'http://10.10.10.80:8083/ZWaveAPI/Run/de ... 37].Set(1)'


Turn dimmer device 29 on from bash:

curl -s -LN --globoff 'http://10.10.10.80:8083/ZWaveAPI/Run/de ... l.Set(255)'

and off:

curl -s -LN --globoff 'http://10.10.10.80:8083/ZWaveAPI/Run/de ... vel.Set(0)'

Re: 2.0.2 RC1 problems. Unauthorized","error":"Not logged in

Posted: 22 Jul 2015 02:54
by Plainsane
fableman wrote:upgraded to : z-way-server-RaspberryPiXTools-v2.0.2-rc1-12-g8364373.tgz

But still this problem:

root@zwave-raspberrypi:~# curl -s -LN --globoff http://10.10.10.80:8083/ZAutomation/api ... ommand/off

{"data":null,"code":401,"message":"401 Unauthorized","error":"Not logged in"}

i had this problem, but i had to flush by browser cache and reenter my user/password, then it started working again. i really hope this helps.

Re: SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 22 Jul 2015 14:50
by PoltoS
Please note that HTTP Authentication will not work, you need to pass data to api/v1/login and get a cookie (or header) and use it in next requests.

So, you should try, if 401, login and save the session ID and then use it in next curl request

Re: SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 22 Jul 2015 19:27
by aivs
To login with curl use this command, it saves cookie to file "cookie.txt" :

Code: Select all

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"form":true,"login":"admin","password":"admin","keepme":false,"default_ui":1}' http://192.168.0.62:8083/ZAutomation/api/v1/login -c cookie.txt
Now you control devices with command:

Code: Select all

curl http://192.168.0.62:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_6-0-37/command/on -b cookie.txt
Be sure to use cookies.