Closed GoogleCodeExporter closed 9 years ago
I think is better for checking at least two sync bytes 0xFF
this works also fine:
for i in range(len(input_buffer) - 2):
if input_buffer[i] == 0xff and input_buffer[i + 1] == 0xff and input_buffer[i +
2] != 0xff:
startSep = i
break
Original comment by f.friedr...@googlemail.com
on 1 Apr 2012 at 1:13
This modification makes sense, however I think you should also change the for
scope. I.e:
for i in range(len(input_buffer) - 3):
if input_buffer[i] == 0xff and input_buffer[i + 1] == 0xff and input_buffer[i +
2] != 0xff:
startSep = i
break
Original comment by jordi.pu...@gmail.com
on 3 Apr 2012 at 7:17
You are right. This prevents a buffer overflow.
I have not noticed it, because the 2 or 3 sync bytes 0xFF are always at the
first position of input buffer.
-------------
another questions to wmrs200.py:
The wmr88 generates every minute a USB timeout (line 168)
This is not a problem, but is this by design (like the wmr200)?
012-04-04 00:32:53,461 ERROR [station.wmrs200] Exception reading interrupt:
[Errno 110] Operation timed out
Traceback (most recent call last):
File "/volumeUSB1/usbshare/wfrog/wfdriver/station/wmrs200.py", line 168, in _run
raise e
USBError: [Errno 110] Operation timed out
2012-04-04 00:32:56,487 INFO [station.wmrs200] Wind Battery Ok: True direction:
14 (315/NW), gust: 0 m/s, avg. speed: 0 m/s
2012-04-04 00:32:57,430 INFO [station.wmrs200] Wind Battery Ok: True direction:
14 (315/NW), gust: 0 m/s, avg. speed: 0 m/s
2012-04-04 00:33:05,320 INFO [station.wmrs200] Temp Battery Ok: True Sensor th1
Temperature: 5.8 C (Steady), Humidity: 87 % (Fair, Steady), Dew Point: 4 C
2012-04-04 00:33:20,371 ERROR [station.wmrs200] Exception reading interrupt:
[Errno 110] Operation timed out
Traceback (most recent call last):
File "/volumeUSB1/usbshare/wfrog/wfdriver/station/wmrs200.py", line 168, in _run
raise e
Original comment by f.friedr...@googlemail.com
on 3 Apr 2012 at 10:42
I'd say my WMRS200 station doesn't produce this timeouts. I don't have access
to the logs right now, so I can't check that. There's a 15 seconds hardcoded
timeout. I believe this value was found experimentally, so could it be that
WMR88 needs a higher timeout. Maybe you could try with a higher timeout.
Original comment by jordi.pu...@gmail.com
on 4 Apr 2012 at 7:37
I checked the log file from the WMR88A.
There is a max interval of 44-58 seconds between two USB Messages.
I increased the timeout in wfrog/wfdriver/station/wmrs200.py to 59000
milliseconds and now all works fine.
Original comment by f.friedr...@googlemail.com
on 15 Apr 2012 at 1:11
issue solved. closing.
Original comment by jordi.pu...@gmail.com
on 18 Jul 2012 at 7:41
Original issue reported on code.google.com by
f.friedr...@googlemail.com
on 1 Apr 2012 at 12:54