X10 Community Forum

📱🖥️PiX10Hub ( Always Evolving Open Source) => 🏥Help and Trouble Shooting => 🧞HomeGenie ⛑Help => Topic started by: soxfan1966 on April 18, 2019, 07:23:39 PM

Title: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 18, 2019, 07:23:39 PM
So I have 3 IP Cameras added to HG. 

They will show up in the HG Full App - they are each defined with the API URL, and then the optional username and optional password.

If I pull up HG in a browser on my computer, the same images do not show up but it looks like its trying to get the image:
(http://capture.PNG)

If I go to a separate browser tab and type in the API URL I get prompted for a user and password - if I enter them, the image will show up in the browser tab and in HG.

I tried defining the user and password as part of the API URL (i.e. http://user:password@ipaddress) but that does not seem to work either.

Thoughts ?
Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 19, 2019, 07:32:50 AM
I'm confused (maybe I need to wake up more) were are you accessing viewing HG full app from? The RPi ui?
I have my cameras setup with http://user:password@ISPasignedIP: CameraPort
Do you have port forwarding set up for your cameras?
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 08:07:25 AM
So the HG App is on my phone (Android) and the browser I am opening is on my desktop computer - both accessing HomeGenie running on my RPi.

I do not have port forwarding enabled for the cameras because I have 3 of the same cameras - each with it's own IP address - but they all use the same port.

And if I am accessing on my local network would the port forwarding even come into play (I was under the impression that was for external access to forward from the IP of your internet provider to a specific node on the network).

So on my local network, opening a browser and using  http://user:password@ISPasignedIP does not work (I get prompted with  user / password input box).  Once I enter that then they image appears.  Every time I turn off my computer and log back on the same thing happens.

So I may have 2 problems?
1) Not port forwarding
2) Not passing the user:password correctly in my camera setup in HG

Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 19, 2019, 08:46:09 AM
So you can see images on you phone HG Plus app but not in a browser correct?
What browser are you running?
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 08:54:38 AM
Chrome (latest version / build)
Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 19, 2019, 09:00:57 AM
Ok I have no problem viewing my cameras in HG with the window edge browser. Have you tried it or another browser?
Can you view from your phones browser if you use it instead of the app?
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 09:33:07 AM
Phone browser has the same problem, but since its a Pixel2 its using Chrome as the Browser.

I tried on Firefox - instead of the user / pwd box I get a message box: You are about to log into the site "ip.address" with username "username".  NOTE: the actual IP and username appear.  It has an OK and Cancel button.  If I click OK, then it works.

I tried on MS Edge - same problem
Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 19, 2019, 09:52:32 AM
Ok it may be how the camera URL is specified in the generic camera app is incorrectly typed.
every manufacture doesn't use the same standard. This is the format for my easyn camera
 http://MyIP:PORT/snapshot.cgi?user=NAME&pwd=PASSWORD&resolution=32  I use a different URL format like I posted I'll not get an image or get asked for a password in the browser
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 10:04:12 AM
OK, I will give that a shot (I am currently VPN'd so need to wait till later).

Do you also have your cameras entered in your router for Port Forwarding ?

Also, what does the &resolution=32 at the end of the URL do?
Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 19, 2019, 10:17:10 AM
The &resolution=32 tells the camera what resolution(size) to send the captured image at I could use 64 but figured the smaller resolution is all that is needed for HG and it won't slow up my connection to my off grid play much.
I need port forwarding so my cameras can be seen on my phone(when not connected to the Routers Wi-fi) or connecting from my other home.
 >!
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 10:20:15 AM
So is each camera on a different port then?

If we can change resolution like that, can we also change orientation (other post on that)?
Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 19, 2019, 10:28:27 AM
The resolution is part of the manufactures API call if not specified it attempts to send at highest resolution I believe.  I don't believe it had a orientation call. I'll try some options for that maybe this weekend as I've freed up some time with the new RPi Tools now done. I do have the API calls for some of the Airsight cameras I'll see if there is a option in that which might work for orientation.
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 02:17:46 PM
Just tried this in Chrome and it still prompts me for user and password:
http://IpAddress/snap.jpg?user=USER&pwd=PASSWORD

where IpAddress, USER and PASSWORD are my actual values

Same thing in Edge and Firefox.

Not sure if it's something I am not defining right or maybe just a limitation with the cameras I have
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 07:24:29 PM
Got my IP camera's all set up and port forwarded - I needed to download the PC software to be able to change the port on the camera (could not do from their android app)

Still playing around with the user name and password though

Another question - the cameras have an HTTP Port (what I am using now), an RTSB Port and an ONVIF port (with some other settings on each of those).

Not sure what the advantage of each of those is, or if they perhaps offer a better alternative to getting them to work better in HG.
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 19, 2019, 08:02:49 PM
With my cameras port forwarded and set up in HG using Tuicemen's approach things seem to be working now.  Here is the current setup:

http://<ExternalIpAddress>:<Port>/snap.jpg!user=<user>&password=<password>

where <ExternalIpAddress> = router IP address (or domain name if you use that)
          <Port> = port specific to each camera
          <user> = user name used to log onto the camera
          <password> = password used to log onto the camera

I can see the camera pictures in HG on my desktop computer, on my android in the browser (same approach as Desktop in browser) and also in the HG Android App.  So I think this is now working.

Thanks
Title: Re: Getting IP Camera image to Display in HG
Post by: Tuicemen on April 20, 2019, 11:42:30 AM
Glad to see you got it figured out now just to get your landscape portrait views figured out & working for you (other thread (http://forums.x10.com/index.php?topic=30971.0))
Title: Re: Getting IP Camera image to Display in HG
Post by: soxfan1966 on April 20, 2019, 11:54:54 AM
Well, may have somewhat spoke too soon - the first time I pull HG up on my desktop via a browser or on my phone via a browser I have to enter in the user and password for the camera(s) and then its OK from there.  The app works with no need to do that (which I use most of the time on my phone anyway, and it will now show them even when I am off my local network - them having been entered in my router now).

I can live with it the way it is now, pending some brainstorm to correct the need to sign in once.