My present application (a clock which displays astronomical data) uses an autonomous C program on the SBC. It only uses the wifi inasmuch as the time automatically corrects itself, and so it's entirely unaffected by wifi outages. It has been running faultlessly (through various updates) for two or three weeks. So the following comments are really for your information of the outcome of this rather protracted investigation rather than a request for help.
The webservice seems to have become more reliable since I updated to the latest firmware. I have been able to access the SBC daily from the Phidget Control Panel. This definitely wasn't the case in December/early January when I was experiencing times when I couldn't communicate with the SBC by any means. This hasn't occurred once since the last firmware update.
There is indeed (as you suggested) something not 100% right about my wifi network, although it's been in regular use for four years and nobody has noticed. I have fitted the clock with an LED indicating web connectivity using the method you suggested - it goes out occasionally for 10-50 seconds despite the fact that the clock is in the same room as the access point.
I wrote a similar routine in Python which I've run for some hours on my netbook and that confirms that there are brief outages.
Evidently applications using the Phidget Webservice to control the SBC (as I was until recently) need to be resilient in the face of wifi outages. At least in my house.
I have posted the code in case you or anyone else is interested. Note that the Busybox implementation of ping doesn't support the w 1 parameter so the call to ping can occasionally take ten seconds to return, if the network goes down at the wrong time in the cycle. The only other things of note are the redirection of stderr to /dev/null which avoids endless "network unreachable" messages on the console and the location of temporary files on the ramdisk to avoid SSD wear.
Code: Select all
// Return value 0 = OK, 1 = File open failure, 2 = resource not present
// Resource can be an IP address or a network device name
int net_test(char *cResource)
FILE *infile ;
char cBuf ; // Output of ping is 57 chars
char cCmd ;
char *cFile = "/tmp/ping.txt" ; // Temporary file (located in ramdisk on SBC)
int nResult = 2 ; // Assume network failure
int nTx, nRx ;
sprintf(cCmd, "ping -c1 %s > %s 2> /dev/null", cResource, cFile) ; // busybox doesn't support -w1
// sprintf(cCmd, "ping -c1 -w1 %s > %s 2> /dev/null", cResource, cFile) ;
system(cCmd) ; // messages on stdout
infile = fopen(cFile, "r") ;
if (infile == 0)
nResult = 1 ; // Failed to open the file
while(fgets(cBuf, 99, infile) != NULL) // Read a line at a time
if (sscanf(cBuf, "%d packets transmitted, %d", &nTx, &nRx) == 2)
if (nRx == 1) // Received one packet
nResult = 0 ;
return nResult ;
Thanks for all your help.