wget problem?
Rick Murray (539) 13405 posts |
I am using the latest version of wget to retrieve a file from my (don’t-ever-connect-it-to-the-web-it’s-that-bad1) IP camera. I am using this command: wget -q -T 3 -P [path to dir] --restrict-file-names=windows http://[user]:[password]@192.168.1.20:81/snapshot.cgi When the camera is running, everything is fine. But when the camera is switched off, wget just hangs up the system. It’s easy enough to escape or taskkill, but this is hardly useful for an unattended server machine. I have specified a timeout of three seconds (and that’s plenty generous for the LAN), but it seems as if wget doesn’t obey the timeout. Does this not work in the RISC OS version? Or am I doing something wrong? I’ve tried the longhand of --timeout=3 --connect-timeout=3 and running with -d for debug shows the values being read, it tries to connect… and just sits there. Perhaps forever…? |
Rick Murray (539) 13405 posts |
Removing the port, login creds, and using the local DNS (ipcamera.home) – behaviour is the same. It just hangs up the machine awaiting a reply it isn’t going to get… |
Ronald May (387) 407 posts |
Not knowledgeable on wget, perhaps try https//man.cx |
John Sandgrounder (1650) 574 posts |
My solution to this was to run Wget in a Task Window. The main program starts the Task Window with the line OSCLI (“*wimptask taskwindow -quit -wimpslot 256K -name DataReady !DataReady”) The TaskWindow code in Basic file !DataReady is
Edit the space in the HT TP is to stop the forum turing it into an active link! I only send ‘messages’ (like DataReady) from the Pi and the Raspbian system then fetches the data using Wget on Raspbian and WebJames on the Pi. I set this up donkey’s years ago on a RiscPC. It is now so long ago, all I can remember is that things hung if I tried to do it without the task window. |
Kevin (224) 286 posts |
There is a —timeout= option, according to the wget help |
John Sandgrounder (1650) 574 posts |
One problem with the help is that it is ‘generic’ for lots of platforms, but some of it does not apply to RISCOS. The help file say that you can run Wget as a background task, but that does alwaays not work and from a BASIC program it may well crash the BASIC – hence my long-winded solution above. Having said that Wget is still a very useful utility and works consistently as above. |
RonM (387) 60 posts |
wget doesn’t obey the timeout I have been compiling wget 1.19 lately and still was puzzled that the timeout wasn’t working. But it /is/ working, just not when run directly in a Taskwindow. |
Raik (463) 2026 posts |
Have made a small wget-frontend (any years before) via the frontend module. Works for me, most. If not I use wget with a TaskObey. |
RonM (387) 60 posts |
Have made a small wget-frontend (many years ago) I’ll look at it later. The newer versions of wget can do ftps too. |
Raik (463) 2026 posts |
Delete by myself. |