I would definitely think about serial support. I would probably right off the bat use this for integration with my Pentair Intellitouch pool automation system to read the pool temp and store in a user value or flag and control hottub etc from Haiku. They have a serial adapter with simple ASCII commands but doing thing like reading temp is a real pain in Omni programming because you need to make a message for each response (no variables), so a message needs to be made for every possible temperature response from the pool system.
Another use would be integrating with the Brultech power monitor again displaying current power consumption through a setting or flag or message perhaps.
Something like:
serialPort = helper.serialOpen("portname",9600,8,1);
serialPort.Write("test");
byteResponse = serialPort.Read(10,1000); // blocks until number of bytes are read or timeout occurs
stringResponse = serialPort.ReadLine(1000); // blocks until number of Lf is read or timeout occurs
serialPort.Close(); //probably not necessary, closed at end of script automatically
//also maybe received event, although blocking methods are more straight forward for typical request/response integration
function onSerialRecieve(recievedBytes)
{
}
Didn't realize Lion Server added a time machine server, I will have to evaluate if this will be the way to go. My WHS is currently running Web-Link and I need it's email abilities so this could work. Haiku has mostly taken over from it's web interface, but I will miss pure web base access to my Omni once in a while from my PC's.
I also run a logger on my WHS to record Omni events and temperatures in a sql database for long term storage and analysis, is there any way to write to a log or file from scripting? If not think about it, maybe even just have event/temp logging built in. SQLlite would be a good solution, but even just writing to text file would be useful. I have a web page currently on my WHS that shows temp trends over time in a graph.
I'll be PMing you .
Another use would be integrating with the Brultech power monitor again displaying current power consumption through a setting or flag or message perhaps.
Something like:
serialPort = helper.serialOpen("portname",9600,8,1);
serialPort.Write("test");
byteResponse = serialPort.Read(10,1000); // blocks until number of bytes are read or timeout occurs
stringResponse = serialPort.ReadLine(1000); // blocks until number of Lf is read or timeout occurs
serialPort.Close(); //probably not necessary, closed at end of script automatically
//also maybe received event, although blocking methods are more straight forward for typical request/response integration
function onSerialRecieve(recievedBytes)
{
}
Didn't realize Lion Server added a time machine server, I will have to evaluate if this will be the way to go. My WHS is currently running Web-Link and I need it's email abilities so this could work. Haiku has mostly taken over from it's web interface, but I will miss pure web base access to my Omni once in a while from my PC's.
I also run a logger on my WHS to record Omni events and temperatures in a sql database for long term storage and analysis, is there any way to write to a log or file from scripting? If not think about it, maybe even just have event/temp logging built in. SQLlite would be a good solution, but even just writing to text file would be useful. I have a web page currently on my WHS that shows temp trends over time in a graph.
I'll be PMing you .