When I started the previous test, SumpPi was started after SButtsPi. We always knew that SumpPi needed to be up so that it could connect to the peers when they came up. That's why we put a 30 s delay into the script in rc.local on the remote Pis, just before sending the rdate command, to ensure that SumpPi was well and truly up before trying to do anything.
I was aware of this, but thought that it would have no effect on the performance of SButtsPi, since it would simply run standalone.
I now want to confirm that by starting the two devices together and ensuring that they saw each other. Unfortunately, I seem to have mixed results with this. SButtsPi clearly can see SumpPi, because the clock was set by rdate. However, SumpPi doesn't seem to be able to get a connection from SButtsPi after main.py has started. Here is what it thinks:
Code: Select all
tail rivercontrolsystem.log
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._connect_socket(): Attempting to connect to the requested socket...
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._create_socket(): Creating the socket...
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._create_socket(): Done!
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._connect_socket(): Attempting to connect to the requested socket...
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._create_socket(): Creating the socket...
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._create_socket(): Done!
22/06/2019 09:27:03 AM - Tools.sockettools - INFO: Sockets._connect_socket(): Attempting to connect to the requested socket...
22/06/2019 09:27:03 AM - River System Control Software - INFO: Starting to take readings...
22/06/2019 09:27:03 AM - River System Control Software - INFO: Waiting for client(s) to connect...
22/06/2019 09:28:16 AM - Tools.sockettools - INFO: Sockets._connect_socket(): Done!
You've seen the version of config.py that I'm using on SButtsPi. This is what I get from SumPi when I cat it:
Code: Select all
#Settings for the G6 site (client pi behind the stage).
"G6":
{
"ID": "G6",
#Local probes.
"Probes":
{
"G6:M0":
{
"Type": "Hall Effect Probe2",
"ID": "G6:M0",
"Name": "Stage Butts Probe",
"Class": Tools.deviceobjects.HallEffectProbe2,
"HighLimits": (0.07, 0.17, 0.35, 0.56, 0.73, 0.92, 1.22, 1.54, 2.1, 2.45),
"LowLimits": (0.05, 0.15, 0.33, 0.53, 0.7, 0.88, 1.18, 1.5, 2, 2.4),
"Depths100s": (0, 100, 200, 300, 400, 500, 600, 700, 800, 900),
"Depths25s": (25, 125, 225, 325, 425, 525, 625, 725, 825, 925),
"Depths50s": (50, 150, 250, 350, 450, 550, 650, 750, 850, 950),
"Depths75s": (75, 175, 275, 375, 475, 575, 675, 775, 875, 975),
"Default Interval": 10
},
"G6:FS0":
{
"Type": "Float Switch",
"ID": "G6:FS0",
"Name": "Stage Butts Switch",
"Class": Tools.deviceobjects.FloatSwitch,
"Pins": (8),
"Default Interval": 30
}
},
"ServerAddress": "192.168.0.2",
"ServerPort": 30006,
"ServerName": "SumpPi"
},
I'm still monitoring both Pis and CPU usage is much the same after an uptime of 1 hour 17 minutes.