Closed GoogleCodeExporter closed 9 years ago
The problem is the regex parsing, definitely.
I did this, and it's now working for me - clearly, it's mangled to the point of
being no use for your more general code, but it does show where the fault is...
r = re.search(r"<tmpr>(.+?)</tmpr><sensor>(\d+)</sensor>.+<ch2><watts>(\d+)<\/watts><\/ch2>", line)
if r:
#print r
tmpr = r.group(1)
watt_sum = int(r.group(3))
sensor_data_check( r.group(2), watt_sum, tmpr )
Original comment by i...@glasgowfoundry.co.uk
on 13 Mar 2014 at 10:54
More on this issue - it appears that the code handles the situation where
clamps are connected in order, that is, the numbered ports on the underside of
the EnviR are populated 1, then 2, then 3.
If there is a "gap", or a lower numbered clamp is not populated, the regex
fails to find the data.
Original comment by i...@glasgowfoundry.co.uk
on 6 Apr 2014 at 7:38
Original comment by lalelu...@gmail.com
on 25 Jul 2014 at 9:30
Original issue reported on code.google.com by
i...@glasgowfoundry.co.uk
on 12 Mar 2014 at 8:54