Spring / Summer 2018 and onwards software

Sub-forum for general software improvements threads
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Spring / Summer 2018 and onwards software

Post by Penri »

Hello

I won't be around for the next couple of days so I can't be there to help, good luck.

Hwyl

Penri
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

Hello,

I came in and fixed the issue today. It was nothing major. Here's a description of the problem (excerpt from the email):
The issue was an accidental delay I introduced a long time ago when queuing readings from the sump probe, but it only became an issue as of yesterday, because of changes to the software's internals to enable future works.
I will now commit the fix to our code repository, to avoid this issue in future. The issue is still present on the buttspi side, but it won't be a problem because of the way the software starts:
  • On buttspi the software starts and connects to sumppi when/if it can.
  • On sumppi, because of temporary changes, the software will now wait for buttspi before it starts to do anything.
  • ^ I will revert this back to the old behaviour of starting anyway when possible. For now it will be fine - our network connection between pis seems just fine.
I'm happy this wasn't another occurrence of our previous, non-diagnosable issue.

Everything else seems to be working well, so all is good :).

Hamish
Last edited by hamishmb on 11/07/2018, 11:06, edited 1 time in total.
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

To clarify, the software would eventually have reacted, but just several minutes late, which isn't much use.

NB: Terry, DHCP on your router works fine, I realised I configured a static IP for the ethernet port on my laptop :D
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

UPDATE:

Several more changes have been made. Mostly these are more enabling works for the future, notably:
  • All config for all sites is now stored in config.py (previously called universal_standalone_monitor_config.py).
    • Hence, there are no longer any commandline options for main.py.
    • There will ideally be just one commandline option for universal_monitor.py (--site).
    • ^ Currently, we still have -n to specify the number of readings to take (usually unspecified to run forever).
    • The -t, --type, option has been removed, because config.py now contains this info.
  • More refactoring has been done between the two scripts to make them as flexible as possible from a monitoring point of view.
  • ^ This is now largely complete, and will make it easy to implement the overall site log.
  • The logic for controlling gate valves will probably be in core tools, in case we want a remote pi to handle that.
Quick question: we have never specified the number of readings to take - it's always been indefinite. Shall I remove this option and the supporting code?

There is a fair bit of refactoring being done here, as our design needed to change, but we're getting pretty high levels of flexibility now. Yay for real-world software development XD. Thanks for being patient waiting for the new features to roll in :)

Hamish
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

As noted elsewhere, I have reverted the readings file format to make it easier to plot results on a graph and do other analysis.

Some other changes are in the pipeline to help add support for multiple pis - more centralised config in config.py.
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

The software has been updated.

Summary of changes:
  • The readings file format was reverted to make charts easier to produce / allow easier analysis.
  • Multiple sockets can now be created at the master pi end using the configuration in config.py.
    • This is (I think) that last thing that was stopping us from adding more pis to the system with relative ease.
    • Each remote pi will communicate over its own dedicated socket to the master pi, counting up from port no. 30000.
    • ^ eg 30000 - buttspi, 30001 - stagepi, 30002 - railwaypi etc.
  • Probe objects now have an id attribute instead of a name one.
    • This makes it easier for us to identify different probes at different sites for making decisions.
Now all we need is support for gate valves and PWM :) I guess I'll have to wait for that, unless we've decided how to implement these things.

Hamish
Hamish
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Spring / Summer 2018 and onwards software

Post by Penri »

Good job.
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

I fixed a few issues with the new software today:

The circulation pump was configured for pin 5 for some reason - now pin 18 as specified.
A software mechanism I used at home for looping over a dictionary didn't work at WMT. I will investigate on my pi, but it's weird because I already tested it...

If we run out of stuff to do on Thursday (if I make it in), I'll have a look then, or I'll come in at some weird time when I'm free to have a look.

Also:

I have edited the .bashrc files on the pis:
  • Sumppi's script now takes no options - "python3 main.py".
  • Buttspi's script now only takes one option - "python3 universal_monitor.py --id "G4".
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Spring / Summer 2018 and onwards software

Post by hamishmb »

I updated the software again and updated the pis today:
  • Magnetic probe levels can now be logged immediately when a level change is detected, but before the reading interval has elapsed.
    • This is a convenience feature so we can check the probes are working more easily.
    • Currently disabled: needs debugging log mode enabled to prevent huge file sizes.
  • Remove dot in filenames to making charting w/ libreoffice easier.
  • Remove old config in config.py (new format).
  • Make the main files executable for convenience (been meaning to do this for months).
  • Update docs for config.py
Hamish
Post Reply