Guys here is my problem,
I have built a temperature and home heating (HVAC) controller from the Arduino, it's working great but..
Problem one*
My existing project can send the sensor readings out on the serial port every few min, which I'd like to log to a database of some sort (my sql, sql lite etc whatever's easiest)
So I'd have the following setup Sensors-----Arduino-----SERIAL/USB-----MacOSX---Database
The data I'll be sending from the Arduino can be in any format, as I can change this on the Arduino it would probably be something like this
room_1,21.3
room_2,22.2
room_3,22.7
What I'd like to do is place the values into a database (with a time stamp) not fussy what sortof DB as long as I can read the values back out later Using a web browser (PHP probably)?.so I end up with something like this
temp_database_room_1_table
Value Date Time
21.3 10-06-08 10:25
21.4 10-06-08 10:30
22.1 10-06-08 10:35
temp_database_room_2_table
Value Date Time
22.2 10-06-08 10:25
22.8 10-06-08 10:30
22.4 10-06-08 10:35
temp_database_room_3_table
Value Date Time
22.7 10-06-08 10:25
22.2 10-06-08 10:30
22.7 10-06-08 10:35
I can generate the timestamp from the project clock (a 1307 RTC) and send it with the sensor reading to my serial port if that's an easier way to do things. eg: I can send
Room_1,89.3, 10-06-08, 10:25 If that's simpler (I have no idea)
Can I use AS Proxy to do this with apple script? If so can anyone point me to some “hello world” example? OR Is there a simpler way I'm missing
Here's some sudo code to show you what I'm thinking.
Applescript sudo code
loop
Tell application AS proxy “Get serial input”
If serial available then
Serial input = temp_value, room_number
Tell application mySQL database “open database_room_number_table”
Tell application mySQL database “Write temp_value to table”
Tell application mySQL database “Write date and time to table”
Tell application mySQL database “Close database room_number_table”
end
Problem two*
I need to be able to send characters back to the serial port from a browser which should be simple enough with a bit of PHP (I guess) my problem is I don't want to stop the logging function while I do that
Eg: Currently if I send a “U”(ascii) it sets the temperature UP by 1deg c
Can I log the serial data to the database (Via AS proxy) while still having the ability to send characters back to the Arduino from the Mac?
rgds
cwhitto