Commit Graph

201 Commits

Author SHA1 Message Date
Thomas Basler
a2880cc447 Add RX main command to structure which is passed to handleResponse
This is required because the DevControlCommands just set the first byte to define whether the request was successfull or not
2022-09-30 18:34:30 +02:00
Thomas Basler
2376da1722 Create function to set ActivePower on inverter level 2022-09-30 18:34:30 +02:00
Thomas Basler
73e2aaf8fe Implemented setting/getting of limit/type for ActivePowerControl 2022-09-30 18:34:30 +02:00
Thomas Basler
d998271944 Implemented crc16 calculation for DevControlCommand 2022-09-30 18:34:30 +02:00
Thomas Basler
cfdbf5963c Empty classes of ActivePowerControl 2022-09-30 18:34:30 +02:00
Thomas Basler
8e2aa8981f Fix #170: Update byte assignment for statistics data 2022-09-28 18:44:59 +02:00
Thomas Basler
b8f03eddfd Fixed scheduler issue
When the RF method took very long inverters where skipped
2022-09-25 17:28:50 +02:00
Thomas Basler
68fc0c2547 Extend memory to fetch all eventlog entries 2022-09-25 17:26:48 +02:00
Thomas Basler
53692bae34 Fix timeout for alarm messages 2022-09-23 19:13:08 +02:00
Thomas Basler
950b211fd5 Set getLocalTime timeout to 0 to prevent watchdog triggers
This happens especially when no WiFi is configured and the user enters the NTP info page
2022-09-19 20:45:44 +02:00
Thomas Basler
9cda41f5e9 Use uint32_t, rather than the C type long 2022-09-15 19:00:38 +02:00
Thomas Basler
c07b18a9d8 Use static_cast<float>(...) instead C-style cast 2022-09-15 18:53:41 +02:00
Thomas Basler
c43346134d Use static_cast<int>(...) instead C-style cast 2022-09-15 18:48:22 +02:00
Thomas Basler
088ba58827 Mark Single-parameter constructors explicit 2022-09-13 22:50:33 +02:00
Thomas Basler
de33b9ff88 Do not use namespace using-directives. Use using-declarations instead. 2022-09-13 21:35:51 +02:00
Thomas Basler
abcabf7fb6 Added header guard 2022-09-13 21:11:32 +02:00
Thomas Basler
b0460c7f14 Add documentation of current class hierarchy 2022-09-09 20:53:15 +02:00
Thomas Basler
b7961024a1 Fetch limit every 10 minutes 2022-09-09 20:17:52 +02:00
Thomas Basler
3e5fb00248 Fetch inverter limit at least once 2022-09-09 18:41:54 +02:00
Thomas Basler
c28a532bf1 Added base classes for SystemConfigPara 2022-09-09 18:41:07 +02:00
Thomas Basler
185fea987d Added some initializations to prevent missunderstandings and errors 2022-09-05 21:53:50 +02:00
Thomas Basler
31e56f6c2b Code hardening: introduce const keyword 2022-09-05 21:41:45 +02:00
Thomas Basler
26268479fb Fix #96 and #95 : Reworked handling of inverter editing 2022-08-24 02:53:34 +02:00
Thomas Basler
1456974616 Fix #76: Null Pointer exception when adding a inverter with unkonwn serial number 2022-08-16 19:47:51 +02:00
Thomas Basler
991838ae2c Added reactive power output and display 2022-08-10 20:40:26 +02:00
Thomas Basler
528c56eaa6 Added parser and commands for hardware version and part nr 2022-08-10 20:12:52 +02:00
Thomas Basler
c3a043b1ce Improve handling of firmware data fetch 2022-08-10 19:03:02 +02:00
Thomas Basler
f566a8c522 Implemented parser methods and publish to mqtt 2022-08-10 19:03:02 +02:00
Thomas Basler
ee339fa9bd Use Parser class in Statistics and Alarm parser 2022-08-10 19:03:02 +02:00
Thomas Basler
8715320282 Implemented DevInfo command 2022-08-10 19:03:02 +02:00
Thomas Basler
ef5d549f8a Fix exception when deleting a inverter 2022-08-09 21:46:40 +02:00
Thomas Basler
6c088a9898 Implemented channel hopping on TX frequencies
Every sent package changes the frequency
2022-08-04 20:10:44 +02:00
Thomas Basler
4ff6433b90 Added first empty classes for DevControl and ParaSet 2022-08-03 20:36:35 +02:00
Thomas Basler
037f7b9caf Move CRC check of multidata command from InverterAbstract to MultiDataCommand class 2022-08-03 19:51:10 +02:00
Thomas Basler
3abc7d7e3d Increase max receiveable packages to 12
* Required for large eventlogs
2022-08-03 19:21:52 +02:00
Thomas Basler
081b19f9fb Allow fragments without payload
This is required for several DevControl commands
2022-08-03 19:13:31 +02:00
Thomas Basler
857e4a3671 Remove RequestType and place handling of response in the command class 2022-08-03 18:50:34 +02:00
Thomas Basler
a73707380f RequestFrameCommand can now be configured individually for each command
If the return value equals nullptr, a retransmit is not performed
2022-08-02 21:14:41 +02:00
Thomas Basler
c35f12c7be Fixed CRC calculation 2022-07-30 12:50:07 +02:00
Thomas Basler
0d26337575 Fixed retransmit count 2022-07-30 11:59:01 +02:00
Thomas Basler
442b27e859 Fixed assignment of router and target address 2022-07-30 11:10:04 +02:00
Thomas Basler
4413b603e3 Replace inverter_transaction with new command classes 2022-07-30 00:37:54 +02:00
Thomas Basler
4daa121663 Added several classes to encapsulate the packet generation 2022-07-29 23:31:28 +02:00
Thomas Basler
b2e41a1cfd Fix #37: Typo in statistics name (will lead to incompatible mqtt topic) 2022-07-24 12:38:00 +02:00
Thomas Basler
0fed0ba614 Update AlarmLogParser
* Show times > 12:00:00
* Fixed parsing of StartTime
2022-07-19 21:17:15 +02:00
Thomas Basler
dcc7e47b19 Hoymiles: Introduce init method to have a clean init on beginning
Constructor is not possible for obvious reasons
2022-07-18 21:30:12 +02:00
Thomas Basler
c6499e09bd Ignore fragment number zero. Should fix #29
It seems that some inverters send packages with fragment number zero and a valid CRC. Must ignore such packets!
2022-07-15 22:37:42 +02:00
Thomas Basler
4373ee651f Added YieldTotal and YieldDaily to 1 channel inverters to CH0 2022-07-15 18:49:17 +02:00
Thomas Basler
05c478d1f2 Added several guards and error messages
Try to prevent heap corruptions
2022-07-14 18:54:53 +02:00
Thomas Basler
e057ed3ed7 Fixed issue that no data in live view where shown
Happend only for inverters which didn't answer any request
2022-07-12 21:21:04 +02:00
Thomas Basler
4259df9ee6 Hoymiles Lib: Allow configuration of all pins 2022-07-12 18:42:52 +02:00
Thomas Basler
5bb9acdbc6 Refactored Hoymiles Lib: Move statistics parser into separate class 2022-07-12 18:27:56 +02:00
Thomas Basler
d9ecb64a4d Only add timezone offset if value > 0 2022-07-08 18:22:35 +02:00
Thomas Basler
f7eb54fa41 First version of webapi for event log 2022-07-08 18:22:35 +02:00
Thomas Basler
b9bb753906 First try to implement Alarm Log fetching 2022-07-08 18:22:35 +02:00
Thomas Basler
4f2d705314 Added possibility to override pin assignments 2022-07-08 18:20:36 +02:00
Thomas Basler
dfdf8d9054 Added event log count to 1 channel invterers 2022-07-08 18:08:56 +02:00
Thomas Basler
56f764d10f Fixed queue handling and added event log count 2022-07-04 19:36:58 +02:00
Thomas Basler
0f75c4a6a4 Introduced some pin defines 2022-07-02 11:58:31 +02:00
Thomas Basler
839720ee8a Fix compilation warning
warning: backslash-newline at end of file
2022-07-01 17:46:51 +02:00
Thomas Basler
c4e911cecf Add very simple method differ between requests
The last request is required to use the right parser for the received payload as the package type is not encoded in the received data
2022-06-30 21:14:58 +02:00
Thomas Basler
b2271373a4 Print inverter serial as hex 2022-06-30 21:06:23 +02:00
Thomas Basler
54b7673f1a Replace magic numbers by some constants 2022-06-30 18:58:55 +02:00
Thomas Basler
e9e5c715f5 Remove duplicated variable
The content of _activeSerial is also available in currentTransaction.target
2022-06-27 21:56:55 +02:00
Thomas Basler
65fb13fa41 Better detection of invalid dates (no NTP sync) 2022-06-27 21:06:54 +02:00
Thomas Basler
10de26bcb8 Better handling of rerequest of complete packets 2022-06-27 19:37:03 +02:00
Thomas Basler
ab6261da92 Move the whole stats request into the inverter class
This enables in future releases so send multiple requests for e.g. MI inverters
2022-06-27 19:26:16 +02:00
Thomas Basler
7a0394151a First implementation of TX queue
This is required to implement some features of e.g. MI Inverters or to read the event log of HM inverters
2022-06-27 19:09:52 +02:00
Thomas Basler
96ef182d38 Fixed issue with irradiation calculation
getChannelMaxPower is zero based while the first string is 1 based on getChannelFieldData
2022-06-25 11:13:25 +02:00
Thomas Basler
bce3fc78e8 Renamed field names which are used for mqtt and web ui 2022-06-24 18:03:44 +02:00
Thomas Basler
2de865037c Renamed functions
getValue --> getChannelFieldValue
hasValue --> hasChannelFieldValue
getUnit --> getChannelFieldUnit
getName --> getChannelFieldName
2022-06-24 17:53:37 +02:00
Thomas Basler
db0a3da803 Generate a second class abstraction to support different inverter types in future 2022-06-24 17:49:14 +02:00
Thomas Basler
92c95c118a Fix issue with uninitialized payload
Gave bad values in web ui when no inverter was reachable
2022-06-22 21:52:34 +02:00
Thomas Basler
f42696d14c Fix change of inverter serial
Because of the inverter type depends on the serial number it's a must to remove and add the inverter of the serial was changed. setSerial doesn't make sense anymore. Move the serial to the constructor
2022-06-22 21:32:37 +02:00
Thomas Basler
746aa087ac Set MaxChannel Power on startup and in webapi 2022-06-22 21:12:45 +02:00
Thomas Basler
8d2b71cd04 Implemented resend of whole requests 2022-06-20 20:47:21 +02:00
Thomas Basler
5221c80d36 Added channel 40 to RX channel list 2022-06-19 12:53:33 +02:00
Thomas Basler
865d00d3d0 Code cleanup 2022-06-18 12:26:37 +02:00
Thomas Basler
52b5cdbdb6 Remove not required include 2022-06-16 14:34:21 +02:00
Thomas Basler
583bc7f366 Don't disable interrupts
Not needed as the flow is more less independent
2022-06-16 14:10:14 +02:00
Thomas Basler
1ea2990fe9 Remove not supported field 2022-06-16 01:18:39 +02:00
Thomas Basler
bab5beb170 Move strings from RAM to Flash 2022-06-15 22:21:50 +02:00
Thomas Basler
c9e603b2de Replace EVERY_N_SECONDS with millis
EVERY_N_SECONDS is not updated without a reboot of the controller
2022-06-15 22:15:02 +02:00
Thomas Basler
e3ded34020 Publish inverter stats only if values are updated 2022-06-15 21:50:49 +02:00
Thomas Basler
5978c0e71f Fixed issue in getValue 2022-06-15 20:16:37 +02:00
Thomas Basler
0d7cef5f60 Fixed issue of wrong detected byteAssignment length 2022-06-15 20:03:23 +02:00
Thomas Basler
9bfe6a9e63 First simple implementation of polling algorithm 2022-06-15 19:23:47 +02:00
Thomas Basler
37dbb343a9 Added additional inverter definitions 2022-06-14 21:02:51 +02:00
Thomas Basler
effd983e6d Added class to handle timeouts 2022-06-08 23:04:45 +02:00
Thomas Basler
8842968a22 Fixed name size and added blank function to clear rx buffer 2022-06-05 13:28:50 +02:00
Thomas Basler
ded6dc5977 Fixed hex vs dec in inv dectection 2022-06-05 13:10:25 +02:00
Thomas Basler
d9d6c3b27d Find inverter on fragment receive 2022-05-31 19:37:28 +02:00
Thomas Basler
0d9b994c92 Added function t retrieve a inverter just by a given payload fragment 2022-05-31 19:29:05 +02:00
Thomas Basler
87da5ef63d Renamed packet_t to fragment_t and implemented fragment crc check 2022-05-31 18:53:45 +02:00
Thomas Basler
0d07e3e09f WIP: Very rough first draft of Hoymiles library 2022-05-30 21:50:08 +02:00
Thomas Basler
6943782726 Added library to manage a circular buffer 2022-05-25 22:25:40 +02:00
Thomas Basler
6cd0531f4a Added library to execude code every x time 2022-05-25 22:24:11 +02:00
Thomas Basler
d139c3d9e5 Lib Hoymiles: Added required CRC functions 2022-05-24 23:02:26 +02:00
Thomas Basler
6c994f3cf6 Lib Hoymiles: First basic files 2022-05-24 23:01:52 +02:00
Thomas Basler
8fcaf8b1ca Added library to get the mcu reset reason 2022-04-14 11:30:27 +02:00
Thomas Basler
54dc566473 Initial commit 2022-04-09 11:05:14 +02:00