You are not logged in.

#1 2017-11-28 20:10:37

rob
Member
Registered: 2017-09-28
Posts: 54

Last image do not show on dashboard while not printing

Hi Shanin,

I tried it under different OS/browser combination (Win10-IE,Win10-Chrome,Ubuntu-Firefox,Ubuntu-Chrome), but I could not have last picture to show up on dashboard while not printing. It works while printing.
Camera command is default.

-w 1296 -h 972 --timeout 700 --awb sun

I actually checked that "~/printer/shot.jpg" is updated every time I press "Take Photo" Button (or a new "printer/shots/.....jpg" is generated if "Storage mode" is set to "All images".
Images are correct as well as resolution. Could you please check it out? I have no idea how to debug it further.
Thanks in advance!

PS: Out of curiosity: when "All images" is selected, what do the pictures name stands for?  For example, in "0_-1_1511899569820418896".jpg: I guess the long "1511899569" is unix epoch time. What about the initial "0_-1_" and the latter "820418896"?

Offline

#2 2017-11-29 05:38:59

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: Last image do not show on dashboard while not printing

Hi,

Fixed in the beta version.
PlateID_LayerID_unixtimestamp

Offline

#3 2017-11-29 12:02:29

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

Thanks a lot! Now works! big_smile

Offline

#4 2017-12-12 07:54:22

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

I just find out it only works if "Save last image only" is selected, not working if saving all image.
Is it possible to check it out?
Thanks in advance. smile

Offline

#5 2017-12-14 04:37:08

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: Last image do not show on dashboard while not printing

You mean it does not display it when the printer is idle?

Offline

#6 2017-12-14 13:55:43

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

When I hit "Take a photo" a shot is taken and saved in /public/shots/<picturename>.jpg.
Nonetheless dashboard will not update, neither hitting F5.
Seems like dashboard shows the content of "/public/shot.jpg", which is not updated when storage mode is set to "All images".
If there is a previously generated "shot.jpg" in /public, dashboard will keep showing it. It is the case when you switch from "Only Last image" to "All images".
If I remove the old shot.jpg, no picture is shown no matter how many new shots I take (all saved in /public/shots/ folder).

Furthermore, I noticed that in any case you need to force a page refresh (F5) in order for the photo to update in the dashboard. I mean, shot is taken but dashboard keeps displaying the old image till you hit F5.
This seems related to a similar bug during printing, where new photo is shown for a fraction of second before switching back to an old one. (This happened when having old photos in /public/shots and "Only last image" setting selected, I will investigate it further with the other setting).

Offline

#7 2017-12-14 14:19:27

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

I just noticed that you also need to force refresh (F5) in order to show correct plate preview during printing if you change something in a plate and repeat a print.
For example I regenerated the calibration plate using less time values (less pillars) and the preview still showed the old ones as being exposed. Checking on the printer revealed that the updated plate was being actually projected.
I was wondering why and try to check /public/plates directory, where layers where actually updated; then I just hit F5 and the correct images started to display in the UI. Seems like a caching  problem.

Offline

#8 2017-12-16 05:41:50

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: Last image do not show on dashboard while not printing

You are right it is caching problem. during printing we force update images but not when printer is idle. Forcing to much update could put pressure on rpi. I have tweaked nanodlp a little bit to see if it helps or not.
When you put printer in mode to keep all photos. It use ln -sf command to create link from newly saved file to shot.jpg. So datestamp on shot.jpg should changes if not run command manually to see what is the issue.

Offline

#9 2017-12-16 10:19:47

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

I will test it again as soon as possible, but seems like ln -sf fails/do not work, at least when taking photos manually. If I delete it before hitting the button, shot.jpg is not generated at all. I guess it should when printing, but I should confirm using it.
Gonna try new beta if available.

About caching problem: yesterday I found that using chrome (at least on Windows, gonna try more combinations next week) makes caching problem worst. Hitting refresh is not enough you will need to hold Shift down while pressing refresh button to force the cache to clean or old photo/plates will keep showing.

Last edited by rob (2017-12-16 10:21:28)

Offline

#10 2017-12-18 01:41:26

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: Last image do not show on dashboard while not printing

Chrome caches much more aggressively. Could you let me know how ln -sf fails on your environment?

Offline

#11 2017-12-18 11:30:18

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

printer .log shows the following when I hit "Take a Photo"

2017/12/18 12:22:54.071195 {"Layer":"1","module":"Camera","level":"Notice","msg":"Taking Photo [] <nil>"}

ln -sf actually works if I issue it from ssh and the image is updated. Looks like the program is not issuing ln -sf, at least when taking photo manually.
I'm on build 1749.

Offline

#12 2017-12-18 14:18:05

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

I have been experimenting a little more.
I added a customized button which does the following:

[[Net http://127.0.0.1:8080/camera/take]]
[[Exec ln -sf "$(find /home/pi/printer/public/shots/ -maxdepth 1 -name '*.jpg' |sort -t_ -nk2,2|tail -n1)" /home/pi/printer/public/shot.jpg]]

It succeed to update the symbolic link, but taking photo using net function do not work. I guess it might be related with password protection. Would it be possible to selectively disable password if requests come from 127.0.0.1?

Thanks in advance for the help! smile

Last edited by rob (2017-12-18 14:19:54)

Offline

#13 2017-12-18 18:02:43

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

I can also confirm that selecting "Save all images" on the current build (1749) is not taking any picture during print (actual selection is one every layer, printing calibration plate). Manual shot generates the picture under /shots" folder but do not generate the symlink.

Offline

#14 2018-01-16 17:17:47

rob
Member
Registered: 2017-09-28
Posts: 54

Re: Last image do not show on dashboard while not printing

Build 1771: same symptoms. Any way may I help sort it out? smile

Offline

Board footer

Powered by FluxBB