1 Migration from wiringPi to PIGPIO. |
1 Migration from wiringPi to PIGPIO. |
2 ================================== |
2 ================================== |
3 |
3 |
4 WiringPi is unmaintained and replaced by pigpio. This will need large parts |
4 WiringPi is unmaintained and replaced by pigpio. This will need large parts |
5 of thermferm to be rewritten. It is also a good moment to replace the current |
5 of thermferm to be rewritten. It is also a good moment to replace the current |
6 server protocol with json data and start sending data chaanges over |
6 server protocol with json data and start sending data changes over |
7 websockets. |
7 websockets. |
8 |
8 |
9 Some parts of the code can make use of direct kernel support, since kernel 4 |
9 Some parts of the code can make use of direct kernel support, since kernel 4 |
10 there are lots of new modules. Fact is that thermferm is started in 2014, |
10 there are lots of new modules. Fact is that thermferm is started in 2014, |
11 that is 10 years ago. |
11 that is 10 years ago. |
12 |
12 |
13 The current devices model is not very practical. We need to separate the parts |
13 The current devices model is not very practical. We need to separate the parts |
14 that don't need gpio out of it. All one-wire devices need their own driver |
14 that don't need gpio out of it. All one-wire devices need their own driver |
15 thread. |
15 thread. Is done. |
16 |
16 |
17 |
17 |
18 Current threads. |
18 Current threads. |
19 ---------------- |
19 ---------------- |
20 |
20 |
63 Before: |
63 Before: |
64 Initialize all units. |
64 Initialize all units. |
65 Publish DBirth |
65 Publish DBirth |
66 Publish Startup |
66 Publish Startup |
67 |
67 |
68 States (nested): |
68 States: |
69 |
69 |
70 1. Init. |
70 1. Init. |
71 2. Check shutdown. |
71 2. Check shutdown. |
72 Check run_pause. |
72 Check run_pause. |
73 Wait for new minute. |
73 Wait for new minute. |
|
74 Yes, goto 3. |
|
75 No, goto 8. |
74 3. Update clock on display. |
76 3. Update clock on display. |
75 Show room temp/humidity. |
77 Show room temp/humidity. |
76 4. If THB changed or 5 minutes passed publish NData. |
78 4. If THB changed or 5 minutes passed publish NData. |
77 5. For units loop. |
79 5. For units loop, do all units. |
78 |
|
79 1. Init. |
|
80 2. If air address |
|
81 3. If beer address |
|
82 4. If chiller address |
|
83 5. If door address |
|
84 6. If PSU address |
|
85 7. If unit->mode == UNITMODE_PROFILE |
|
86 8. If unit->mode == UNITMODE_NONE |
|
87 9. Usage counters |
|
88 10. If light address |
|
89 11. if ((unit->mode == UNITMODE_FRIDGE) || (unit->mode == UNITMODE_BEER) || (unit->mode == UNITMODE_PROFILE)) // Temp control active |
|
90 12. Update the LCD |
|
91 13. Set unit->mqtt_flag |= MQTT_FLAG_DATA after 60 seconds |
|
92 14. Publish what is needed. |
|
93 15. Handle alarms. |
|
94 16. End. |
|
95 |
|
96 6. Show LCD buffer. |
80 6. Show LCD buffer. |
97 7. 60 seconds reset and actions. |
81 7. 60 seconds reset and Minute actions. |
98 8. Keyboard check. |
82 8. Keyboard check. |
99 9. Delay 100 mSec and goto 2. |
83 Delay 50 mSec. |
100 10. Done. |
84 Goto 2. |
|
85 9. Done. |
101 |
86 |
102 After: |
87 After: |
103 Stop all units. |
88 Stop all units. |
104 |
89 |