So the issue of multiple packets being processed-sometimes with the 'wfor' 
portion of the packet cut off is fixed. I somehow had multiple collection 
sctipts proccessing at the same time and I assume they were stepping on 
each other and not all working.

But the issue of proper processing is still there. I see the POST and to my 
eye it looks good. There are no errors and indeed-interceptor and weewx 
seem to say they are adding the measurement to weewx and the db, but I get 
nothing logged, and nothing sent to APRS/WU, etc.

Here's a relevant excerpt from the log:

~~~
Dec 11 07:21:55 raspberrypi weewx[10289]: interceptor: ServerThread: POST: 
mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1015&ptr=0&wfor=1&p=1
Dec 11 07:21:55 raspberrypi weewx[10289]: interceptor: MainThread: raw 
data: 
mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1015&ptr=0&wfor=1&p=1
Dec 11 07:21:55 raspberrypi weewx[10289]: interceptor: MainThread: raw 
packet: {'lost.:.0004a369e0d6': '0000', 'ac.:.0004a369e0d6': '0', 
'wfor.:.0004a369e0d6': '1', 'ptr.:.0004a369e0d6
': '0', 'lb.:.0004a369e0d6': '0', 'baro.:.0004a369e0d6': 1015.0, 
'dateTime': 1481469716, 'id.:.0004a369e0d6': 'c2', 'p.:.0004a369e0d6': '1', 
'pv.:.0004a369e0d6': '0', 'reg.:.0004a369e0
d6': '1809', 'usUnits': 17, 'mac.:.0004a369e0d6': '0004a369e0d6'}
Dec 11 07:21:55 raspberrypi weewx[10289]: interceptor: MainThread: mapped 
packet: {'usUnits': 17, 'dateTime': 1481469716}
Dec 11 07:21:56 raspberrypi weewx[10289]: manager: added record 2016-12-11 
07:21:56 PST (1481469716) to database 'cmon.sdb'
Dec 11 07:21:56 raspberrypi weewx[10289]: manager: added record 2016-12-11 
07:21:56 PST (1481469716) to daily summary in 'cmon.sdb'
Dec 11 07:21:58 raspberrypi weewx[10289]: manager: added record 2016-12-11 
07:20:00 PST (1481469600) to database 'weewx.sdb'
Dec 11 07:21:58 raspberrypi weewx[10289]: manager: added record 2016-12-11 
07:20:00 PST (1481469600) to daily summary in 'weewx.sdb'
~~~

Any ideas?

-SR\

On Saturday, December 10, 2016 at 12:22:26 AM UTC-8, Sam Roza wrote:
>
> I am having a baro problem:
>
> ~~~
> Dec  4 21:33:03 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1013&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  4 21:56:03 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1013&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> ...
> Dec  6 07:22:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1012&ptr=0&wf: 
> dictionary update sequen
> ce element #9 has length 1; 2 is required
> Dec  6 07:25:20 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for Length:: dictionary update sequence element #0 has length 1; 2 
> is required
> Dec  6 07:25:20 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 68..User-Agent:: dictionary update sequence element #0 has 
> length 1; 2 is required
> Dec  6 07:25:20 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for BlackBox/1.0.08..Connection:: dictionary update sequence 
> element #0 has length 1; 2 is required
> Dec  6 07:28:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1012&ptr=0&wf: 
> dictionary update sequen
> ce element #9 has length 1; 2 is required
> Dec  6 07:34:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  6 07:40:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  6 07:47:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  6 07:53:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  6 07:59:56 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for Length:: dictionary update sequence element #0 has length 1; 2 
> is required
> Dec  6 07:59:56 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 62..User-Agent:: dictionary update sequence element #0 has 
> length 1; 2 is required
> Dec  6 07:59:56 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for BlackBox/1.0.08..Connection:: dictionary update sequence 
> element #0 has length 1; 2 is required
> Dec  6 08:11:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  6 08:17:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> Dec  6 08:21:50 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for Length:: dictionary update sequence element #0 has length 1; 2 
> is required
> Dec  6 08:21:50 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 62..User-Agent:: dictionary update sequence element #0 has 
> length 1; 2 is required
> Dec  6 08:21:50 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for BlackBox/1.0.08..Connection:: dictionary update sequence 
> element #0 has length 1; 2 is required
> Dec  6 08:28:01 raspberrypi weewx[4795]: interceptor: MainThread: parse 
> failed for 
> mac=0004a369e0d6&id=c2&pv=0&lb=0&ac=0&reg=1809&lost=0000&baro=1011&ptr=0&wf: 
> dictionary update sequence element #9 has length 1; 2 is required
> ~~~
>
> But I do not know the cause. It's been doing this for about 5 days, now. 
>
> -SR
>

On Saturday, December 10, 2016 at 5:27:29 PM UTC-8, Sam Roza wrote:
>
> 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