Running Multiple Monitor Threads for Reading Probes

A forum for discussion on the software for the WMT River Control System
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Running Multiple Monitor Threads for Reading Probes

Post by hamishmb »

It'd need the device ID (if not already passed, can't remember), but only that - one ManageHallEffectProbe class is needed for each probe, so you'd have 3 classes worrying about one probe each
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Running Multiple Monitor Threads for Reading Probes

Post by TerryJC »

Now that I have finished the hardware construction and testing (viewtopic.php?p=3076#p3076) I will be testing the updated Software Framework over the coming days. I made a start on this with changes to config.py, coretools.py and devicemanagement.py, but then got a bit bogged down.

Last night at the LUG Meeting Hamish finished the coding and I now need to test it.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Running Multiple Monitor Threads for Reading Probes

Post by TerryJC »

Hamish,

Your changes last night seem to have worked extremely well :D

I haven't tested the system connected to the Sump Pi yet, but running standalone all I had to do was to change the line in devicemanagement.py from:

Code: Select all

        self.ads = ADS.ADS1115(i2c, i2c_address)
to:

Code: Select all

        self.ads = ADS.ADS1115(i2c, address=i2c_address)
and I got readings from all three probes:
04/03/2020 13:00:26 - River System Control Software - INFO: Starting to take readings...
Reading at time 2020-03-04 13:00:26, and tick 0, from probe: G3:M0, with value: 50, and status: OK
Reading at time 2020-03-04 13:00:26, and tick 0, from probe: G3:FS0, with value: True, and status: OK
Reading at time 2020-03-04 13:00:26, and tick 0, from probe: G3:FS1, with value: True, and status: OK
Reading at time 2020-03-04 13:00:27, and tick 0, from probe: G3:M1, with value: 100, and status: OK
Reading at time 2020-03-04 13:00:27, and tick 0, from probe: G3:FS2, with value: True, and status: OK
Reading at time 2020-03-04 13:00:27, and tick 0, from probe: G3:FS3, with value: False, and status: OK
Reading at time 2020-03-04 13:00:27, and tick 0, from probe: G3:M2, with value: 50, and status: OK
Reading at time 2020-03-04 13:00:27, and tick 0, from probe: G3:FS4, with value: True, and status: OK
Reading at time 2020-03-04 13:00:27, and tick 0, from probe: G3:FS5, with value: False, and status: OK
I had two of the Float Switch inputs shorted to 0 V and two of the probes had their magnet at the bottom and one at 100 mm. As you can see everything seems to have worked fine.

Once I've completed a system check in conjunction with another Pi set up as SumpPi, I'll be ready to install on site.

Looking really good :!:
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Running Multiple Monitor Threads for Reading Probes

Post by hamishmb »

Oh I'm glad it worked :)

You probably want to change the corresponding line in the gate valve class too then.

Excellent work, I'll try and have any outdated documentation updated soon :)
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Running Multiple Monitor Threads for Reading Probes

Post by TerryJC »

Ok. Will do
Terry
Post Reply