jeffreydwalter / arlo-go

WIP - (BETA) - Go package for interacting with Netgear's Arlo camera system.
MIT License
42 stars 8 forks source link

Arlo Q & other no base station cameras #22

Open kevink opened 4 years ago

kevink commented 4 years ago

Hi Jeffrey. I have been experimenting with the API trying to get it to arm and disarm my Arlo Q cameras. I saw a note on your python repo to pass the camera in as the base station but I am not sure what a call would look like. I tried setting the parentID to the same device but no luck.

Any tips on what a ToggleCamera func like your python one would look like in go?

Thanks for any pointers.

-Kevin

jeffreydwalter commented 4 years ago

Hey @kevink the arloq cameras are both a camera and a basestation. Can you send me the code you're using? I haven't added the ToggleCamera method from the python library to this library yet. I think you should just be able to call camera.On() and camera.Off().

kevink commented 4 years ago

Going back through the code it looks like I have been getting stuck on IsCamera since the arloq fails that check so the cameras array never gets any entries even though I have 3 arloq cameras. The arloqs respond with DeviceTypeArloQ instead of DeviceTypeCamera. Should I just try forking and hacking the cost or should the library realize arloq is a camera? Thanks for the help here.

jeffreydwalter commented 4 years ago

@kevink I think it should recognize arloq as both a camera and a basestation. There's probably a bug in the code that parses the GetDevices() call and sorts them into their respective arrays.

jeffreydwalter commented 4 years ago

@kevink I just made a couple of changes to master. Check this out: https://github.com/jeffreydwalter/arlo-go/commit/a8b31e22a8d48c2540d20d374c5c3683b3cdcb85

IsCamera() should now consider arloq cameras as cameras and basestations.

kevink commented 4 years ago

Getting this error github.com/jeffreydwalter/arlo-go@v0.0.0-20200420215645-6818ec9971f3/devices.go:109:9: syntax error: unexpected return, expecting expression

I think we need a colon after DeviceTypeArloQ not a comma

jeffreydwalter commented 4 years ago

Sorry, made those changes real quick in vim...

kevink commented 4 years ago

I feel like we are making progress, here is a minimal running program. The program fails with Failed to turn on: failed to reconnect to event stream: failed to turn camera on: basestation not connected to event stream Stepping into the code it seems like the lib does not know the camera is the base station. I tried hacking the parentid to be the camera but same error.

https://gist.github.com/kevink/fb7678d9b7745972de86c975c741a81a

jeffreydwalter commented 4 years ago

@kevink can you paste the output of GetDevices for me. I'd like to see what the schema looks like.