MIGRATION

Thu, 25 Apr 2024 16:44:54 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 25 Apr 2024 16:44:54 +0200
changeset 711
844588d0df65
parent 668
4df4c8b17733
child 725
b15a2ae7bea7
permissions
-rw-r--r--

Version 0.9.19b1. Less noisy logging.

		Migration from wiringPi to PIGPIO.
		==================================

WiringPi is unmaintained and replaced by pigpio. This will need large parts
of thermferm to be rewritten. It is also a good moment to replace the current
server protocol with json data and start sending data changes over
websockets.

Some parts of the code can make use of direct kernel support, since kernel 4
there are lots of new modules. Fact is that thermferm is started in 2014,
that is 10 years ago.

The current devices model is not very practical. We need to separate the parts
that don't need gpio out of it. All one-wire devices need their own driver
thread. Is done.


	Current threads.
	----------------

These are the current running threads.
1. my_one_wire_loop.
2. my_devices_loop.
3. my_server_loop.
4. my_panel_loop.
5. my_simulator_loop (if enabled).



	Steps to do.
	------------

Try to read all temperature sensors at once. The kernel supports this now.
The devices thread needs to use the collected temperatures.
Read all ds2413 devices from sys/bus/w1. If output bits are set different
then send output values.


Add pigpio library and make it testable by the configure script.


	Flow one-wire.
	--------------

States:
  1. Init state.
  2. Check for exit.
     Scan for devices. Add to one-wire list.
  3. Check for exit.
     Read all DS2413 devices programmed as input. TODO: set output bits.
  4. Check for exit.
     Read one temperture sensor from list and update.
  5. Check for exit.
     Check for missing devices not in one wire table. TODO.
     Goto 2.
  6. Exit state.



	Flow thermferm.
	---------------

Before:
     Initialize all units.
     Publish DBirth
     Publish Startup

States:

  1. Init.
  2. Check shutdown.
     Check run_pause.
     Wait for new minute.
       Yes, goto 3.
       No, goto 8.
  3. Update clock on display.
     Show room temp/humidity.
  4. If THB changed or 5 minutes passed publish NData.
  5. For units loop, do all units.
  6. Show LCD buffer.
  7. 60 seconds reset and Minute actions.
  8. Keyboard check.
     Delay 50 mSec.
     Goto 2.
  9. Done.

After:
     Stop all units.

mercurial