I have purchased a low-cost Digital serial port RS232 thermometer from ebay, and I’m trying to interface it with vera
Although this thermometer uses the serial port, it is based on 1-wire, and not serial protocol.
Can anyone suggest how to make it work with vera?
Here are the instructions from the seller:
You must install digitemp or owfs.
http://www.digitemp.com/
http://owfs.org/
I am using digitemp:
:~# digitemp_DS9097 -i -s /dev/ttyS0
:~# digitemp_DS9097 -q -t 0 -c .digitemprc
IMHO you might be barking up the wrong tree. Vera is a low resource device and can easily be overloaded. This type of communication has to generate all the timing sequences to talk on a one wire network. I think finding a true RS232 device would be a better option. Guessed has an interface for a general purpose A/D multi purpose adapter that could easily pick up an external temperature probe.
Here is typical c code for talking on a one wire network:
// Read and return the page data and SHA-1 message authentication code (MAC)
// from a DS2432.
//
int ReadPageMAC(int page, unsigned char *page_data, unsigned char *mac)
{
int i;
unsigned short data_crc16, mac_crc16;
// set the speed to 'standard'
SetSpeed(1);
// select the device
if (OWTouchReset()) // Reset the 1-Wire bus
return 0; // Return if no devices found
OWWriteByte(0xCC); // Send Skip ROM command to select single device
// read the page
OWWriteByte(0xA5); // Read Authentication command
OWWriteByte((page << 5) & 0xFF); // TA1
OWWriteByte(0); // TA2 (always zero for DS2432)
// read the page data
for (i = 0; i < 32; i++)
page_data[i] = OWReadByte();
OWWriteByte(0xFF);
// read the CRC16 of command, address, and data
data_crc16 = OWReadByte();
data_crc16 |= (OWReadByte() << 8);
// delay 2ms for the device MAC computation
// read the MAC
for (i = 0; i < 20; i++)
mac[i] = OWReadByte();
// read CRC16 of the MAC
mac_crc16 = OWReadByte();
mac_crc16 |= (OWReadByte() << 8);
// check CRC16...
return 1;
It’s not so easy!
Regards
Tim Alls
Best Home Automation shopping experience. Shop at Ezlo!