I have my currentcost envi + data cable plugged into a sheevaplug (linux on arm). After about a month, the envi stops sending data on the usb serial port. Unplugging/replugging the usb connector does not help; I have to unplug the usb connector and power cycle the envi.
Is there newer firmware I can use? It is very annoying.
I've got some C code which polls the device. This is how it is opened:
nt currentcost_open(int *fd_ret, const char *path) { int rc, fd;
fd = TEMP_FAILURE_RETRY(open(path, O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC)); if (fd == -1) return errno;
struct termios termios;
rc = TEMP_FAILURE_RETRY(tcgetattr(fd, &termios)); if (rc == -1) { rc = errno; TEMP_FAILURE_RETRY(close(fd)); return rc; }
// 57600 8N1 no flow control (hardware or software) cfmakeraw(&termios); cfsetspeed(&termios, B57600); termios.c_iflag &= ~(INPCK | IXON | IXOFF); termios.c_cflag &= ~(CSTOPB | CRTSCTS);
rc = TEMP_FAILURE_RETRY(tcsetattr(fd, TCSAFLUSH, &termios)); if (rc == -1) { rc = errno; TEMP_FAILURE_RETRY(close(fd)); return rc; }
*fd_ret = fd;
return 0; }
|