LinuxMCE Forums
General => Developers => Topic started by: hari on February 09, 2009, 01:11:08 am
-
Hi Girls and Guys,
I've written a small DataLogger plugin for the DCERouter. It is way not finished and only stores the value of co2 level change events for now:
mysql> select PK_Datapoints,EK_Device,Description,timestamp,Datapoint,Unit from Datapoints,Unit where FK_Unit=PK_Unit order by timestamp desc limit 5;
+---------------+-----------+-------------+---------------------+-----------+------+
| PK_Datapoints | EK_Device | Description | timestamp | Datapoint | Unit |
+---------------+-----------+-------------+---------------------+-----------+------+
| 106 | 101 | CO2 level | 2009-02-09 01:07:42 | 410 | ppm |
| 105 | 101 | CO2 level | 2009-02-09 01:06:42 | 416 | ppm |
| 104 | 101 | CO2 level | 2009-02-09 01:05:42 | 417 | ppm |
| 103 | 101 | CO2 level | 2009-02-09 01:04:42 | 419 | ppm |
| 102 | 101 | CO2 level | 2009-02-09 01:03:42 | 411 | ppm |
+---------------+-----------+-------------+---------------------+-----------+------+
5 rows in set (0.00 sec)
DT is on schema, the code is in the 0810 branch, src/DataLogger_Plugin and src/lmce_datalog.
best regards,
Hari
-
Hari,
nice.....wheres the sensor ?
419 | ppm !!
cut down on the smoking ;D
regards
Ian
-
Hari -
very neat idea for a plugin. I deally you could set it up to log any command or event. I'll have to take a look at the source!
-
Hari -
very neat idea for a plugin. I deally you could set it up to log any command or event. I'll have to take a look at the source!
Indeed! I firealarm perhaps? I wonder if the CO2 concentrations during the early parts of a fire allow for positive discrimination?
-
Fantastic idea Hari,
Couple of questions...
1. Is it possible to register the interceptor method multiple times for each of the specific Event types that you would like to log. I am just trying to work out how that part could be made configurable.
2. Do you think that it would be possible to have the message interceptor callback to not have code specific to each event type?
Well done.
Darren
-
cut down on the smoking ;D
lol.. wait, DIN allows for 1000ppm :-)
br
-
I'll have to take a look at the source!
at your own risk! Beware the dragon. It is in there..
-
Fantastic idea Hari,
Couple of questions...
1. Is it possible to register the interceptor method multiple times for each of the specific Event types that you would like to log. I am just trying to work out how that part could be made configurable.
I just register an interceptor for all events:
RegisterMsgInterceptor((MessageInterceptorFn)(&DataLogger_Plugin::ProcessEvent) ,0,0,0,0,MESSAGETYPE_EVENT,0);
ProcessEvent() then looks at pMessage->m_dwID to switch() event types.
2. Do you think that it would be possible to have the message interceptor callback to not have code specific to each event type?
as each event has different event parameters I have no idea how to do some "generic" translation...
br, Hari
-
Hari
"lol.. wait, DIN allows for 1000ppm :-)"
........does that allow for the popcorn to burn ocaisionally ? ;D
Ian
-
Fantastic idea Hari,
Couple of questions...
1. Is it possible to register the interceptor method multiple times for each of the specific Event types that you would like to log. I am just trying to work out how that part could be made configurable.
...
Darren
I think it can be done by just sequence of register commands.
HTH,
regards,
Bulek.
-
That is what I thought... so in theory it could read events from the device data and register interceptor for each one.
-
That is what I thought... so in theory it could read events from the device data and register interceptor for each one.
? I mean you still have to interpret the device data in code.. or do I miss something here?
-
now work on one that can log data from a ph meter and a water temp sensor and I can hook LMCE up to my saltwater aquarium
;D
-Krys
-
a few lines of php later..
-
a few lines of php later..
Love it :-)
Andrew