-
-
Notifications
You must be signed in to change notification settings - Fork 116
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging missing data in ems-esp with help of km200 with use of API and Syslog #97
Comments
I would agree using syslog is the easiest way. With debug on and MQTT off (because there's a lot of messages). Then a script in python, JS or shell (using curl) to invoke the commands in batches every n seconds. What we could do is add a new API command that sets a marker in the syslog so you can see which commands are called when. Would that help? It'll be good to get EMS-ESP closer to the KM200 and complete the missing library. |
Would it be possible to enable/disable syslog by API command?
I am ready to support. |
yes that would work. I'll create a new API endpoint called 'system/syslog_level' which takes a json body where 'value' has the syslog level. So OFF is off and DEBUG is on in this case. Do you need some help with the scripting? |
Thanks, not for the moment since I have all code already. |
@proddy just a question related to syslog messages set as hexadecimal bytes: Is crc send as well as last byte? If yes: How is crc byte calculated? First testings and resulting telegrams from gateway (48) to boiler (08). Value is send as hex in byte 5: dhwCircuits.dhw1.temperatureLevels.high value:50 ---> 48 08 EA 06 32 19 dhwCircuits.dhw1.temperatureLevels.low value:45 ---> 48 08 EA 12 2D 2E |
If the option "Output EMS telegrams as hexadecimal bytes" is enabled then the last byte will be the CRC. I use a lookup table for speed in the EMS-ESP code (see telegram.cpp line 50). |
EMS-ESP uses EA (the telegram type ID) with offset 6 to write the |
|
I recommend to discuss this in a seperate thread later. I still struggle with your name conventions: I will prepare an overview related to RC310 and EMS+ but it might take some time. |
I tried to test within a JS program but it turned out to be unnecessary complex. I would like to test sending telegrams by myelf rather then just watching telegrams send by the km200 gateway. |
this code snippet will calculate the CR, if you can re-write in JS: // Calculate CRC for buffer
uint8_t ems_crc( char * buffer, int len ){
uint8_t i,crc = 0x0;
uint8_t d;
for(i=0;i<len-2;i++){
d = 0;
if ( crc & 0x80 ){
crc ^= 12;
d = 1;
}
crc = (crc << 1)&0xfe;
crc |= d;
crc ^= buffer[i];
}
return crc;
} |
yes this needs looking at with Michael when he's back. Also why the value is been re-written each time. Do you still need an API call to set the SysLog log level? Or add a marker? |
I think midterm it makes sense to be able to set SysLog level by API (marker does not make a lot of sense), but wait until we have discussed the other topics. In the meatime I use node-red with the syslog-node in node-red and I am filtering the messages in node-red (e.g. from gateway to boiler) and then analyzing just the filtered messages. Whenever I change a km200 field value within my ioBroker adapter just one single telegram is send to boiler / thermostat. So it is easy to analyze within node-red for the moment.
Do you know in which broadcasting telegrams the wwseltemp is included? |
wwseltemp is from telegram 0xE9 (offset 10 of the data block). There is also wwsettemp in 0xE9 at offset 0. It's confusing what the difference is. |
Offset 10 of E9 is always 3C (60°C) and never change when I change the templevel_high. Just Offset 0 is changed but I guess that this would be rather actual settemp than temp_level_high. Since I do not find any value representing temp_level low in E9 I believe that E9 does not contain the data for temperature levels. |
BTW: Do you have an overview in respect to telegram types and respectiv values and their offset position for read / write as being used actually in ESP32 dev version? |
Not really. It's all in code. I generated the read values for Boiler. The write ones need to be added manually which I'll do later. |
Thanks, this is already a good start. 👍 I will do some checks .... Addition: I think you filter unknown telegram types. So these are not in syslog just a message for unknown type. I do have approx 26 unknown telegram types and I think it might be usefull to have a look as well. Could you change SysLog so that they are in SysLog when hexadecimal bytes are selected? |
the "No telegram type handler found for ID..." commands are printed in the log (Web, Console, Syslog) when the loglevel is DEBUG or higher. So setting this to DEBUG or ALL (or TRACE) for syslog should show you these alongside the hex telegram. I would need to check though but that's what I can remember from the code. |
@proddy sorry but the telegram itself is not send just the message "No telegram type handler found for ID..." It might be useful to introduce a loglevel "Telegrams" where just all telegrams on the EMS-Bus are send by syslog. |
setting syslog level we can add - I made a new issue #98 to track it changing the log behaviour to only show the telegrams is not possible due to how the cascaded Log Levels work (it's an industry standard). We need to think of another way. For now set the SysLog level to NOTICE and then in the console type |
I just see from Michaels syslog he posted in #90 the he gets the telegrams next to the message "No telegram type handler found for ID..." . Maybe I have made a mistake. Let me check again. |
Here is my SysLog for some short time, I can't find the respectiv telegrams to the message "No telegram type handler found for ID..." |
Just a question for my understanding. If "No telegram type handler found for ID 0x8E4" is within log and I can't find telegrams with 8E4 within Syslog, can it be that these are telegrams with id 07 E4 ? (because I find them in syslog) |
Yes, emsesp internally adds 0x100 to ems+ telegrams to differ between the type-id positions. The raw telegram |
@MichaelDvP thanks for clarifying. So this is valid for writing as well? What about looking at other ems-bus wiki's on the net - Do I have to take this into account? (ems-esp type id's differ for ems+) |
It affects only the logging in pretty format, the read-command and the watch-id. |
Thanks for clarifying. So console logging and syslog have same content. |
The Syslog format is still wrong - even in last version 3.2.2b1. With the versions afterwards and actual dev version only for rx messages format is OK. Any chances to get it corrected soon? BTW: I have made a small ioBroker setup with a node-red flow analyzing and filtering the syslog and a javascript program to test all km200 writable fields with my ioBroker adapter to get in return the respective ems telegrams and write this info to a csv file. |
The only change in syslog was #91, and this complies with specification. It's also independent of level and telegram format. I think there is something wrong with our node-red implementation. |
@MichaelDvP yes it might be related to the What shall I do? |
@proddy @MichaelDvP In the meantime I installed v3.2.2b1 without node red and reading the syslog within javascript. But now I am confused because syslog content/format changed from previous versions. |
I don't know or use node so can't help you there I'm afraid. It may be easier to capture some syslog on 3.2.1 and then compare it to 3.2.2b1. Without seeing real examples of what is not working its difficult to assist. |
Last changes of @MichaelDvP made syslog working again with node-red. Thanks a lot. 🥇 BTW: Are there already API commands for syslog available? |
Thanks but these are console commands. |
@MichaelDvP looks like we need to start updating the wiki. I hate writing doc but i think its needed |
In principal: Yes. |
I meant adding to the table here https://emsesp.github.io/docs/#/APIv3?id=system-endpoints with an explanation of the payload |
I created a setup with syslog-server in a javascript with filter functions and then used my ioBroker adapter to change all writeable fields in km200 and ems-esp and discover the telegrams send on the ems-bus by analyzing the telegrams on syslog afterwards. Let me share the result: Does this help? |
Thanks, for the |
Yes since I can test only fields marked writable - so all km200 fields are marked writeable by rest-api. |
The switchtime-coding is 2 bytes per switchtime, first byte upper 3 bits: day of week, lower 3 bits: mode, second byte time in steps of 15 min. SwitchProgramA, Data 03 14 01 58 FF FF FF FF FF FF FF FF is first: day 0, mode 3, 300 min, second: day 0, mode 1, 1320 min, all other times disabled. (btw. ems RC35 uses 10 min per step) Why are the value/data for modes like |
The holiday modes hm1 .. hm5 are defined within rest-api:
3.hcMode:
AUTO_SAT is defined as same as Saturday .... whatever this is for during holidays
|
@MichaelDvP @proddy |
closing. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Since I am using ems-esp and km200 in parallel, I ask myself what would be the most efficient / elegant way to debug missing fields in ems-esp while triggering changes on km200.
My idea would be: Within a javascript code writing changes to km200 and analyzing the respective telegrams by "filtering the right ones" out of syslog.
What do you think or what would be the easiest way to identify the right telegram types and content.
The text was updated successfully, but these errors were encountered: