Python Forum
waiting to save on network - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: waiting to save on network (/thread-25617.html)



waiting to save on network - SusKahl - Apr-05-2020

Hi all

Im trying to make a code that takes a picture every morning 1 hour before sunset and save the picture on my NAS. the code works fine as long as the picture is saved within the first few minutes after the code has started. But of course the sun dont get up at the same time everyday so there is a long waiting time and the connection to the server closes.

How do I make the code not open the connection to early?
the current save code for the NAS is

        with open(filePath, 'rb') as file:
            conn.storeFile(DestinationPath, Filename, file)
It works as a charm if I need it to save a once. but I don't Confused

Thanks in advance


RE: waiting to save on network - keuninkske - Apr-05-2020

does python controls your camera also?

if so, run the NAS connection script just before the making of the picture


for further questions, please provide us more detail, how do you control your camera, how do you control the time your camera has to go,....


RE: waiting to save on network - SusKahl - Apr-05-2020

Of course the solution is that simple, thanks @keuninkske Thumbs Up Thumbs Up
I made the connection as a global variable so the method was more simple to look at. Doh Wall


RE: waiting to save on network - keuninkske - Apr-05-2020

keep on running, hope you can make some nice pictures with the script!!