Tried with the old Raspberry Pi 2 and it works fine. The only issue was when the htmls (and graphics) were updated (after REC), I got "Operation time out" sending/reading USB. After the timeout, the weewx crashed.
I did extend the timeout period to 2000 in all three:
def write(self, buf): def read(self, timeout=2000): def recv(self):
and it is now running rock solid.
When the timeout happened, the USB was unusable until reset.
Tried with the old Raspberry Pi 2 and it works fine. The only issue was when the htmls (and graphics) were updated (after REC), I got "Operation time out" sending/reading USB. After the timeout, the weewx crashed.
I did extend the timeout period to 2000 in all three:
def write(self, buf): def read(self, timeout=2000): def recv(self):
and it is now running rock solid.
When the timeout happened, the USB was unusable until reset.
Small C code to reset USB: `
include
include
include
include <sys/ioctl.h>
include <linux/usbdevice_fs.h>
void main(int argc, char *argv) { const char filename; int fd; filename = argv[1]; fd = open(filename, O_WRONLY); ioctl(fd, USBDEVFS_RESET, 0); close(fd); return; } `
The resetTemp.sh looks like this:
#!/bin/sh /root/resetusb
lsusb -d 0483:5750 | awk ' { print "/dev/bus/usb/" $2 "/" $4 }' | awk -F':' '{ print $1 }'And did a custom weewx start script: `#!/bin/sh
while true do echo "Staring WeeWx" /home/weewx/bin/weewxd /home/weewx/weewx.conf sleep 2 echo "Resetting USB" /root/resetTemp.sh sleep 2 done `
A.