Weird problem with wview, but I fixed it

Running wview on my RasPi connected to Oregon Scientific WMR200A weather station.

In case anybody else comes across this problem ...

Last night, I upgraded my RasPi to pick up the new bash against the Shellshock exploit. I rebooted after to make sure everything was clean. I run the RasPi as a headless server, so I never was close to the physical RasPi, OreSci, cables or anything. As always, I ssh'ed in from my laptop in my easy chair.

After I rebooted, wview stopped working. I rebooted again. Still nothing. I reset the WMR200 console. Nothing. I power-cycled the RasPi. Nothing. Checking the logs, I saw this repeating:

Sep 27 00:30:15 raspberrypi wviewd[2881]: : wmrInit: found D0-D9 framed protocol Sep 27 00:30:15 raspberrypi wviewd[2881]: : wmrInit: waiting for first sensor packets (this may take some time): Sep 27 00:30:15 raspberrypi wviewd[2881]: : wview requires one packet from each sensor suite (except rain) before it can complete initialization. Sep 27 00:30:15 raspberrypi wviewd[2881]: : If one of your sensors is out of range or malfunctioning, wview will not complete initialization. Sep 27 00:30:15 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Rain Temp Pressure Sep 27 00:30:16 raspberrypi wviewd[2881]: : received RAIN packet... Sep 27 00:30:36 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Temp Pressure Sep 27 00:30:38 raspberrypi wviewd[2881]: : received PRESSURE packet... Sep 27 00:30:57 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Temp Sep 27 00:31:17 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Temp Sep 27 00:31:37 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Temp Sep 27 00:31:41 raspberrypi wviewd[2881]: : wmr: Sending reset to console... Sep 27 00:31:49 raspberrypi wviewd[2881]: : received RAIN packet... Sep 27 00:31:58 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Temp Sep 27 00:32:18 raspberrypi wviewd[2881]: : wmrInit: waiting for sensors: Wind Temp Sep 27 00:32:35 raspberrypi wviewd[2881]: : received RAIN packet...

I could see on the WMR200 console that the Wind and Temp displays were blank.

Even after waiting several minutes, nothing. I reset the Wind sensor. Nothing. I changed the Wind sensor batteries, reset it and reset the WMR200 console. Still nothing.

Finally, I pulled the USB cable from the WMR200 console, and the Wind and Temp displays suddenly filled in with correct values , without me having to reset the console. I immediately plugged the USB cable back in, and everything magically started working again. vwview was pulling the data and populating its web pages, doing the SSH to my web server, and all was right again with the world.

Lesson learned: if something like this happens again, start with the USB cable on the WMR200 console, even though it makes absolutely no sense from doing a software upgrade on the RasPi.

JimR

Reply to
JimR
Loading thread data ...

Makes absolute sense as you only rebooted, ie a warm restart. If something screws up say handshaking or expects a certain state for the hardware without explicitly resetting/setting the hardware then things can just sit waiting for the other to do something.

Pulling the USB would cause a hardware reset from the low level driver.

If something isn't playing properly the Big Red Switch(*) or a physical switch attached to the hardware reset line is your friend.

(*) Derived from the early IBM PC's that had a large red handled mains switch built into the PSU.

formatting link
witch.jpg

--
Cheers 
Dave.
Reply to
Dave Liquorice

Now, if an ATX PSU is blessed with such a mains isolator switch, it's usually an unassuming rocker switch. On major OEM branded kit, such a luxury is simply omitted entirely on cost grounds (after all, there's always the IEC 10A mains lead connector available for the user to literally "Pull The Plug" if a sudden need to completely power the PC down were to arise).

--
J B Good
Reply to
Johny B Good

I am glad to read this. I thought I must have slipped into some alternative reality when wview and a FineOffset WH3080[1] stopped talking.

Even a complete shut down of both Pi and weather station would not get them talking when powered back up.

Removal and insertion of the USB cable at either end produced the expected entries in syslog but did not cure the problem.

Then, grabbing at straws, I turned the USB cable round and it all sprung into life !!!!

I could not explain it[2] but it's been working ever since.

[1] not mine but that of a friend. [2] best guess was worn contacts on the USB plugs or sockets.
--
nev 
getting the wrong stick end since 1953
Reply to
nev young

-r (?)? Is there no way to (really) shut down and reboot a machine via CLI?

B. Alabay

--
http://www.thetrial.de/ 
???????????????
Reply to
Ba?ar Alabay

sudo reboot

I have read that you can do a shutdown like this: sudo shutdown now -h 0

but I have never attempted it. I have never had a problem with sudo reboot.

JimR

Reply to
JimR

It's the same thing, except "sudo shutdown -h now" halts instead of reboots the machine (-h means halt, now is the same as 0 or +0 actually). When running normally, reboot/halt/poweroff actually invoke shutdown with the approriate options. See "man shutdown":

sudo reboot = sudo shutdown -r now sudo halt = sudo poweroff = sudo shutdown -h now

The man page doesn't say if the default action of -h is just to halt (-hH) or also to poweroff (-hP), but for a RPi it is the same anyway.

Reply to
A. Dumas

While this is true in Wheezy, it is no longer true in Jessie.

sudo halt = sudo shutdown -h now sudo poweroff = sudo shutdown -P now

The fact that halt has always done a poweroff as well, rather than just halting the machine but leaving it powered up, is a historic bug in Debian that has now been "fixed". It will take many users (like me) some time to get used to the new way of doing it.

Even though technically the Pi can never be completely powered off by software alone, it does enter a different power state when told to power off than it does when told to just halt.

Reply to
Dom

I had to laugh when IBM released one line of PCs (I think it was the PS2s), on the front panel, the switch had changed to white. But if you opened th e case, the white switch had a mechanical linkage to a BRS on the side of t he power supply. They really could not let it go!

JimR

Reply to
flaflashr

Ah! I had no idea, thanks.

... And again. So I'll try and get used to typing poweroff instead of halt, or maybe make an alias 'off'.

Reply to
A. Dumas

They wanted to avoid using a mains flylead (it was pre-ATX) between the PSU and a front panel mains voltage switch. The mechanism made perfect sense (at least it _was_ engineered :-)

--
J B Good
Reply to
Johny B Good

Hopefully, the standby mode includes sending each ATA SSD / HDD the ATA command, "STANDBY_IMMEDIATE" to guarantee that the SSDs (in particular) and HDDs are safe to power off without interrupting critical caching and garbage collection processes. The kernel will wait for the drives in question to aknowledge the _completion_ of the "STANDBY_IMMEDIATE" command before signifying that the _whole_ system is halted and safe to switch off.

--
J B Good
Reply to
Johny B Good

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.