banny310 / hoymiles-dtu

Get solar data using direct communication with Hoymiles DTU
1 stars 2 forks source link

DTU-Pro v2 - Message missing required fields #1

Closed sakrut closed 1 year ago

sakrut commented 1 year ago

HI. my stuff:

Current settings of meter is "Manage energy" to allow presents values on Hoymiles app. so RS485 is off

PS. DTU have software v2 where i can't have acces to DTU by http

ERROR | 2023-03-10 09:03:42 | [pool-2-thread-1] infrastructure.App$1 (App.java:49) - Exception: java.lang.reflect.InvocationTargetException
io.netty.handler.codec.DecoderException: java.lang.reflect.InvocationTargetException
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:480) ~[app.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[app.jar:?]
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[app.jar:?]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[app.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[app.jar:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[app.jar:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[app.jar:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[app.jar:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[app.jar:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[app.jar:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[app.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[app.jar:?]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[app.jar:?]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[app.jar:?]
    at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at com.hoymiles.infrastructure.dtu.DtuMessageHandler.fromByte(DtuMessageHandler.java:66) ~[app.jar:?]
    at com.hoymiles.infrastructure.dtu.DtuMessageDecoder.decode(DtuMessageDecoder.java:94) ~[app.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510) ~[app.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449) ~[app.jar:?]
    ... 21 more
Caused by: com.google.protobuf.InvalidProtocolBufferException: Message missing required fields: meterDatas[0].epTtb, meterDatas[0].epTtc, meterDatas[0].enTtb, meterDatas[0].enTtc
    at com.google.protobuf.UninitializedMessageException.asInvalidProtocolBufferException(UninitializedMessageException.java:79) ~[app.jar:?]
    at com.google.protobuf.AbstractParser.checkMessageInitialized(AbstractParser.java:68) ~[app.jar:?]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:191) ~[app.jar:?]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:203) ~[app.jar:?]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:208) ~[app.jar:?]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:48) ~[app.jar:?]
    at com.hoymiles.infrastructure.protos.RealDataNew$RealReqDTO.parseFrom(RealDataNew.java:1984) ~[app.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at com.hoymiles.infrastructure.dtu.DtuMessageHandler.fromByte(DtuMessageHandler.java:66) ~[app.jar:?]
    at com.hoymiles.infrastructure.dtu.DtuMessageDecoder.decode(DtuMessageDecoder.java:94) ~[app.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510) ~[app.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449) ~[app.jar:?]
    ... 21 more
sakrut commented 1 year ago

I setup whole vm machine for prepare git lab xD but change in code was easy. here is prepared image https://hub.docker.com/r/sakrut/hoymiles-dtu-amd64 PR:

2

sakrut commented 1 year ago

ok. See that all MeterMO props should be optiona (i check in app). I will try to figuraut this and enrich domain with this data