Code Monkey home page Code Monkey logo

Comments (12)

skrisk avatar skrisk commented on May 16, 2024 1

Jeff - Thank you for pointing me in the right side. After some debugging i was able to find out that some of the camera's that i added and removed from the account still exists in the account. That was the reason i was getting Resource Not Found error. Now it all makes sense not sure why the removed devices still show up in the camera list. Any ways thank you for your help, i will be setting up rest of the things this week that best suit my needs. Will contact you if i run in to any trouble. The only flip side is i am new to Python but have been a developer in C# and other languages for a long time. Thanks again for your time and assistance.

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

Hi @skrisk, thank you for filing the issue.

Try this code:

from Arlo import Arlo

USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'

try:
	# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
	# Subsequent successful calls to login will update the oAuth token.
	arlo = Arlo(USERNAME, PASSWORD)
	# At this point you're logged into Arlo.

	# Get the list of devices and filter on device type to only get the cameras.
	# This will return an array of cameras, including all of the cameras' associated metadata.
	cameras = arlo.GetDevices('camera')

	# Turn camera on.
	print(arlo.ToggleCamera(cameras[0], True)))
	# Turn camera off.
	print(arlo.ToggleCamera(cameras[0], False)))

except Exception as e:
    print(e)

from arlo.

skrisk avatar skrisk commented on May 16, 2024

I tried that to begin with then only ended up passing the basestation as i was able to do a little reading in to the Arlo class. This is the error i got when i try the example code.

must be str, not bool

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

Okay, great! Looks like I neglected to fix the example code when I update the API. I also made a small tweak to the ToggleCamera function.

Pull the latest code git pull and try this:

from Arlo import Arlo

USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'

try:
	# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
	# Subsequent successful calls to login will update the oAuth token.
	arlo = Arlo(USERNAME, PASSWORD)
	# At this point you're logged into Arlo.

        # Get the list of devices and filter on device type to only get the basestations.
	# This will return an array of basestations, including all of the basestations' associated metadata.
        basestations = arlo.GetDevices('basestation')
	
        # Get the list of devices and filter on device type to only get the cameras.
	# This will return an array of cameras, including all of the cameras' associated metadata.
	cameras = arlo.GetDevices('camera')

	# Turn camera on.
	print(arlo.ToggleCamera(basestations[0], cameras[0], True)))
	# Turn camera off.
	print(arlo.ToggleCamera(basestations[0], cameras[0], False)))

except Exception as e:
    print(e)

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

Resolved in 4210b59

from arlo.

skrisk avatar skrisk commented on May 16, 2024

Thank you Jeff, after applying the change i still get the same error "Resource Not Found".

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

Did you try with the code I posted for you in my last comment? It works fine for me.

from arlo.

skrisk avatar skrisk commented on May 16, 2024

Yes i did try with the code you posted. I also did a git pull to the latest changes. Not sure why i am getting 'Resource Not Found'.
this is the call i make: print(arlo.ToggleCamera(basestation[0],cameras[0],False))
Error: {'resource': 'cameras/XXXXXXXXXXXXXX', 'action': 'set', 'error': {'code': 4000, 'message': 'Resource not found.'}, 'properties': {'privacyActive': False}, 'transId': 'web!XXXXXXXXXX.XXX!XXXXXXXXXXXXXX', 'to': 'XXXXXXXXXXXXXX_web', 'from': 'XXXXXXXXXXXXXX'}

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

from arlo.

skrisk avatar skrisk commented on May 16, 2024

try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At this point you're logged into Arlo.
basestation = arlo.GetDevices('basestation')
# Get the list of devices and filter on device type to only get the cameras.
# This will return an array of cameras, including all of the cameras' associated metadata.
cameras = arlo.GetDevices('camera')

# Turn camera off.
#print(arlo.ToggleCamera(basestation[0], cameras[0], False))
print(arlo.ToggleCamera(basestation[0],cameras[0], True))	
# Turn camera off.
#print(arlo.ToggleCamera(cameras[0], False))

except Exception as e:
print(e)

This above is my code. It was able to establish a connection, query the stream then getting an error resource not found. Thanks.

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

Please print the basestation and cameras arrays and send me the output.

from arlo.

jeffreydwalter avatar jeffreydwalter commented on May 16, 2024

Happy to help! Glad to hear you figured it out.

from arlo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.