Install 1wire on meteohub
Moderator: Mattk
Install 1wire on meteohub
I know some people have running a 1wire system on meteohub.
Can you say what i have to do to read the sensors?
I've installed owfs by
* Downloading
* Extracting
* ./configure
* ./make
* ./make install
but now I'm stuck.
I want to read the sensors with perl.
edit: i'm using the usb-adaptor
Can you say what i have to do to read the sensors?
I've installed owfs by
* Downloading
* Extracting
* ./configure
* ./make
* ./make install
but now I'm stuck.
I want to read the sensors with perl.
edit: i'm using the usb-adaptor
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
If I've understood correctly, then at this stagePeriklast wrote: but now I'm stuck.
For a DS9490 USB adaptor:
Code: Select all
perl -MOW -e "OW::init('u'); printf OW::get('');"
Code: Select all
DEFAULT: Opened USB DS9490 adapter at 002/002.
You'll also need to mount the 1-wire system for which you need fuse. e.g.I want to read the sensors with perl.
Code: Select all
mkdir /home/1wire
mkdir /home/1wire/mnt
modprobe fuse
/opt/owfs/bin/owfs u /home/1wire/mnt
ls /home/1wire/mnt
e.g.
Code: Select all
10.A78B94010800 1F.72D303000000 26.D55BB6000000 settings system
1D.04010E000000 1F.F5D303000000 81.FD4927000000 simultaneous uncached
1D.5CEB09000000 26.3F59B6000000 alarm statistics
1F.63D603000000 26.C3A5BC000000 bus.0 structure
fuse
line to /etc/modules
Then you get your perl to read from the relevant pseudo-files on /home/1wire/mnt.
Does that make sense?
Re:Install 1wire on meteohub
It seems you have to install fuse.
I installed fuse and after that, I tried to re-install owfs (because /opt/owfs/bin/owfs doesn't excist) (it was disabled by configure.
So I run follow command:
but at the end, it gives me an error:
I editted the /etc/ld.so.conf to
followed by ldconfig but the error remains.
edit: libfuse.a exist in /usr/local/lib
I installed fuse and after that, I tried to re-install owfs (because /opt/owfs/bin/owfs doesn't excist) (it was disabled by configure.
So I run follow command:
Code: Select all
./configure --enable-owfs --enable-owperl
Code: Select all
checking for fuse_main in -lfuse... no
configure: WARNING:
Can't find libfuse.a - add the search path with --with-fuselib
configure: WARNING: Running ldconfig or adding "/usr/local/lib" to /etc/ld.so.conf might also solve the problem, otherwise re-install fuse.
configure: error: Can't enable OWFS
Code: Select all
include /etc/ld.so.conf.d/*.conf
/usr/local/lib
edit: libfuse.a exist in /usr/local/lib
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
Checking my notes I didPeriklast wrote:It seems you have to install fuse.
Code: Select all
apt-get install fuse-utils libfuse-dev
Did you get libfuse aswell as fuse?
Re:Install 1wire on meteohub
Thanks, now it works! Now i'm figuring out how to use the files in /home/1wire/mnt
Re:Install 1wire on meteohub
I managed to read the solar and uv sensor and add it to meteohub.
BUT, everything works ok if I don't give the sensors any ID and name. From the moment I give the sensors an ID, the plugin don't work anymore.
And I gave sol0 id sol0 and uv0 id uv0
Next, I'm gonna connect my lightning detector (counter) to 1wire and meteohub. What will be the sensortype? Rain/Data/...?
BUT, everything works ok if I don't give the sensors any ID and name. From the moment I give the sensors an ID, the plugin don't work anymore.
Code: Select all
#!/usr/bin/perl -w
use strict;
use IO::Handle;
my $solarid = "26.7DD1F1000000";
my $uvid= "EE.CB34CB010800";
my $oldsolarvalue = 0;
my $olduvvalue = 0;
sub trim($)
{
my $string = shift;
$string =~ s/^\\s+//;
$string =~ s/\\s+$//;
return $string;
}
sub GetSolar(){
my $cursol = $oldsolarvalue;
eval{
my $file = "/home/1wire/mnt/$solarid/vis";
open (SOL,$file) || die();
my $read=<SOL>;
close(SOL);
my $solar = trim($read);
$cursol = int($solar*4000);
$oldsolarvalue = $cursol;
};
if ($@){
};
print "sol0 $cursol\\n";
}
sub GetUV(){
my $curuv = $olduvvalue;
eval{
my $file = "/home/1wire/mnt/$uvid/UVI/UVI";
open (UVI,$file) || die();
my $read=<UVI>;
close(UVI);
my $uvi = trim($read);
$uvi = $uvi*10;
$curuv = $uvi;
$olduvvalue = $uvi;
};
if ($@){
};
print "uv0 $curuv\\n";
}
STDOUT->autoflush( 1 );
while ( 1 )
{
GetSolar();
GetUV();
sleep( 30 );
}
Next, I'm gonna connect my lightning detector (counter) to 1wire and meteohub. What will be the sensortype? Rain/Data/...?
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
I've no immediate ideas on that. I'm assuming that you have taken a look in the meteohub log to see if anything is being reported there?Periklast wrote:From the moment I give the sensors an ID, the plugin don't work anymore.
I use data.Next, I'm gonna connect my lightning detector (counter) to 1wire and meteohub. What will be the sensortype? Rain/Data/...?
Re:Install 1wire on meteohub
yes, it's strange. I don't see anything in the log.
If I give an id to UV (ex uv0/uv1) it works but add an id to the solar, the plugin stops working.
It stops after reading the first plugin-sensor.
If I first output the uv and then the solar, only uv is seen (sometimes solar) but there is no refresh of both sensors.
If I first output the solar, only the solar is seen (sometimes) and no uv is seen. There is also no refresh.
If I give an id to UV (ex uv0/uv1) it works but add an id to the solar, the plugin stops working.
It stops after reading the first plugin-sensor.
If I first output the uv and then the solar, only uv is seen (sometimes solar) but there is no refresh of both sensors.
If I first output the solar, only the solar is seen (sometimes) and no uv is seen. There is also no refresh.
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
Maybe you could add some temporary debugging aids to your code, e.g. write notes to a file at various points in the code then see if those notes help pin down what's happening?Periklast wrote:yes, it's strange. I don't see anything in the log.
Re:Install 1wire on meteohub
I did some advanced debugging. I don't see any error in the output.
What I see is that the script is running all the time and output everything correctly. Except, meteohub doesn't trace all the output, except the first line.
What I see is that the script is running all the time and output everything correctly. Except, meteohub doesn't trace all the output, except the first line.
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
Does this minimal dummy plug-in work for you? It does on my ALIX-1DPeriklast wrote:What I see is that the script is running all the time and output everything correctly. Except, meteohub doesn't trace all the output, except the first line.
Code: Select all
#!/usr/bin/perl -w
use strict;
use IO::Handle;
my $value = 1;
STDOUT->autoflush( 1 );
while ( 1 )
{
print "sol0 $value\\n";
$value++;
sleep( 5 );
}
Re:Install 1wire on meteohub
I've tried it now and it works only if you not give it an id (ex sol0-sol1). Seems only to happen sol.
edit: how to implement the lightning counter? I see counters.A / counter.B and counters.ALL
edit: how to implement the lightning counter? I see counters.A / counter.B and counters.ALL
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
Haven't we been here before?Periklast wrote:I've tried it now and it works only if you not give it an id (ex sol0-sol1). Seems only to happen sol.
i.e. http://www.meteohub.de/joomla/index.php ... rt=12#7327
Are you using vmware or your ALIX?
Re:Install 1wire on meteohub
I'm using Alix now and I have the same problem as vmware.
Don't know why, maybe advanced logging by meteohub itself?
Don't know why, maybe advanced logging by meteohub itself?
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Install 1wire on meteohub
Perhaps.Periklast wrote:Don't know why, maybe advanced logging by meteohub itself?
What happens if you modify your perl to report the solar values as a "data" sensor instead of a "sol" one?
If itworks as data then you are at least recording something and the problem is further isolated.