• terrypacker

    Brian,

    I replicated the closing of a websocket due to the ping/pong timeout and found that my system handles it gracefully without throwing that java.lang.IllegalStateException. The page stops updating but no errors are produced and I get the same log message about "Didn't receive Pong from Endpoint within..." I replicated this by making the Mango server delay to read the pong message.

    I'm wondering if your browser isn't sending the pong message... (This should happen automatically by most every browser and isn't something you need to code into your page)

    For yet more information on the connection failure you can add this to your log4j2.xml file

    <AsyncLogger includeLocation="true" name="org.eclipse.jetty.websocket.common.io" level="debug"/>
    

    Ah Ok I just got you latest post while drafting this. I'm posting it anyway since I put a little time into it and it could be helpful to someone else in the future.

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • terrypacker

    Thanks Brian,

    It looks like the ping/pong failure is the problem. The other messages are expected during normal operation.

    FYI on the status code meanings:

    Status Code 1001 (Going Away) - This is normal behavior when a page is navigated away from
    Status Code 1006 (No Close Frame) - Connection was terminated in an unclean way, it appears the socket was broken.

    I find it odd that 10s is not long enough to send/receive the messages so I'm thinking you have a network with packet loss. If you can I would suggest pinging the Mango server to see if that is correct. If not then perhaps increasing the env.properties value of

    web.websocket.pingTimeoutMs
    

    will help.

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • terrypacker

    Brian,

    Please Post/Send some of the DEBUG log messages generated when the websocket stops updating the page.

    In terms of settings you can change, the defaults in your env properties seem fine:

    # Ping timeout for response from browser
    web.websocket.pingTimeoutMs=10000
    #Time socket can be idle before being closed (ms)
    web.socketIdleTimeout=70000
    

    Basically the socket will ping/pong back and forth every 10s so that the 70s idle timeout is never hit. However if the ping/pong messages are lost the connection may be closed. That information should come out in the DEBUG messages.

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • terrypacker

    Brian,

    You could try adding this line to the classes/log4j2.xml file to enlighten us as to why/when they are closing. There is a debug log message anytime a point value web socket is closed explaining why.

    In the <Loggers> ... </Loggers> section add this logger:

    <AsyncLogger includeLocation="true" name="com.serotonin.m2m2.web.mvc.rest.v1.websockets.pointValue" level="debug"/>
    

    You will need to either reload the log4j configuration from the system setting page or restart Mango for the changes to take effect.

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • terrypacker

    I just thought of another possibility. Mango 3.x uses Log4J2 where previous versions of Mango used Log4j. If you have a log4j jar that is getting loaded it won't pickup the log42.xml configuration and would probably use some default of only printing to stdout.

    I would check your <ma-home>/lib folder and see if there are log4j and log4j2 jars.

    ls <ma-home>/lib/*log4j*
    

    This should list only these jars:

    lib/log4j-api-2.10.0.jar	lib/log4j-jcl-2.10.0.jar
    lib/log4j-core-2.10.0.jar	lib/log4j-slf4j-impl-2.10.0.jar
    

    posted in User help read more
  • terrypacker

    Assuming you didn't modify your startup scripts your logging configuration will be defined in this file:

    <ma-home>/classes/log4j2.xml
    

    This file defines where the logs are written to, perhaps this file is corrupt/missing or has been modified to write the logs into a folder that Mango does not have permission to write to.

    You should be able to startup mango and see the output on the console, I'm pretty sure in 3.4 if you do this:

    sudo su <mango-user>
    cd <ma-home>
    ./bin/ma.sh start
    

    you will see the output in the console and potentially see error messages about the logging system.

    posted in User help read more
  • terrypacker

    @CraigWeb I agree and actually right after I made my previous post took a deeper look into what is going on with the internals of our Units library. I think something isn't working quite right with our Unit Aliases so I opened this issue:

    https://github.com/infiniteautomation/ma-core-public/issues/1331

    posted in User help read more
  • terrypacker

    @craig, In the Mango code we have implemented Aliases for VAR and VA which correspond to Volts x Amps. Since VAR is a measure of a 'type' of Power my understanding is that it is still basically Volts x Amps. If you want to convert your point's values to another Unit they need to be based on derived units that are supported by our library so VAR = V*A. If you don't need to convert this value to another type of unit for display then as @CraigWeb says, just use a suffix.

    posted in User help read more
  • terrypacker

    This part of the source was left for legacy reference but is not intended to be updated. If you import the repository as an Eclipse project you will see that this folder is not on the build path.

    posted in BACnet4J general discussion read more