ve7mkf
New Member
Posts: 13
Raspberry Pi: Yes
|
Post by ve7mkf on Jan 14, 2014 17:38:49 GMT -8
Good day all, I am new the the RasPiConnect app, and am having fun getting it set up I do have one problem with the Remote Picture Webview. I have set up a button (B-3 in Local.py) to take a photo with the raspberry pi camera using the new python-picamera module. This works great and the picture is stored as RasPiConnectServer/static/picamera.jpg I have modified W-2 in ExecuteRemoteWebView.py to point to the camera image. My problem is that when I refresh the page on the RasPiConnect app on my iPad after taking a picture, the image is not updated. If I restart the server, it will update and sometimes when I restart the app on the iPad, it will update, but mostly it will display the previous image. I know the refresh works, because I also have a Voltmeter set up to read the temperature of a DS18B20 and that will change OK. Any suggestions?
|
|
|
Post by SDL on Jan 14, 2014 18:36:53 GMT -8
Mr. ve7mkf,
We have duplicated the bug! It appears to be related to the web view on the App caching the data. We have logged it as bug 011414-1.
Try this as a workaround. Add this to the HTML being served from the Pi in W-2.
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1">
Let us know if this works for you!
Best regards,
BP
|
|
ve7mkf
New Member
Posts: 13
Raspberry Pi: Yes
|
Post by ve7mkf on Jan 15, 2014 12:10:05 GMT -8
Thanks for the quick response BP. I tried it and it did not work. However, after researching these meta tags, I came across this one:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
After adding this, it works great and refreshes every time!
Thanks,
Mike
|
|
grandad
New Member
No Quite So Confused.
Posts: 30
Raspberry Pi: Yes
Other Device: 2nd Pi, PCs, iPad, Android Tablet and many, many gadgets!
|
Post by grandad on Mar 8, 2014 8:46:19 GMT -8
Hi, I am experiencing the same problem of no refresh. I have attached a screen-shot of the section of my Local.py file which should deal with displaying the latest picture. I have used a screen-shot to ensure that my identations show as they are (I'm slowly learning Python!) The control validates within the app, and I know that the picture is being taken by the button I have set up because the .jpg file within the static directory changes OK; plus my shutter sound plays when the button is activated. As can be seen, I have also included the work-around for the "bug" of no refresh with the META-TAG. In the ExecuteRemoteWebview.py file the ObjectServerID is not the same as my control, so I know that they are not clashing. (Oh! the W-15 commented is an earlier version, just ignore) Can anyone throw any light on why this is not refreshing? TIA Martin
|
|
grandad
New Member
No Quite So Confused.
Posts: 30
Raspberry Pi: Yes
Other Device: 2nd Pi, PCs, iPad, Android Tablet and many, many gadgets!
|
Post by grandad on Mar 8, 2014 9:30:49 GMT -8
Ah! I thought the debug output may be useful. I have formatted it to make it easier to read, and redacted the password / username parts (Yeah, I know they're encrypted!)
XMLCOMMAND: USERNAME: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx PASSWORD: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx OBJECTNAME: RaspiCam Picture OBJECTTYPE: 512 OBJECTSERVERID: W-12 OBJECTID: 25 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx objectType = 512 objectServerID = W-12 VALIDATE=NO objectServerID = W-12 PICTURE_REMOTE_WEBVIEW_UITYPE of W-12 found Local user objects returns: <XMLCOMMAND> <OBJECTID>25</OBJECTID> <OBJECTSERVERID>W-12</OBJECTSERVERID> <OBJECTTYPE>512</OBJECTTYPE> <OBJECTFLAGS>0</OBJECTFLAGS> <RASPICONNECTSERVERVERSIONNUMBER>2.9</RASPICONNECTSERVERVERSIONNUMBER> <RESPONSE><![CDATA[<html> <head><META HTTP-EQUIV='CACHE-CONTROL' CONTENT='NO-CACHE'> <title></title> <style>body,html,iframe{margin:0;padding:0;}</style> </head> <body><img src="http://192.168.2.196:9600/static/picam.jpg" type="jpg" width="320" height="240"></body> </html>]]> </RESPONSE> </XMLCOMMAND> As can be seen, the rendered HTML in CDATA points to my picture, picam.jpg So I am puzzled as to why it does not refresh. Martin
|
|
grandad
New Member
No Quite So Confused.
Posts: 30
Raspberry Pi: Yes
Other Device: 2nd Pi, PCs, iPad, Android Tablet and many, many gadgets!
|
Post by grandad on Mar 10, 2014 8:28:36 GMT -8
OK, So, today I seem to have made the app refresh the PictureRemoteWebview OK. I have tinkered with the Default Refresh Interval and the Default HTTP/HTTPS Timeout values. Mine are currently 10secs and 30secs respectively, and the picture refreshes reliably. YMMV
That is today - tomorrow may be a different story! Martin
|
|
grandad
New Member
No Quite So Confused.
Posts: 30
Raspberry Pi: Yes
Other Device: 2nd Pi, PCs, iPad, Android Tablet and many, many gadgets!
|
Post by grandad on Mar 10, 2014 8:49:24 GMT -8
Now this is what /var/log/RasPiConnectServer.log is looking like when the picture refreshes OK
192.168.x.x:49406 - - [10/Mar/2014 16:34:36] "HTTP/1.1 POST /raspi" - 200 OK #Normal poll 192.168.x.x:49407 - - [10/Mar/2014 16:34:36] "HTTP/1.1 GET /static/picam.jpg" - 304 Not Modified 192.168.x.x:49406 - - [10/Mar/2014 16:34:46] "HTTP/1.1 POST /raspi" - 200 OK 192.168.x.x:49408 - - [10/Mar/2014 16:34:46] "HTTP/1.1 GET /static/picam.jpg" - 304 Not Modified Playing WAVE 'sounds/shutter.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono #Picture taken 192.168.x.x:49406 - - [10/Mar/2014 16:34:58] "HTTP/1.1 POST /raspi" - 200 OK 192.168.x.x:49409 - - [10/Mar/2014 16:34:58] "HTTP/1.1 GET /static/picam.jpg" - 200 #Serve picture 192.168.x.x:49406 - - [10/Mar/2014 16:35:06] "HTTP/1.1 POST /raspi" - 200 OK 192.168.x.x:49409 - - [10/Mar/2014 16:35:06] "HTTP/1.1 GET /static/picam.jpg" - 304 Not Modified #Normal poll
Before, I wasn't seeing any reference to picam.jpg in the server responses, not even the 304.
Martin
|
|