Skip to content
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

any docs, quick getting started #13

Closed
dturton opened this issue May 20, 2019 · 11 comments
Closed

any docs, quick getting started #13

dturton opened this issue May 20, 2019 · 11 comments

Comments

@dturton
Copy link

dturton commented May 20, 2019

Is there any documentation or a quick example of how to subscribe to an event stream?

@Kane610
Copy link
Owner

Kane610 commented May 20, 2019

Sorry, no documentation. Closest is to look at the tests or the home assistant implementation right now.

Everything that is needed is referenced here https://github.com/home-assistant/home-assistant/blob/eb912be47a2c9d032dbf9a84751c77d4896fa8b3/homeassistant/components/axis/device.py#L68

Abbreviated you can do it with

device = axis.AxisDevice(
        loop=hass.loop, host=config[CONF_HOST],
        username=config[CONF_USERNAME],
        password=config[CONF_PASSWORD],
        port=config[CONF_PORT], web_proto='http')

and

device.start()

@dturton
Copy link
Author

dturton commented May 20, 2019 via email

@Kane610
Copy link
Owner

Kane610 commented Jun 1, 2019

Hey!

Updated the main function so you can get quite far with that now 👍

https://github.com/Kane610/axis/blob/master/axis/__main__.py

@dturton
Copy link
Author

dturton commented Jun 3, 2019

Thank you!

@dturton dturton closed this as completed Jun 3, 2019
@dturton
Copy link
Author

dturton commented Jun 4, 2019

Hi, I am getting an error -- Bad Request any idea what I am doing wrong?

Received data ['RTSP/1.0 400 Bad Request', 'CSeq: 1', 'Server: GStreamer RTSP server', 'Date: Tue, 04 Jun 2019 12:09:48 GMT', ''] from 192.168.1.102 192.168.1.102 RTSP 400 Bad RTSP session (192.168.1.102) state starting DESCRIBE rtsp://192.168.1.102/axis-media/media.amp?video=0&audio=0&event=off RTSP/1.0 CSeq: 1 User-Agent: HASS Axis Accept: application/sdp

@dturton dturton reopened this Jun 4, 2019
@Kane610
Copy link
Owner

Kane610 commented Jun 4, 2019

Hmm. Could be that you do a rtsp request that doesn't want any content

@dturton
Copy link
Author

dturton commented Jun 4, 2019

this is my code. I am not a Python dev so I might have an error?

import asyncio
import axis
import logging

from axis import AxisDevice


async def main():
    loop = asyncio.get_event_loop()
    device = AxisDevice(
        loop=loop, host="192.168.1.102", username="user",
        password="pass", port=80)

    device.start()

    try:
        while True:
            await asyncio.sleep(1)

    except KeyboardInterrupt:
        pass

    finally:
        device.stop()


logging.basicConfig(format='%(message)s', level=logging.DEBUG)
asyncio.run(main())

@Kane610
Copy link
Owner

Kane610 commented Jun 4, 2019

Sorry, I had removed one line for some reason... It is fixed now

@wiseman
Copy link

wiseman commented Jul 20, 2019

Do you have any examples of moving (panning or tilting) the camera?

@Kane610
Copy link
Owner

Kane610 commented Jul 20, 2019

No. There is no ptz support in this library yet

@Kane610
Copy link
Owner

Kane610 commented May 26, 2020

Just an FYI Im gonna implement PTZ support shortly

@Kane610 Kane610 closed this as completed May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants