Mwall, Im using tcpdump and a perl script by radar attached below. Could
this be a sensor map issue???
Im using tcpdump:
sudo tcpdump -A -n -p -l -i eth0 -s0 -W tcp dst port 80 | stdbuf -oL
strings -n8 | stdbuf -oL grep "&" | ./acurite-lwp2.pl &
Im also using a perl script to process the file and make it readable from
RADAR. I just installed a fresh copy in case I messed up somehow between
last night and today.
#!/usr/bin/perl
#===============================================================================
#
# FILE: acurite-lwp.pl
#
# USAGE: ./acurite-lwp.pl
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Radar (), radar@localhost
# ORGANIZATION:
# VERSION: 0.1
# CREATED: 10/08/2016 07:16:48 PM
# Last modified: Mon Oct 31, 2016 10:49PM
# REVISION: 1
#===============================================================================
use strict;
use warnings;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
my $req = HTTP::Request->new(POST => 'http://192.168.1.7:8080');
my $res;
my $newline = '';
my $build = 0;
my $obs_line = 'dateutc=now&action=updateraw&realtime=1';
#-------------------------------------------------------------------------------
# the 5n1 sends two packets
# 5N1x31 packet has windspeedmph & winddir & rainin & dailyrainin &
# baromin & battery & rssi
#
# 5N1x38 packet has windspeedmph & humidity & tempf & baromin & battery &
rssi
#-------------------------------------------------------------------------------
while ( my $line = <> ) {
if ( defined $line ) {
if ($line =~ /GET /) {
$build = 1;
$newline = '';
}
#-------------------------------------------------------------------------------
# id & mt & sensor
# id = smarthub mac address
# mt sensor type
# sensor number
#-------------------------------------------------------------------------------
if (($line =~ /&id=/) && ($build == 1)) {
$line =~ s/.*&id=/&id=/xm;
chomp $line;
$newline = $line;
}
#-------------------------------------------------------------------------------
# windspeedmph & humidity for 5n1 from 5N1x38 packet;
# 5N1x31 packet has windspeedmph & winddir
#-------------------------------------------------------------------------------
if (($build == 1) && ($line =~ /&windspeedmph=/)) {
$line =~ s/.*&windspeedmph=/&windspeedmph=/xm;
chomp $line;
$newline = $newline . $line;
}
#-------------------------------------------------------------------------------
# look for 5N1x38 if found grab the tempf
#-------------------------------------------------------------------------------
if (($build == 1) && ($newline =~ /5N1x38/)) {
if (($build == 1) && ($line =~ /&tempf=/)) {
$line =~ s/.*&tempf=/&tempf=/xm;
chomp $line;
$newline = $newline . $line;
}
#-------------------------------------------------------------------------------
# if not found grab humidity & tempf
#-------------------------------------------------------------------------------
} elsif (($build == 1) && ($line =~ /&humidity=/)) {
$line =~ s/.*&humidity=/&humidity=/xm;
chomp $line;
$newline = $newline . $line;
}
#-------------------------------------------------------------------------------
# rainin & dailyrainin for rain gauge and 5n1
#-------------------------------------------------------------------------------
if (($build == 1) && ($line =~ /&rainin=/)) {
$line =~ s/.*&rainin=/&rainin=/xm;
chomp $line;
$newline = $newline . $line;
}
#-------------------------------------------------------------------------------
# ProIn sensor
# indoorhumidity & indoortempf
#-------------------------------------------------------------------------------
if (($build == 1) && ($line =~ /&indoorhumidity=/)) {
$line =~ s/.*&indoorhumidity=/&indoorhumidity=/xm;
chomp $line;
$newline = $newline . $line;
}
#-------------------------------------------------------------------------------
# the extra probs for a ProIn & ProOut sensors
# probe & check & water (Water Detector)
# probe & check & ptempf (Liquide and or Soil Temp)
# probe & check & ptempf & phumidity (Spot Check Temperature and Humidity)
#-------------------------------------------------------------------------------
if (($build == 1) && ($line =~ /&probe=/)) {
$line =~ s/.*&probe=/&probe=/xm;
chomp $line;
$newline = $newline . $line;
}
#-------------------------------------------------------------------------------
# baromin & battery & rssi
# baromin is from the smarthub
#-------------------------------------------------------------------------------
if (($build == 1) && ($line =~ /&baromin=/)) {
$line =~ s/.*&baromin=/&baromin=/xm;
chomp $line;
$build = 2;
$newline = $newline . $line;
$obs_line = $obs_line . $newline;
$newline = '';
}
if ($build == 2) {
$build = 0;
print "$obs_line\n";
$req->content("$obs_line");
$res = $ua->request($req);
$obs_line = 'dateutc=now&action=updateraw&realtime=1';
if ( $res->is_success ) {
print $res->content, "\n";
}
else {
print $res->status_line, "\n";
}
}
} #end of if definde $line
} # end of while loop
On Saturday, November 5, 2016 at 11:04:26 AM UTC-7, mwall wrote:
>
> On Saturday, November 5, 2016 at 1:46:46 PM UTC-4, Brad Tucker wrote:
>>
>> Strange... I looked through todays logs and none of them display a "POST"
>> with the results. The info is in the TCPdump but not the syslog after
>> processing. Nothing has changed on the system other then the new version of
>> the interceptor driver. Not sure where to go from here... Open to
>> suggestions...
>>
>> Here is a log from last night that has the POST info you request. This
>> was on the previous version of the driver. Not sure why it doesn't show up
>> today?
>>
>
> brad,
>
> i am pretty sure i made no changes to the interceptor that would change
> how it reports the POST requests that it receives.
>
> the 'ServerThread: POST:' messages reflect what the intercept receives,
> before it does any processing
>
> so if there is no rainin or dailyrainin in a post, it must be lost before
> it gets to the interceptor
>
> what commands/process are you now using to feed data to the interceptor?
>
> m
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.