Hey Matt,

Here's the current iteration of the script:

~~~
#!/bin/sh

#ngrep -l -q -d eth0 '0004a369e0d6' | sed -u '/mac=/!d' | xargs -n 1 curl 
http://localhost:9999 -s -d
ngrep -l -q -d eth0 '0004a369e0d6' | tee /var/tmp/dump.txt | sed -u 
'/mac=/!d' | xargs -n 1 curl http://localhost:9999 -s -d
~~~

I think I might have found *a* problem. Not sure yet if it's *the* problem:

ps -ef output:

~~~
<snip>
pi         776   774  0 08:35 pts/0    00:00:00 -bash
root       786   776  0 08:35 pts/0    00:00:00 su
root       795   786  0 08:35 pts/0    00:00:00 bash
nobody     797     1  0 08:35 pts/0    00:00:07 ngrep -l -q -d eth0 
0004a369e0d6
root       798     1  0 08:35 pts/0    00:00:00 tee /var/tmp/dump.txt
root       799     1  0 08:35 pts/0    00:00:00 sed -u /mac=/!d
root       800     1  0 08:35 pts/0    00:00:00 xargs -n 1 curl 
http://localhost:9999 -s -d
root       801     2  0 08:35 ?        00:00:00 [kworker/1:1H]
root       883     2  0 08:40 ?        00:00:02 [kworker/0:0]
nobody     947     1  0 08:42 pts/0    00:00:10 ngrep -l -q -d eth0 
0004a369e0d6
root       948     1  0 08:42 pts/0    00:00:00 sed -u /mac=/!d
root       949     1  0 08:42 pts/0    00:00:00 xargs -n 1 curl 
http://localhost:9999 -s -d
root      1049     2  0 08:50 ?        00:00:00 [kworker/2:1]
root      1176   795  0 08:59 pts/0    00:00:00 /bin/sh ./capture.sh
nobody    1177  1176  0 08:59 pts/0    00:00:07 ngrep -l -q -d eth0 
0004a369e0d6
root      1178  1176  0 08:59 pts/0    00:00:00 tee /var/tmp/dump.txt
root      1179  1176  0 08:59 pts/0    00:00:00 sed -u /mac=/!d
root      1180  1176  0 08:59 pts/0    00:00:00 xargs -n 1 curl 
http://localhost:9999 -s -d
root      1229   795  0 09:02 pts/0    00:00:00 tail -f /var/tmp/dump.txt
<snip>
~~~

Looks like multiple scripts are running, to me...

Let me clean this up and see if it works everything out.

-SR

On Saturday, December 10, 2016 at 3:13:16 PM UTC-8, mwall wrote:
>
> On Saturday, December 10, 2016 at 4:46:15 PM UTC-5, Sam Roza wrote:
>>
>> Hi Matt, 
>>
>> I use a simple ngrep script that you and I worked out. I worked reliably 
>> for the last few months. I have been teeing the packets out to a file,  and 
>> in my previous reply,  you can see the 'wfor'  shows up in there. After the 
>> tee,  it's sent to interceptor. Looking at the weewx.log the POST shows the 
>> packet with the 'wfor' tacked to the end. But then it looks to me as if the 
>> packet is processed several times by interceptor. The tee file doesn't show 
>> multi packets. 
>>
>> Let me know if I'm unclear, or if the log snippet included isn't making 
>> sense. 
>>
>
> sam,
>
> based on the log snippet you posted, the interceptor is doing exactly what 
> it is supposed to do.
>
> the interceptor is not processing a single POST multiple times - based on 
> the log, something is *posting* what appears to be the same data multiple 
> times, and some of those POSTs contain incomplete data.
>
> the interceptor uses a standard do_POST handler on 
> BaseHTTPServer.BaseHTTPRequestHandler.  i don't know how that handler could 
> be duplicating POSTs - it simply puts the data it receives onto a queue.  
> and i don't know how the BaseHTTPServer could be duplicating POSTs.
>
> i know we went through the ngrep stuff in a different thread, but that was 
> awhile ago and i have no way of knowing what, if anything, has changed in 
> your setup.  are you using this (from a posting in october, in thread 
> "weewx with OS LW301 and interceptor driver"):
>
> #!/bin/sh
> ngrep -l -q -d eth0 '0004a369e0d6' | sed -u '/mac=/!d' | xargs -n 1 curl 
> http://localhost:9999 -s -d
>
> how are you tee-ing to file?
>
> perhaps you could have curl send to a web server that simply logs every 
> POST - that might help us track down where the duplication is coming from.
>
> 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.

Reply via email to