-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unifi OS: Authenticated, returning session - Cannot get cameras #49
Comments
Could you provide a debug log? (be sure to redact sensitive data/information from it) |
I've same problem log config.json |
Same issue here. Log
Config
|
without debug full logs I can't really do much... |
how does debug full logs mean? |
set the debug option to true in the unifi config object: https://github.com/beele/homebridge-unifi-protect-camera-motion#unifi-config-fields |
That's it [2020-6-11 7:57:01 ├F10: PM┤] [Unifi] Endpoint Style: UnifiOS '<script type="text/javascript" src="/vendor.0016115f.chunk.js"></script><script type="text/javascript" src="/main.2a54c508.js"></script>\n' + '\n' } [2020-6-11 7:57:01 ├F10: PM┤] [Unifi] Authenticated, returning session [2020-6-11 7:57:01 ├F10: PM┤] [Unifi] { url: 'https://192.168.50.1/protect//proxy/protect/api/bootstrap', method: 'get', headers: { common: { Accept: 'application/json, text/plain, /' }, delete: {}, get: {}, head: {}, post: { 'Content-Type': 'application/x-www-form-urlencoded' }, put: { 'Content-Type': 'application/x-www-form-urlencoded' }, patch: { 'Content-Type': 'application/x-www-form-urlencoded' }, 'Content-Type': 'application/json', 'X-CSRF-Token': '---------------------------------------------------', Cookie: 'TOKEN=--------------------------------; path=/; secure; httponly' }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 1000, withCredentials: true, adapter: [Function: httpAdapter], responseType: 'json', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus], httpsAgent: Agent { _events: [Object: null prototype] { free: [Function], newListener: [Function: maybeEnableKeylog] }, _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: { rejectUnauthorized: false, path: null }, requests: {}, sockets: { '192.168.50.1:443::::::::false::::::::::': [Array] }, freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: { map: [Object], list: [Array] }, [Symbol(kCapture)]: false } } [2020-6-11 7:57:01 ├F10: PM┤] [Unifi] { status: 200, statusText: 'OK', headers: { vary: 'Origin', 'x-dns-prefetch-control': 'off', 'x-frame-options': 'SAMEORIGIN', 'strict-transport-security': 'max-age=15552000; includeSubDomains', 'x-download-options': 'noopen', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'accept-ranges': 'bytes', 'x-csrf-token': '-------------------------------------------', 'content-type': 'text/html; charset=utf-8', 'content-length': '357', 'x-response-time': '2ms', 'set-cookie': [ 'TOKEN=--------------------------------------------------; path=/; secure; httponly' ], date: 'Thu, 11 Jun 2020 11:57:01 GMT', connection: 'close' }, config: { url: 'https://192.168.50.1/protect//proxy/protect/api/bootstrap', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'X-CSRF-Token': '-----------------------------------------------------', Cookie: 'TOKEN=-----------------------------------------; path=/; secure; httponly', 'User-Agent': 'axios/0.19.2' }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 1000, withCredentials: true, adapter: [Function: httpAdapter], responseType: 'json', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus], httpsAgent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: [Object], [Symbol(kCapture)]: false }, data: undefined }, request: ClientRequest { _events: [Object: null prototype] { socket: [Array], abort: [Function], aborted: [Function], error: [Function], timeout: [Array], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: true, _SNICallback: null, servername: false, alpnProtocol: false, authorized: false, authorizationError: 'DEPTH_ZERO_SELF_SIGNED_CERT', encrypted: true, _events: [Object: null prototype], _eventsCount: 10, connecting: false, _hadError: false, _parent: null, _host: null, _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: false, parser: null, _httpMessage: [Circular], timeout: 1000, [Symbol(res)]: [TLSWrap], [Symbol(verified)]: true, [Symbol(pendingSession)]: null, [Symbol(asyncId)]: 98, [Symbol(kHandle)]: [TLSWrap], [Symbol(kSetNoDelay)]: false, [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: Timeout { _idleTimeout: 1000, _idlePrev: [TimersList], _idleNext: [Timeout], _idleStart: 10014, _onTimeout: [Function: bound ], _timerArgs: undefined, _repeat: null, _destroyed: false, [Symbol(refed)]: false, [Symbol(asyncId)]: 112, [Symbol(triggerId)]: 102 }, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object] }, connection: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: true, _SNICallback: null, servername: false, alpnProtocol: false, authorized: false, authorizationError: 'DEPTH_ZERO_SELF_SIGNED_CERT', encrypted: true, _events: [Object: null prototype], _eventsCount: 10, connecting: false, _hadError: false, _parent: null, _host: null, _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: false, parser: null, _httpMessage: [Circular], timeout: 1000, [Symbol(res)]: [TLSWrap], [Symbol(verified)]: true, [Symbol(pendingSession)]: null, [Symbol(asyncId)]: 98, [Symbol(kHandle)]: [TLSWrap], [Symbol(kSetNoDelay)]: false, [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: Timeout { _idleTimeout: 1000, _idlePrev: [TimersList], _idleNext: [Timeout], _idleStart: 10014, _onTimeout: [Function: bound ], _timerArgs: undefined, _repeat: null, _destroyed: false, [Symbol(refed)]: false, [Symbol(asyncId)]: 112, [Symbol(triggerId)]: 102 }, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object] }, _header: 'GET /protect//proxy/protect/api/bootstrap HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Content-Type: application/json\r\n' + 'X-CSRF-Token: -----------------------------------------------\r\n' + 'Cookie: TOKEN=-------------------------------------------------------; path=/; secure; httponly\r\n' + 'User-Agent: axios/0.19.2\r\n' + 'Host: 192.168.50.1\r\n' + 'Connection: close\r\n' + '\r\n', _onPendingData: [Function: noopPendingOutput], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: [Object], [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', insecureHTTPParser: undefined, path: '/protect//proxy/protect/api/bootstrap', _ended: true, res: IncomingMessage { _readableState: [ReadableState], readable: false, _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, socket: [TLSSocket], connection: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: [Object], rawHeaders: [Array], trailers: {}, rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 200, statusMessage: 'OK', client: [TLSSocket], _consuming: true, _dumped: false, req: [Circular], responseUrl: 'https://192.168.50.1/protect//proxy/protect/api/bootstrap', redirects: [], [Symbol(kCapture)]: false }, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, _redirectable: Writable { _writableState: [WritableState], writable: true, _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _options: [Object], _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function], _currentRequest: [Circular], _currentUrl: 'https://192.168.50.1/protect//proxy/protect/api/bootstrap', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'x-csrf-token': [Array], cookie: [Array], 'user-agent': [Array], host: [Array] } }, data: '\n' + '<!doctype html>\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '<script type="text/javascript" src="/vendor.0016115f.chunk.js"></script><script type="text/javascript" src="/main.2a54c508.js"></script>\n' + '\n' } [2020-6-11 7:57:01 ├F10: PM┤] [Unifi] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: Error: Invalid response, missing: cameras on data |
I've change "https://192.168.50.1/protect/" to "https://192.168.50.1/protect" |
The strange thing is that the login is working but the subsequent call returns no data... |
yeah, Unifi is always open beta...... |
|
HELP WANTED. |
Hi there, I've the exact same issue.
|
I don't have the required device so unless someone provides me with the info I need this will not get fixed |
I’m happy to help, but I need a little instruction. I’m familiar with SSHing into my UDMP, jut need some direction from there. |
Happy to help as well if you give detailed instructions of what info you need! I’ve been a programmer for 30 years. :) But haven’t done anything with the Unifi APIs. |
Also happy to help. |
Ok, so here's what you can attempt:
|
Here is the full response for the bootstrap call, with sensitive info removed. This is a UDM Pro on the latest stable fw with a single G4 Pro camera on the latest stable fw:
|
Thx, that looks like what I expected. |
yep, apologies, was just about to edit my comment but I'll put the headers here for continuity:
|
Can you try with this beta build (probably will not work yet, but I've added some logging, no debug flag required) |
here's the log output:
I also tried |
Hmmm, could you try with a tool like Postman to create a get request with the request headers as shown in the debug output? |
I’ve never used that, so I’ll have to do some learning first. Bedtime for now though. |
Ok, thx for helping out! |
|
@beele If you like we could schedule a session where I can give you remote access to the Mac Mini that's running homebridge for me, so you could debug there. DM me if interested. :) |
@wr Ok seems like something is wrong with the request, just need to figure out what. I've created a postman collection with the request: https://www.getpostman.com/collections/efa3c973b8ff004bbb46 Edit: To open the collection in postman: |
|
Seeing the same with latest beta as @wr above |
Is that with the / at the end? Because I don't see a double slash in the url. If not could you try adding the / at the end? |
that was without the trailing slash. here is it with:
|
@wr was there ay further output from the second call for the cameras? |
[7/7/2020, 7:59:33 AM] [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: TypeError: Cannot read property 'status' of undefined
|
Hmm seems like the request for the camera info is failing altogether now. |
It seemed to... when I hit |
Hmm, seems like this will need some actual debugging. |
I've upgraded my UDM-PRO to the latest beta firmware and now cameras are enumerated correctly and I can see snapshots in the Home app. However, I can't live-stream video. What should I take a look at? |
What versions of UnifiOS and protect are u running? |
UDM-PRO 1.8.0-rc.7
Protect Controller 1.14.11-beta6, Web UI 1.23.0-beta.9
… On Jul 19, 2020, at 11:49 AM, hfagelnour ***@***.***> wrote:
I've upgraded my UDM-PRO to the latest beta firmware and now cameras are enumerated correctly and I can see snapshots in the Home app. However, I can't live-stream video. What should I take a look at?
What versions of UnifiOS and protect are u running?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#49 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAA2PQAPQX7J6SZ3OIZXE3R4M52PANCNFSM4NPGSMFQ>.
|
Strange! I am running the same and still get “can not enumerate cameras”
Would u pls share ur config.jason (removing the credentials of course)
…Sent from my iPhone
On Jul 19, 2020, at 9:46 PM, Thomas Fuchs ***@***.***> wrote:
UDM-PRO 1.8.0-rc.7
Protect Controller 1.14.11-beta6, Web UI 1.23.0-beta.9
> On Jul 19, 2020, at 11:49 AM, hfagelnour ***@***.***> wrote:
>
>
> I've upgraded my UDM-PRO to the latest beta firmware and now cameras are enumerated correctly and I can see snapshots in the Home app. However, I can't live-stream video. What should I take a look at?
>
> What versions of UnifiOS and protect are u running?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <#49 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAA2PQAPQX7J6SZ3OIZXE3R4M52PANCNFSM4NPGSMFQ>.
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@madrobby @hfagelnour It might indeed be config related. |
@beele Livestream never starts, I don't see anyting in the logs. |
That's the video config I use on my main and test setup (on my main setup I do use the omx variant of the vcodec) @madrobby can you post your config that's working for the camera enumeration? |
Config: {
"name": "Unifi Protect",
"unifi": {
"enhanced_classes": [],
"controller": "https://192.168.16.1:443",
"controller_rtsp": "rtsp://192.168.16.1:7447",
"username": “xxxxxxxx",
"password": "xxxxxxxx",
"motion_interval": 5000,
"motion_repeat_interval": 30000,
"motion_score": 50,
"enhanced_motion": true,
"enhanced_motion_score": 50,
"save_snapshot": false,
"debug": false,
"debug_network_traffic": false
},
"googlePhotos": {
"upload_gphotos": false,
"auth_redirectUrl": "http://localhost:8080/oauth2-callback"
},
"videoConfig": {
"maxStreams": 2,
"maxWidth": 1024,
"maxHeight": 576,
"maxFPS": 15,
"maxBitrate": 3000,
"vcodec": "libx264",
"packetSize": 376,
"audio": false,
"additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
},
"videoProcessor": "/usr/local/bin/ffmpeg",
"platform": "UnifiProtectMotion"
} |
Thx so much
It looks like u r using a USG and not a UDMP. Pls correct me if I am wrong
…Sent from my iPhone
On Jul 21, 2020, at 4:03 PM, Thomas Fuchs ***@***.***> wrote:
Config:
{
"name": "Unifi Protect",
"unifi": {
"enhanced_classes": [],
"controller": "https://192.168.16.1:443",
"controller_rtsp": "rtsp://192.168.16.1:7447",
"username": “xxxxxxxx",
"password": "xxxxxxxx",
"motion_interval": 5000,
"motion_repeat_interval": 30000,
"motion_score": 50,
"enhanced_motion": true,
"enhanced_motion_score": 50,
"save_snapshot": false,
"debug": false,
"debug_network_traffic": false
},
"googlePhotos": {
"upload_gphotos": false,
"auth_redirectUrl": "http://localhost:8080/oauth2-callback"
},
"videoConfig": {
"maxStreams": 2,
"maxWidth": 1024,
"maxHeight": 576,
"maxFPS": 15,
"maxBitrate": 3000,
"vcodec": "libx264",
"packetSize": 376,
"audio": false,
"additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
},
"videoProcessor": "/usr/local/bin/ffmpeg",
"platform": "UnifiProtectMotion"
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
You’re wrong, I’m using a UDM-Pro. :)
… On Jul 21, 2020, at 12:40 PM, hfagelnour ***@***.***> wrote:
Thx so much
It looks like u r using a USG and not a UDMP. Pls correct me if I am wrong
Sent from my iPhone
> On Jul 21, 2020, at 4:03 PM, Thomas Fuchs ***@***.***> wrote:
>
>
> Config:
>
> {
> "name": "Unifi Protect",
> "unifi": {
> "enhanced_classes": [],
> "controller": "https://192.168.16.1:443",
> "controller_rtsp": "rtsp://192.168.16.1:7447",
> "username": “xxxxxxxx",
> "password": "xxxxxxxx",
> "motion_interval": 5000,
> "motion_repeat_interval": 30000,
> "motion_score": 50,
> "enhanced_motion": true,
> "enhanced_motion_score": 50,
> "save_snapshot": false,
> "debug": false,
> "debug_network_traffic": false
> },
> "googlePhotos": {
> "upload_gphotos": false,
> "auth_redirectUrl": "http://localhost:8080/oauth2-callback"
> },
> "videoConfig": {
> "maxStreams": 2,
> "maxWidth": 1024,
> "maxHeight": 576,
> "maxFPS": 15,
> "maxBitrate": 3000,
> "vcodec": "libx264",
> "packetSize": 376,
> "audio": false,
> "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
> },
> "videoProcessor": "/usr/local/bin/ffmpeg",
> "platform": "UnifiProtectMotion"
> }
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
:) ok may be this is my problem then. I wasn’t using 443 as the controller port.
Thx again
…Sent from my iPhone
On Jul 21, 2020, at 9:46 PM, Thomas Fuchs ***@***.***> wrote:
You’re wrong, I’m using a UDM-Pro. :)
> On Jul 21, 2020, at 12:40 PM, hfagelnour ***@***.***> wrote:
>
>
> Thx so much
> It looks like u r using a USG and not a UDMP. Pls correct me if I am wrong
>
> Sent from my iPhone
>
> > On Jul 21, 2020, at 4:03 PM, Thomas Fuchs ***@***.***> wrote:
> >
> >
> > Config:
> >
> > {
> > "name": "Unifi Protect",
> > "unifi": {
> > "enhanced_classes": [],
> > "controller": "https://192.168.16.1:443",
> > "controller_rtsp": "rtsp://192.168.16.1:7447",
> > "username": “xxxxxxxx",
> > "password": "xxxxxxxx",
> > "motion_interval": 5000,
> > "motion_repeat_interval": 30000,
> > "motion_score": 50,
> > "enhanced_motion": true,
> > "enhanced_motion_score": 50,
> > "save_snapshot": false,
> > "debug": false,
> > "debug_network_traffic": false
> > },
> > "googlePhotos": {
> > "upload_gphotos": false,
> > "auth_redirectUrl": "http://localhost:8080/oauth2-callback"
> > },
> > "videoConfig": {
> > "maxStreams": 2,
> > "maxWidth": 1024,
> > "maxHeight": 576,
> > "maxFPS": 15,
> > "maxBitrate": 3000,
> > "vcodec": "libx264",
> > "packetSize": 376,
> > "audio": false,
> > "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
> > },
> > "videoProcessor": "/usr/local/bin/ffmpeg",
> > "platform": "UnifiProtectMotion"
> > }
> > —
> > You are receiving this because you were mentioned.
> > Reply to this email directly, view it on GitHub, or unsubscribe.
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@hfagelnour did you get it working with the corrected URL? |
Thx for asking but no, I am still getting the same error msg “can not enumerate the motion sensors”
…Sent from my iPhone
On Jul 23, 2020, at 8:26 PM, Kevin Van den Abeele ***@***.***> wrote:
@hfagelnour did you get it working with the corrected URL?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
0.4.1 has been released. |
Could you try with: |
Unifi OS should be working now |
@beele with the latest version, I still have the same issue: snapshots work, but I can't stream video |
Describe the bug
Installed the plugin and finally got it to Authenticate. I'm using a UDMP with Unifi-OS.
Specifications
RPBi4
UDMP - UnifiOS
Logging
[Unifi protect cameras & motion sensors] Authenticated, returning session
[Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: Error: Invalid response, missing: cameras on data
The text was updated successfully, but these errors were encountered: