Point values stop being returned by server (using latest dashboard module)
-
Hi,
Have noticed a problem where a mango instance stops displaying point values (by XID). This causes intermittent failure of a dashboard app (as it cannot present current values). Restarting the mango server instance fixes the issue (until it occurs again). The problem can be reproduced via the 'mdAdmin' Custom Dashboard example:
http://mangohost/modules/dashboards/web/mdAdmin/#/dashboard/examples/basics/get-point-by-xid
When selecting XID for points which do exist in the instance, where mango shows a value when you view it in the data points view, no value is presented by the angular material dashboard. The point name and details can be seen, but the value doesn't appear. The following network calls can be seen:
http://mangohost/rest/v1/data-points/DP_HP-POD-004_9867690 (status 200)
ws://pod.energymadeclean.com:8080/rest/v1/websocket/point-value (status 101)
then another entry to indicate the following is finished:
ws://pod.energymadeclean.com:8080/rest/v1/websocket/point-value (status 'finished')However no value is rendered.
Have tried to log out and back into mango (using the admin account) but the issue persists. Restarting the mango instance fixes the problem (for a while) - until it occurs again.
Is there a known problem with the mango instance and the web-socket point values not being returned after some time? There is no entry in the ma.log file which corresponds with the failure. Are there other locations to look for an error message?
Snippet which reproduces the problem (when it is occurring):
--
<!-- Display a point value using only its XID -->
<!-- Get a point (and value) using its XID and assign it to an output variable "myPoint" -->
<!-- example XIDs for points which do display current values in mango -->R06-LI0073
DP_HP-POD-004_9867690<ma-get-point-value point-xid="DP_HP-POD-004_9867690" point="myPoint"></ma-get-point-value>
<p>The point name is "{{myPoint.name}}" and its value is "{{myPoint.renderedValue}}".</p>
<!--
<span>
{{myPoint | json}}
</span>
-->Regards,
Tim -
It sounds like the websockets are not working which could likely be caused if you are using a proxy that's not configured for it. Can you share how you have the URL being directed to Mango. We use Apache with a virtual site to act as a proxy and had issues getting the websockets to work.
Here are some general instructions we put together that might be helpful:
-
Login to VPN server and enable Websocket proxy module in Apache (just has to be done once, don’t need to do it every time):
a2enmod proxy_wstunnel -
Go to Apache websites configuration directory:
cd /etc/apache2/sites-available -
Backup the website config file you want to set for Websocket proxy:
cp -pr <yourwebsite>.conf{,.bak}
Where <yourwebsite> - is the name of config file, usually the same with website name. -
Edit the file <yourwebsite>.conf in your favourite editor and add below text:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.) ws://<Mango_IP>/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.) http://<Mango_IP>/$1 [P,L]
Where <Mango_IP> - is the IP address of a Mango device to which you configured ProxyPass. -
Reload Apache configuration:
service apache2 reload
-