Five second lag from samba to Windows 7
Posted: Mon Oct 10, 2016 8:36 pm
I am testing RPi 3 with camera and I want to distribute jpg images created by Raspistill.
I have a script on Windows 7which does the following:
1) deletes file "mypic.jpg" (if it exists) on the RPi folder "/myfolder/"
2) creates a file "ready.dat" there
3) then goes on a loop with 1 sec intervals checking if a new "mypic.jpg" has materialized in "/myfolder/".
The RPi on the other hand keeps looking at the same folder. If its sees a "ready.dat" it copies "mypic.jpg" from another folder to "/myfolder/mypic.jpg"
All goes well sees the "ready.dat" and immediately RPi creates the jpg. The Windows 7 on the other sees that "mypic.jpg" has become available.
The problem is that there is 5-7 second lag after cp has finished and the Windows program actually sees the file. These are small files, about 75kb. On the windows side I am running a simple C program and use "access()" function to determine if the file exists over at the RPi folder. I am not sure what causes the lag. Both are connected by a router (not WiFI) and I copy stuff all the time with no lag. The lag presents when the "mypic.jpg" has been deleted and then created again. If it is just overwritten by Raspistill there is no lag.
I have a script on Windows 7which does the following:
1) deletes file "mypic.jpg" (if it exists) on the RPi folder "/myfolder/"
2) creates a file "ready.dat" there
3) then goes on a loop with 1 sec intervals checking if a new "mypic.jpg" has materialized in "/myfolder/".
The RPi on the other hand keeps looking at the same folder. If its sees a "ready.dat" it copies "mypic.jpg" from another folder to "/myfolder/mypic.jpg"
All goes well sees the "ready.dat" and immediately RPi creates the jpg. The Windows 7 on the other sees that "mypic.jpg" has become available.
The problem is that there is 5-7 second lag after cp has finished and the Windows program actually sees the file. These are small files, about 75kb. On the windows side I am running a simple C program and use "access()" function to determine if the file exists over at the RPi folder. I am not sure what causes the lag. Both are connected by a router (not WiFI) and I copy stuff all the time with no lag. The lag presents when the "mypic.jpg" has been deleted and then created again. If it is just overwritten by Raspistill there is no lag.