Reading the http://www.nslu2-linux.org/wiki/HowTo/A ... ireAdapter I see Digitemp package can nicely handle on wire sensors connected to the USB port.
It looks like the Digitemp writes to stdout, so it may be not that difficult to integrate it as a plugin to MeteoHub.
Any coments on this idea?
Cheers,
Headworx
Digitemp as a meteohub plugin?
Moderator: Mattk
Re:Digitemp as a meteohub plugin?
Yes, it would be great if the 1-wire sensors (iButtons) could be attached to the NSLU2 through the DS9490R
I'm already using a very small network of iButton thermochrons and thermometers with a DS9490R attached to a computer USB port.
I'm already using a very small network of iButton thermochrons and thermometers with a DS9490R attached to a computer USB port.
Re:Digitemp as a meteohub plugin?
It seems I am close to the solution.
The steps are as follows (I run MH on Sheeva):
1. install digitemp:
2. After plugging in the DS9490 USB to 1-wire converter, I can list (walk) the devices:
3. If the output is correct (it should identify devices on the 1-wire bus), I initialize digitemp and store the current configuration in the .digitemprc file:
4. Now I edit the output format template to make it compatible with MeteoHub:
and changing the LOG_FORMAT line to:
5. Now I run the digitemp:
It gives me output like below:
Looks almost perfect, with two potential issues:
- there is the not supressed header line "Found DS2490 device #1 at 001/005" - I am not sure if MH will complain about it or not...
- there is a decimal dot in reported values (I don't know how to get rid of it and whether or not this will upset the MeteoHub)
I cannot check if this works as a MH plugin right now, because my MH system is in a distant location and I have just been experimenting with the above on my test Sheeva system (without Meteohub Installed).
May be Boris would be kind to look at it... Seems 1-wire is just around the corner...
Cheers,
Headworx
The steps are as follows (I run MH on Sheeva):
1. install digitemp:
Code: Select all
# apt-get install digitemp
Code: Select all
# digitemp_DS2490 -w
Code: Select all
# digitemp_DS2490 -a -i
Code: Select all
# nano .digitemprc
Code: Select all
LOG_FORMAT "%Y%m%d%H%M%S Temp1 %.2C"
Code: Select all
digitemp_DS2490 -q -a -d 5 -n 0
Code: Select all
Found DS2490 device #1 at 001/005
20091128140027 Temp1 22.94
20091128140033 Temp1 22.94
20091128140037 Temp1 23.00
20091128140042 Temp1 23.00
20091128140047 Temp1 23.00
20091128140052 Temp1 23.06
- there is the not supressed header line "Found DS2490 device #1 at 001/005" - I am not sure if MH will complain about it or not...
- there is a decimal dot in reported values (I don't know how to get rid of it and whether or not this will upset the MeteoHub)
I cannot check if this works as a MH plugin right now, because my MH system is in a distant location and I have just been experimenting with the above on my test Sheeva system (without Meteohub Installed).
May be Boris would be kind to look at it... Seems 1-wire is just around the corner...
Cheers,
Headworx
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Digitemp as a meteohub plugin?
Excellent idea. :cheer:Headworx wrote:It seems I am close to the solution.
Yes that is like the Meteohub's raw log format, but it isn't what the plug-in interface expects.LOG_FORMAT "%Y%m%d%H%M%S Temp1 %.2C"
The plug-in interface expects:
a) No date & time. MH provides that itself.
b) Sensor IDs should be like t1 rather than Temp1.
c) Temp values are expected to be (actual temp)x10.
e.g.
t1 100
represents a temp sensor reporting 10.0 C.
I believe that at worst the header would result in an error message line in meteohub log, i.e. not a significant problem.Looks almost perfect, with two potential issues:
- there is the not supressed header line "Found DS2490 device #1 at 001/005" - I am not sure if MH will complain about it or not...
Not a problem, provide the decimal is in the right place. My plug-in that feeds data from html template file includes a decimal. MH is quite happy to read the number as far as the decimal point and ignore the bit after that.there is a decimal dot in reported values (I don't know how to get rid of it and whether or not this will upset the MeteoHub)
I think you are very close. A revised LOG_FORMAT should be easy. I'm not familiar with digitemp so I'm not sure how the x10 could be handled? At worst maybe a x10 pseudo calibration factor?
Then there is just the matter of starting digitemp as a plug-in. So far as I'm aware the plug-in station set up doesn't at present allow for command line parameters.
Re:Digitemp as a meteohub plugin?
Yes... the revised LOG_FORMAT... considering what you said, it should be just like:
then the output is like:
BUT... the "24" part is rounded to zero decimal places (%.0C in the LOG_FORMAT) and then there is an arbitrary "0" added, which should work, but the accuracy is just 1 centigrade... I've looked here and there and cannot find any way to get rid of the decimal point, other than getting rid of the entire decimal part, which is good as a proof of concept, but would be a waste in a production system...
Code: Select all
LOG_FORMAT "T1 %.0C0"
Code: Select all
Found DS2490 device #1 at 001/005
T1 240
T1 240
T1 240