Tue, 07 May 2024 14:11:31 +0200
Save one devices loop when handling a 2413 device.
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). After one day: root 9795 1 9795 3 7 May04 ? 00:29:27 /usr/bin/thermferm Total root 9795 1 9796 0 7 May04 ? 00:00:09 /usr/bin/thermferm mqtt ? root 9795 1 9797 0 7 May04 ? 00:00:01 /usr/bin/thermferm Websocket root 9795 1 9798 2 7 May04 ? 00:19:09 /usr/bin/thermferm my_one_wire_loop root 9795 1 9799 0 7 May04 ? 00:04:43 /usr/bin/thermferm my_devices_loop started root 9795 1 9800 0 7 May04 ? 00:00:00 /usr/bin/thermferm my_server_loop root 9795 1 9801 0 7 May04 ? 00:04:45 /usr/bin/thermferm my_panel_loop 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. To see each thread usage: ps -eLf | grep thermferm