Page 1 of 1
USB connection dropped
Posted: Wed 22 Jun 2011 9:22 am
by Ned
Today I plugged in a new device to the USB hub which also connects to my console. Seems the PC or hub had a tiz and dropped the console connection. I discovered that 3½ hours later, on observing a series of flat line graphs.
I was able to restore the missing data from the logger easily by editing the today.ini timestamp and deleting all the bad data from Jun11log.txt, then restarting Cumulus to download a fresh data set. All became well, although Wunderground is now showing both sets of data and weird graphs - no biggie
Would it be feasible to enable Cumulus to detect this condition and activate an error light or alarm before too much time has passed?
Cheers
Re: USB connection dropped
Posted: Wed 22 Jun 2011 9:37 am
by steve
Ned wrote:Would it be feasible to enable Cumulus to detect this condition and activate an error light or alarm before too much time has passed?
I thought it did already, to be honest. I'll have a look at the code. If you upload the relevant diags file, I can see if it knew about the USB problem.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 10:46 am
by Ned
Thanks. It failed at 12:52 and the USB failure was reported. I don't recall an error light just before 16:09 when I pulled and inserted the USB plug to re-establish connection and restarted cumulus, but then I may have missed it?
Re: USB connection dropped
Posted: Wed 22 Jun 2011 11:00 am
by steve
I was going to suggest that you could use the 'restart if unplugged' setting, which at least stops it logging lots of identical data and makes it easier to get going again once you've fixed the problem. But it doesn't actually get an 'unplugged' indication here, it just can't write to the USB device.
I see in the code that I did at one time log the 'failed to write to USB' message to the error window, and flash the error light, but I've 'commented out' the code. I can only assume that a number of people were getting the error as a temporary issue, and I had lots of queries about the error light flashing, so i took the code out. So I'm not really sure what to do about it.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 11:12 am
by Ned
Cheers. I have the 'restart if unplugged' option active, but not a help as you say.
Would if be possible to check the USB writing status every time data is saved to disc and sound an alarm if it failed on two successive occasions?
Re: USB connection dropped
Posted: Wed 22 Jun 2011 11:18 am
by steve
Ned wrote:Would if be possible to check the USB writing status every time data is saved to disc and sound an alarm if it failed on two successive occasions?
Yes, but it appears that wouldn't have helped in your case. It
appears that it only got the one error, and that somehow after that it didn't get an error, but didn't get any new data either. I could perhaps look at some sort of mechanism for detecting this kind of situation. Simply detecting that the data hasn't changed is quite tricky, particularly if there's no wind, so it would have to be rather more sophisticated than that.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 11:26 am
by Ned
OK thanks, hope you can think of something. I imagine checking for flatlining on multiple sensors would be resource hungry as well as a pain to implement.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 12:03 pm
by steve
Did you happen to notice whether the "last data read" time in the bottom right hand corner was being updated. In theory, that should only be updated when it's actually managed to get data from the station, so checking on that once a minute should catch a number of 'flat line' problems.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 8:51 pm
by Ned
Sorry, I didn't notice that, in the panic to get operational once more

If you like, I could pull the plug for a few minutes and watch it....
Re: USB connection dropped
Posted: Wed 22 Jun 2011 9:15 pm
by steve
Ned wrote:If you like, I could pull the plug for a few minutes and watch it....
No need, I tried that myself and it did stop updating. I just wondered if it had done in your case. But it does seem like a worthwhile addition.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 9:47 pm
by Ned
Sounds promising. Is an audible alarm possible, recurring regularly until the problem is fixed? A red light can avoid detection when Cumulus is buried under other programmes.
Cheers!
Re: USB connection dropped
Posted: Wed 22 Jun 2011 9:52 pm
by steve
I was thinking it would just restart, as that might actually fix the problem depending on what it was.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 11:09 pm
by GraemeT
Ned, I'm just wondering whether your problem was due to USB power. Is your hub powered or does it get it's power from the PC's USB port?
USB 2.0 ports can supply 500ma, but if the hub isn't externally powered then the available current is reduced with each additional connected device.
It's likely that your weather station port suffered a reduced current level when you plugged in the additional device. As an example, a Logitech webcam 600 requires the full 500ma, which will significantly reduce the power available to other ports on an unpowered hub, and even some of the lower-quality powered ones.
For added reliability I'd suggest not using a hub for the weather station, but connect directly to a port on the PC.
Re: USB connection dropped
Posted: Wed 22 Jun 2011 11:36 pm
by Ned
Thanks Graeme, good idea. I've had a look and can rearrange the cables to avoid the non-powered hub, although the external drive I connected to it had its own power supply.