Current Cost Support Forum
http://currentcost.com/support/

Envi stops sending after about a month
http://currentcost.com/support/viewtopic.php?f=19&t=96776
Page 1 of 1

Author:  seanyoung [ Mon May 13, 2013 4:04 pm ]
Post subject:  Envi stops sending after about a month

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;
}

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/