You are not logged in.
Pages: 1
Topic closed
Hi,
I am developing a solar heating controller using Rpi with UniPi expansion board with 1-wire temperature sensors, running wheezy Raspian.
I am trying to display the value of one of the OMI sensors in the HMI but cannot get it to work, I have taken the simple pool automation example and modified the controls section of index.html as follows:
var status = {
column: 2,
title: 'Temperatures',
rows: [
{alias: 'Tstock_Top', desc: 'TStock_top', cstring: 'thermostat_task.OWS_Stock_temperature:value', type: 'R', color_true: 'green'},
]};
After downloading this file to the RPi I can load the resulting web page but do not get any value displayed for temperature.
I have tried different values for the "type" field but nothing seems to work.
I also note that, even though the page is loaded from the RPi, on the top right side of the displayed web page there is a message:
"19:54:44 Connecting to WS server (ws://192.168.20.240/rex) failed!"
I cannot seem to find any relevent logs on the RPi or documentation that would allow me to troubleshoot this problem, any tips you can give would be very helpful.
Thanks
Offline
Hello,
thank you for your question.
As you have mentioned you are extending Pool automation example - did you make it work successfully? I would start with this.
However, it is not possible to monitor I/O flags in current release version (2.10.8). It is already implemented in new version which is about to be released. For now you can use simple workaround - connect e.g. GAIN function block to the output of the "OWS__Stock_temperature" flag and in HMI monitor input to the GAIN block with following:
var status = {
column: 2,
title: 'Temperatures',
rows: [
{alias: 'Tstock_Top', desc: 'TStock_top', cstring: 'thermostat_task.GAIN_Stock_temperature:u', type: 'AR'},
]};
Note that the type is set to 'AR' - analog read.
Plase, be sure to name all I/O flags with double underscore just behind the driver prefix - e.g. OWS__Temperature. Connection string in your code has only one - I guess it's typo.
If I can be of assistance, please do not hesitate to contact me.
Cheers, Tomas
Offline
Tomas,
Thank you for your quick reply, I made the changes you suggested but unfortunately I still do not get any value displayed for temperature.
Next, to eliminate my code I downloaded the complete Pool automation example to the RPi and when connecting to the HMI in the pool monitoring block I see "NaN" in place of the expected values. (RexView shows correct values...)
I also still see the following alert on the top right of the page. "12:00:25 Connecting to WS server (ws://192.168.20.240/rex) failed!" so I suspect a problem with websocket on my RPi. The package is installed, and restarting "rexwstcp" does not help and does not show any obvious errors... Any idea where to check next?
Thanks
Offline
It seems that the problem is not in your code but somewhere in the websocket connection.
Is it possible for you to connect monitor to your Raspberry and run webbrowser in desktop with address: 127.0.0.1? Do you still get the same error?
Do you have another webserver installed on your Raspberry? (e.g. Apache).
Cheers, Tomas
Offline
Hi Tomas,
I couldn't connect a monitor to the RPI as I run without a GUI.
So I decided to start with a clean solution and completely reinstalled Raspbian (Jessie lite) and all Rex related modules on the Rpi, it still didn't work!
Eventually after much debugging I have found that the issue is related to which web browser is used on the host computer...
- Firefox V48 on W10 does not work
- Chrome V52 on W10 works OK
- Default Internet browser on Android does not work
- Firefox on Android works OK
In the case where it does not work, the page loads with all the static elements but none of the dynamic content is displayed (not even the Time!).
If I have time I will try to debug further to see where the problem lies...
Thanks for your help so far.
Offline
Hi,
thank you for your detailed debug report.
I also made few tests with Pool Automation example on Win 10 and Rex 2.10.8 with following results:
Firefox V48.0.2 - OK
Chrome V52.0.2743.116 m - OK
Edge V25.10586.0.0 - OK
Raspbian Jessie + Epiphany Web V3.8.2 - OK
If the dynamic content isn't displayed it means that the browser can't connect to the Websocket server. The Time is therefore some kind of signalization of good connection.
We are currently finalizing new version of REX Control System which integrates our own Websocket server and many other features and bug fixes.
I would focus on some "security" features settings of the browsers itselves.
Cheers, Tomas
Offline
Tomas,
You were correct about the security features, at least for Firefox on W10. The problem was caused by the "Google Analytics Opt-out Browser Add-on" module that I had installed, (the official module supplied by Google) which seems to block the connection to the websocket server.
I don't see why it should block a connection to a "local" server, but when I disactivate it everything works perfectly.
Lets close this ticket so we can both get on with something more useful ;-)
Thanks for all your help.
Offline
You are welcome. I'm glad I could be of assistance.
Thank you for your time spend with investigation of this issue.
Let me know if I can do anything else for you.
Cheers, Tomas
Offline
Pages: 1
Topic closed