• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    RFLink message not decoded due to NumberFormatException: Infinite or NaN

    Troubleshooting
    2
    3
    157
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      zoomx last edited by

      Hello,
      I have a MyController installation on a RaspberryPi
      Version 1.5.0
      Database schema revision
      1.04.06 - 2018 Dec 04
      Database type
      H2 database embedded

      Java virtual machine specification

      VM vendor
      Oracle Corporation
      VM name
      Java HotSpot(TM) Client VM
      VM version
      1.8.0_241-b07
      Java home
      /opt/jdk1.8.0_241/jre

      I get this error only in WINDIR WINGS message
      for example this message

      20;4e;Alecto V1;ID=0005;WINDIR=0012;WINGS=001c;BAT=OK;\r
      

      I get this error
      2020-05-02 17:20:14,053 ERROR [Thread-26] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:201] Exception, RawMessage:[20;4e;Alecto V1;ID=0005;WINDIR=0012;WINGS=001c;BAT=OK;\r]
      java.lang.NumberFormatException: Infinite or NaN
      at java.math.BigDecimal.<init>(BigDecimal.java:898)
      at java.math.BigDecimal.<init>(BigDecimal.java:875)
      at org.mycontroller.standalone.utils.McUtils.getDoubleAsString(McUtils.java:106)
      at org.mycontroller.standalone.utils.McUtils.getDoubleAsString(McUtils.java:117)
      at org.mycontroller.standalone.provider.rflink.RFLink.getPayload(RFLink.java:112)
      at org.mycontroller.standalone.provider.rflink.RFLink.getPayload(RFLink.java:116)
      at org.mycontroller.standalone.provider.rflink.MessageParserRFLink.get(MessageParserRFLink.java:198)
      at org.mycontroller.standalone.provider.rflink.MessageParserRFLink.getMessage(MessageParserRFLink.java:130)
      at org.mycontroller.standalone.provider.rflink.MessageParserRFLink.getMessage(MessageParserRFLink.java:39)
      at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:170)
      at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
      at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
      at java.lang.Thread.run(Thread.java:748)

      It happens only with this message, RAIN, TEMP & HUM and WINSP are decoded.

      skywatch 1 Reply Last reply Reply Quote 0
      • skywatch
        skywatch @zoomx last edited by skywatch

        @zoomx
        I guess that WINSP = windspeed and that WINDIR = wind direction and WINGS = wind ground speed. Is that right?

        If you connect the node to a PC and view data sent via arduino serial monitor what does it show for those values?

        I had issues with DHT11 sensor which occasionally gave a NAN for a reading. I solved this by testing for NAN in the node sketch and not transmitting the value if NAN was detected.

        The full code of your node would help.

        1 Reply Last reply Reply Quote 0
        • Z
          zoomx last edited by zoomx

          I opened an issue in github also.

          RFlink protocol is here

          http://www.rflink.nl/blog2/protref

          The error message is referred to the message show above, this one
          20;4e;Alecto V1;ID=0005;WINDIR=0012;WINGS=001c;BAT=OK;\r

          20 mean a messagr from RFlink
          4e is the message number
          ID is the sensor ID
          WINDIR is the wind direction
          WINGS is the wind speed gust

          Al messages are in ASCIII, there is not any NaN or strange values like the DHT ones.

          It happens with all WINDIR messages, no one is decoded.

          Data are captured and decoded from a meteo station sensors at 433MHz

          But you give me a good suggestion, maybe there is a character in message not printed in the error, so I will check on a PC in HEX also.

          Edit: Check done, all ascii chars plus CR+LF at the end

          I don't understand why this happens on this message and not with others.
          I watched on my controllers code and I don't see any bug.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          0
          Online

          647
          Users

          506
          Topics

          3.3k
          Posts

          Copyright © 2015-2022 MyController.org | Contributors | Localization