rogro82 / PiPup

Enhanced notifications for Android TV
237 stars 71 forks source link

Can't get Image Pop Up #12

Open naigy81 opened 4 years ago

naigy81 commented 4 years ago

Hi,

Had a great deal of difficulty getting this to work (originally trying to do from ESP8266) but ended up managing in Python 3.8 from my Windows PC so may end up with doing it from my Automation Raspberry Pi once its all functional.

The code I am using is as follows (entered straight into the Python Shell if that's relevant)

`payload = { "duration": 10, "position": 2, "title": "Security - Front Door", "titleColor": "#50BFF2", "titleSize": 10, "message": "Someone is at the door", "messageColor": "#fbf5f5", "messageSize": 14, "backgroundColor": "#0f0e0e", "media": { "image": { "uri": "http://192.168.1.87/webcapture.jpg?command=snap&channel=1&user=admin&password=myownpasswordhere", "width": 580 }} }

request = requests.post('http://192.168.1.224:7979/notify', data=json.dumps(payload), headers={'content-type': 'application/json'})`

I have other Onvif security cameras which have different URL formats for snapshot image (with and without passwords etc. in URL) and can't get any to work. Even if I download one of them and then change the http:// to relevant file:// reference I get the same result.

Text window appears fine but just can't get an image at all.

Any suggestions what I may be doing wrong. Thanks

naigy81 commented 4 years ago

Just to update the following part of the Json Data change then allows an image. (The PipUp Logo from Google Play). So thinking it has something to do with the Security Cameras way of serving the image or something. Any help or advice would be appreciated.

"media": { "image": { "uri": "https://lh3.googleusercontent.com/5y0MHewrRelmtZFN6O8c6SxHCbOADVhy1PAu5u2NPY8pGZNfFKeISjJv4eMvTMqhn2s=s180", "width": 580

hoasis2 commented 4 years ago

"uri": "http://192.168.1.87/webcapture.jpg?command=snap&channel=1&user=admin&password=myownpasswordhere", "width": 580

pipup can't handle http authentication.

hungpr0 commented 4 years ago

So how can we display video of security camera? I have this type of URL: http://username:password@192.168.2.13/ISAPI/Streaming/channels/101/picture but it doesn't work

naigy81 commented 4 years ago

Ok. Is there a plan to incorporate HTTP auth etc. or is the way to get this to work to make my script download the security snapshot locally and then with the payload reference the locally stored file which doesn't require auth. Then 10 seconds later delete the file.

Seems like a long way to do it and hopefully won't make it lag too much but will give it a go if it is the only way to go. Any special format for referencing local files?

Notifications for Android TV from what I can see supports auth but I do like the open source nature of PipUp.