Git Product home page Git Product logo

Comments (15)

goruck avatar goruck commented on May 26, 2024

Hey,

I just needed to provide the account linking info in my smart home skill as described here. My lambda endpoint code does not actually perform access token validation. So in essence my lambda code fakes out access to a camera device cloud service. Its a hack for sure but that's the whole idea with this project - to use Alexa's Smart Home Skill API with standalone IP cameras without needing cloud service.

Hope that answers your question. If not let me know.

Thanks.

Lindo

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

Ah! I should have looked at the code a bit closer. So I do setup the skill as a templated video/camera skill and then just point the account linking at the Lamba function. I'll play around with it and add some comments here on this is. Then I can try putting together a PR with deeper documentation.

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

How did you can an URI for the Lamba function? Did you just stick an API Gateway in front? I'm currently working on that part but cannot get past enabling the skill in the app. The API Gateway is still telling me 403 and not hitting Lamba yet

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

Okay, I've got it all connected together. Now though I'm left with the Lamba function returning the following when I attempt to test it:

2018-06-26T22:33:42.935Z faecbbd4-7990-11e8-8dc2-1999af94f919 TypeError: Cannot read property 'header' of undefined at exports.handler (/var/task/index.js:320:30)

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

I've got this all working now except if it actually displaying the camera. I ended up using the Login with Amazon (LWA) to handle the OAuth bits. Now though when I saw "Show me the Backyard Camera" it starts to load, but then I simply get a "beep beep" error. I'm not really sure where to go next. Is is possible to get device side logs @goruck

from alexa-ip-cam.

goruck avatar goruck commented on May 26, 2024

@koensayr by device side do you mean logs from the Live555 proxy and stunnel? I can get that but can you check your lambda cloudwatch logs to see if you are getting an entry like this after invoking the Alexa skill:

2018-06-28T01:14:09.856Z 0070c7bb-1769-4a89-b0bb-90c939f59de2 [DEBUG] Control Confirmation:
{
    "event": {
        "header": {
            "correlationToken": "AAAAAAAAAACkDgXwIdlvVMwW40cU/p8cDAIAAAAAAAAVaoTKiz4iiXE+xg1zxRO2c6kj8HWmzBMiybrAYsSUwx2YtYsAEbDFnCPFVBv5dSwhavAvZT60OiVid0t+hE5kq0rMlJHX1hsaTcBFoJcexVXhMn/+Rk7oRaHJoXOJDl43v1ponp1YaFXMhM6wtowm/x+oSPivystjE+neRX649dhAXFDM+0l00MQtw5XrywwOFYR/Es8k8+9RnAeIajfeRVO7GisAT517RG002xN3U5lUj2OKd3p6sP7Amb28K4XcgxXilwU3bgM9m1gLb2qxDnVIRYZVVMU49+IgdQx/cbPLrDFAGeDqIZRrU8z8r8bqEIKrwoFDZR+J4WMlCVVfbYgD9FwjSn5E/bNiUqiGsLwhj9pHU+Iuoj9H64FELGw/3uLpg1ZnN/eESaUcWh82YEXBy6SSK1d9Cdy6ZJIQQ3u4AqogBqZobMvar6v8YrYpZwxMiPF5XyFIj8PCkcF/7WdOB+bEwxU2zJrYCQLDTGVJIPoA8L2tNKx//MjW2XUEzsnJZO1aR4f+K1yzP2NYKltHtbW/fNlC8qM1VSV7MqSSn0ZfTPi1U1nrKt/kNcYAJ4W+5kDL/EC5s6mnPBTPS5iy1z1NiKFd7o8xXc0bRSR5TVenDSDbSElWc7onlaUOhuulFEuy507oHV4ZW+TCtqa9M0Ys/nlxSIaLsvAa8fqdA3BrWXAgjkpHPQ==",
            "messageId": "ee352596-1bcb-4dca-913a-d18664591240",
            "name": "Response",
            "namespace": "Alexa.CameraStreamController",
            "payloadVersion": "3"
        },
        "payload": {
            "cameraStreams": [
                {
                    "uri": "rtsp://cam.lsacam.com:443/proxyStream-1",
                    "resolution": {
                        "width": 1920,
                        "height": 1080
                    }
                }
            ]
        }
    }
}

If so then your lambda code is probably working Ok.

If that's Ok then try opening up the rtsp stream locally using VLC or another media player. We can go from there depending on what you find.

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

Yes I see those messages in my CloudWatch logs so I feel confidant the Lamba is working correctly:

        "payload": {
            "cameraStreams": [
                {
                    "uri": "rtsp://192.168.1.10:88/videoMain",
                    "resolution": {
                        "width": 666,
                        "height": 375
                    }
                }
            ]
        }

I'm not using the Live555 or stunnel encoder because it appears my cameras can deliver RTSP natively. I noticed though perhaps it doesn't want to load because I'm not using SSL on the connection type? If thats a good hunch do you have any idea where the device (the Echo itself) would log or notify you about this?

from alexa-ip-cam.

goruck avatar goruck commented on May 26, 2024

I think I understand your problem - the port is wrong.

The Smart Home Camera API requires the feed to use TCP socket encryption on port 443. Looks like you are using port 88. If you can configure your camera to use port 443 it may work but that is normally used by https so you may have to redirect other services that use that port. Also this will only work for a single camera. In may case I have several which is why I used Live555 as to aggregate all the camera feeds then I used stunnel to map the Live555's rtsp port to port 443.

Try changing the port to 443 and let me know if that works!

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

Its funny, I caught that too after I posted that and switched to port 443. Still the same result.

Funny enough I stumbled upon monoclecam.com. I get a little further and even tried using the proxy with them. I found this tip about Foscam Cameras so I tried the proxy work around. I get a little bit further but the video never comes up. In fact, the Echo Show kinda gets locked up and I have to power cycle it.

from alexa-ip-cam.

goruck avatar goruck commented on May 26, 2024

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

I thought that perhaps the camera isn't handling the TLS properly and perhaps the port 443 is just in the clear. Poor assumption on my part.

Anyway, I've moved over to try to encrypt things through stunnel as you suggested but I'm not getting very far there. According to the stunnel logs I don't even see a connection attempt incoming.

When I was using the MonocleCam site I mentioned I got further and ultimately caused the device to lock up. The screen should change to say "connecting to camera" and then basically just get stuck there. Trying to wake the device with "Alexa" did nothing, and the button presses were seemingly ignore. If its interesting to you, I'd be happy to post a video.

from alexa-ip-cam.

goruck avatar goruck commented on May 26, 2024

With regards to your stunnel issues turn on debugging in its config file and send me a log. I'll have a look. You turn on debugging by un-commenting the following lines in your stunnel.conf:

; Some debugging stuff useful for troubleshooting
debug = 7
foreground=yes

Note that the certs used by stunnel have to be valid (not self signed) for the encrypted connection to work with the Alexa service.

Yes, please send me the video. I work at Amazon and want to make sure we track this down. The device should never lockup. Sorry about that.

from alexa-ip-cam.

koensayr avatar koensayr commented on May 26, 2024

I'll get you a video this week. Perhaps you can hit me up on Chime? I'm at AWS @TheJosh

from alexa-ip-cam.

goruck avatar goruck commented on May 26, 2024

thanks, i'll try chiming you and let me know how the stunnel debug went.

from alexa-ip-cam.

goruck avatar goruck commented on May 26, 2024

closing. handled offline.

from alexa-ip-cam.

Related Issues (14)

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.