zivillian / ism7mqtt

GNU General Public License v3.0
61 stars 11 forks source link

System.InvalidOperationException: <direct-logon-response xmlns=''> was not expected. #136

Open mchrusto opened 1 month ago

mchrusto commented 1 month ago

Hello I am using ism7 with version 2.10, once I started addon for the very first time config file is created with out any problems - file is attached. Once addon is trying to restart using config file I am getting following error (see also attached log file):

Oct 10 21:25:37 Publishing HA Discovery info for ID Wolf
Oct 10 21:25:37 < <?xml version="1.0" encoding="utf-8"?><direct-logon-response state="ok" sid="1"><installationname>ISM7</installationname><serialnumber>d88039b74cda</serialnumber><date-time>2024-10-10T21:25:59</date-time><ism-softwareversion>210.46.1.5.2.1</ism-softwareversion><ism-hardwareversion>1.0</ism-hardwareversion><type>ISM7i</type></direct-logon-response>
Oct 10 21:25:37 System.InvalidOperationException: There is an error in XML document (1, 40).
Oct 10 21:25:37  ---> System.InvalidOperationException: <direct-logon-response xmlns=''> was not expected.
Oct 10 21:25:37    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTelegramBundleResp.Read6_tbres()
Oct 10 21:25:37    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
Oct 10 21:25:37    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Oct 10 21:25:37    --- End of inner exception stack trace ---
Oct 10 21:25:37    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
Oct 10 21:25:37    at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
Oct 10 21:25:37    at ism7mqtt.Ism7Client.Deserialize(PayloadType type, Stream data) in /app/ism7mqtt/ISM7/Ism7Client.cs:line 381
Oct 10 21:25:37    at ism7mqtt.Ism7Client.ReadPipeAsync(PipeReader source, CancellationToken cancellationToken) in /app/ism7mqtt/ISM7/Ism7Client.cs:line 190
Oct 10 21:25:37 System.Net.Sockets.SocketException (125): Operation canceled
Oct 10 21:25:37    at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
Oct 10 21:25:37    at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
Oct 10 21:25:37    at ism7ssl.Ism7SslStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in /app/ism7ssl/Ism7SslStream.cs:line 154
Oct 10 21:25:37    at ism7mqtt.Ism7Client.FillPipeAsync(PipeWriter target, CancellationToken cancellationToken) in /app/ism7mqtt/ISM7/Ism7Client.cs:line 145

I did try to clean everything and reinstall addon but I am getting always same error. What could be wrong here? Thx a lot for your support & regards

ism7-parameters-Wolf.json Wolf_ISM7_Home_Assistant Wolf_ISM7_Log.txt

mchrusto commented 1 month ago

Hello I did install ism7mqtt on linux machine and run with debug option - please see attached log file. Still getting error System.InvalidOperationException: was not expected. ism7mqtt.log Any idea why is this happening, I am also attaching parameter.json file that I did create parameter.json by ism7config , thank you for your support

zivillian commented 4 weeks ago

The log shows a second <direct-logon-response after ism7mqtt already received the first and sent the initial requests. It has the exact same timestamp, but is there a delay before the error occurs? Can you try again with a reduced parameter.json like this one?

{
  "TcpPort": 9092,
  "Devices": [
    {
      "ReadBusAddress": "0x35",
      "WriteBusAddress": "0x30",
      "DeviceTemplateId": 220000,
      "Parameter": [
        220032
      ]
    }
  ]
}

This should only report the time of the BM-2

mchrusto commented 4 weeks ago

Thx a lot, I did test it and yes this is working - as you wrote I am getting time of the BM-2. Here is the log file ism7mqtt.log

zivillian commented 4 weeks ago

Then you can try to readd the parameters until you get the error again - to me it looks like one of the parameters is causing this.

mchrusto commented 4 weeks ago

Thx a lot I did and did find out that the last section a parameters 360000 and above are creating this problem. Once I delete them from parameter.json things are working ok. What is actually behind 360000?

image

zivillian commented 3 weeks ago

DeviceTemplate 360000 belongs to MK_BM-2. The ParameterIds can be looked up in the ParameterTemplates.xml:

360000: Raumtemperatur
360001: Gemittelte Außentemperatur
360004: Anforderung Mischerkreis
...
360148: Starttemperatur VL Kühlkurve
360149: Endpunkt Kühlkurve
360150: Startpunkt Kühlkurve

Can you try to narrow it down to one (or some) parameters?