Closed WombatHollow closed 5 years ago
Further progress on this bug. It is very closely related to #24 (not #25 as in above text) and fixing #24 may well fix #26 partially. But it is #26 behaviour that has highlighted the #25 bug as in the UI rather than node.
As a result when you open the web page it will display a gray button and the node does not inform the UI what colour it should be so it remains gray. But the node thinks it is Green (stored value) so when it gets an update to stay Green the node thinks no change and does not inform the UI (which is still gray).
If the Node gets a new value, then the UI LED updates to the correct colour and all stays in sync unless you navigate awy from the page and back again.
Pressing refresh /reload for the page does result in correctly displayed page.
{what is different between reload, and navigating to the page?}
Temporary Fix
Recommendation:
Mandatory. The values for the LED UI must be sent to the page whenever you navigate to it.
Desirable. As UI value is only changed on change, there is a risk that a value update is lost between the node and UI, in which case Node value will be different to UI value and nothing to inform this mismatch. maybe UI value should be updated on change or at least every xx seconds (user set?)
I will have a look at the LED NODE code to see if I can see a fix but I am a novice with HTML and related coding. (C++ and assembler were my thing).
First off, thanks so much for the comprehensive report! Especially your second post, it clues me into what you're seeing and how I can reproduce it. I'll follow up once I've had a chance to do just that!
I have not been able to reproduce this issue using the following steps:
I may be missing something but is that where the colors should be inconsistent? For me they are appropriately set, even if I close the browser altogether and open it again. Can you clarify if I've missed a step? I'm committing the example I'm working off of into the repo as a baseline for people to work off of.
@WombatHollow sorry, I missed your specifying that this was for LEDs in tabs, I've started documenting the issue and work on it in #29
I've pushed a fix to the branch https://github.com/Adorkable/node-red-contrib-ui-led/tree/feature/tabsUpdateBug , if you have a chance please give it a try and see if this fixes the issue for you without introducing new ones ;)
Otherwise I'll push the update in the next few days!
Sorry, I have been out of the loop for over a month so did not get a chance to develop a flow. Next week I should get back to this and will test the updated flow, if problem still exists I will envelope a sandpit to demonstrate it at it’s simplist.
I do see someone else reporting the same on MR forum (albeit their description is somewhat convoluted and been distracted by other issues.
Ian H
From: Ian G notifications@github.com Sent: Saturday, 27 April 2019 2:41 AM To: Adorkable/node-red-contrib-ui-led node-red-contrib-ui-led@noreply.github.com Cc: WombatHollow ian_harrison@bigpond.com; Mention mention@noreply.github.com Subject: Re: [Adorkable/node-red-contrib-ui-led] LED will not display LED status sometimes even though valid msg is being sent. (#26)
I've pushed a fix to the branch https://github.com/Adorkable/node-red-contrib-ui-led/tree/feature/tabsUpdateBug , if you have a chance please give it a try and see if this fixes the issue for you without introducing new ones ;)
Otherwise I'll push the update in the next few days!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Adorkable/node-red-contrib-ui-led/issues/26#issuecomment-487122394 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGDP7BVG3BMRLOGSIW64C5LPSMWCFANCNFSM4G2ZDCEQ . https://github.com/notifications/beacon/AGDP7BXPYQSBOYAABA7L6JTPSMWCFANCNFSM4G2ZDCEQ.gif
I've pushed the fix to master and version 0.2.2
, when you get around to it let me know if that works. Cheers!
Thanks for the update to LED Node but the behavior of the LED being gray when you switch to the UI page remains.
Using 0.2.2 of the Node I have produced a small NR flow (attached below) that demonstrates this issue.
Load the Flow and open the ui to the LED page, the LED is gray (ok if it was never set). Press any of the three buttons ({red, green, blue} and the LED changes as required. Note what colour you last set the LED (lets use {red} for simplicity of this description.
switch to the other ui page, there is a single LED which is gray. Refresh the page and the LED changes to RED.
Switch back to the LED page and the LED is back to gray. Press {red} button and it remains gray!
Now press any other colour button and the LED changes, now press {red} button and the LED is RED.
There is a problem in that the when you switch to a page with a LED, it does not display the colour it was last set to. But also if you now set it to the colour it should be, it still does not display the right colour, like it knows the LED should be RED and you have sent a message to be RED but as it is already meant to be RED it does not update the display. There is a disconnect between colour the node has as current value, and current colour displayed.
[{"id":"bbdde3b2.3f209","type":"tab","label":"LED_ui anomoly","disabled":false,"info":""},{"id":"d092cde3.8ee41","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"30075472.2b89bc","type":"ui_tab","z":"","name":"LED","icon":"dashboard","order":2,"disabled":false,"hidden":false},{"id":"1e4e4b5e.b9bc35","type":"ui_group","z":"","name":"Left","tab":"30075472.2b89bc","order":1,"disp":true,"width":"6","collapse":false},{"id":"969fdbf4.e81328","type":"ui_group","name":"Group 1","tab":null,"order":1,"disp":true,"width":6},{"id":"ad259227.37693","type":"ui_tab","z":"","name":"Other Group","icon":"dashboard","order":2,"disabled":false,"hidden":false},{"id":"a8ee9132.538af","type":"ui_group","z":"","name":"nothing much","tab":"ad259227.37693","order":1,"disp":true,"width":"6","collapse":false},{"id":"176bc74a.aae159","type":"ui_led","z":"bbdde3b2.3f209","group":"1e4e4b5e.b9bc35","order":1,"width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"red","valueType":"str"},{"color":"green","value":"green","valueType":"str"},{"color":"blue","value":"blue","valueType":"str"}],"name":"","x":616,"y":368,"wires":[]},{"id":"2f499cf0.5b5674","type":"ui_button","z":"bbdde3b2.3f209","name":"red","group":"1e4e4b5e.b9bc35","order":2,"width":0,"height":0,"passthru":false,"label":"Red","tooltip":"","color":"red","bgcolor":"","icon":"","payload":"red","payloadType":"str","topic":"","x":428,"y":319,"wires":[["176bc74a.aae159","18e58d70.223cb3"]]},{"id":"8947abc1.8c4628","type":"ui_button","z":"bbdde3b2.3f209","name":"blue","group":"1e4e4b5e.b9bc35","order":3,"width":0,"height":0,"passthru":false,"label":"Blue","tooltip":"","color":"blue","bgcolor":"","icon":"","payload":"blue","payloadType":"str","topic":"","x":429,"y":383,"wires":[["176bc74a.aae159","18e58d70.223cb3"]]},{"id":"64229c7.5c22264","type":"ui_button","z":"bbdde3b2.3f209","name":"green","group":"1e4e4b5e.b9bc35","order":4,"width":0,"height":0,"passthru":false,"label":"Green","tooltip":"","color":"green","bgcolor":"","icon":"","payload":"green","payloadType":"str","topic":"","x":426,"y":437,"wires":[["176bc74a.aae159","18e58d70.223cb3"]]},{"id":"18e58d70.223cb3","type":"ui_led","z":"bbdde3b2.3f209","group":"a8ee9132.538af","order":1,"width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"red","valueType":"str"},{"color":"green","value":"green","valueType":"str"},{"color":"blue","value":"blue","valueType":"str"}],"name":"","x":616,"y":429,"wires":[]}]
This flow was developed on NR 0.20.3 running on W10 (latest) and the ui viewed using Chrome (latest), and Edge with same effect. Behavior also seen on NR 0.20.2 on a RasPi and the ui viewed over Chrome on W10 and Chrome on android (8 and 9).
A minor addition to above. If you open Chrome, select a new tab and enter the address like "http://127.0.0.1:1880/ui" the assuming NR has not been restarted since last seting a LED light, the LED colour is correct....until you switch NR ui pages (not talking about Chrome tabs)
Perfect, thanks so much for posting this @WombatHollow , when I get home I'll try to reproduce!
I was able to reproduce it exactly as you described, I'll take a crack at figuring out what's going on hopefully today or tomorrow :)
😣I feel brainless, the fixes didn't make it into 0.2.2!
I just pushed 0.2.3 WITH the changes, please give that a try, your example worked with it for me.
Hah! I know what you mean. After all the smart stuff of coding and verification, you trip up on a 'simple' configuration management step.That said, having worked on very large software intensive systems, configuration management is anything but simple.ThanksIanOn 8 May 2019 06:16, Ian G notifications@github.com wrote:😣I feel brainless, the fixes didn't make it into 0.2.2!
I just pushed 0.2.3 WITH the changes, please give that a try, your example worked with it for me.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
Describe the bug Even when the LED are displayed correctly on another computer (same OS and Browser), when you open on a new browser the LED stay grey even though there is valid data being received. This does not occur all the time, it appears to be random although once not working it stays not working despite closing navigating away and back to page and then starts working again. (but not always) I have had same page open on multiple tabs and in multiple browsers and on multiple PCs. one tab (that has been open a while and is working) is good, the rest have grey LEDs . see picture Now one LED has a 'Slow" (yellow) sent to it every 6 seconds and the regular service ("NAS" which is "Good" (green) sent every 10 seconds. This appears to always work (flashes between green and yellow) reliability, but a seperate LED that gets the same NAS derived message stays grey usually (not green). Another LED I added a UI button that sends "Down" (Red) whilst the LED Node is also getting regular 60 second messages from its source (Ping to a server, reports "Good"). It starts grey on navigating page and stays grey even after 60 seconds (ensures at least on message sent). I press the button and LED turns Red then within 60 seconds it changes to green! Starts to work properly. Occasional a LED will start to work!
To Reproduce I have pasted part of my flow below but this problem does appear whole flow wide....I tried to setup a sandpit to replicate problem (with several LEDs Nodes) and problem went away, few days later it reappeared.
Expected behaviour LED should display colour from message sent to it
Screenshots If applicable, add screenshots to help explain your problem See picture attached, Chrome and Edge showing different data (NB Edge could have been anther Chrome tab but will still display faulty .
Desktop (please complete the following information): OS: W10 (also seen on Android 9 and 8) Browser: Chrome (on droid and W10), Edge, IE Versions: Node-Red, W10 and Browsers all at latest version
Additional context THis is seperate from issue #25 where LEDs are grey when HTML page is opened until first message rx by node. #25 always happens, this issue sometimes happen and but once work appears to keep working until a ne page is opened (in another Tab, browser or Computer) but at other times it behaves normally.
Partial Flow
[{"id":"1e97aa16.e7a2f6","type":"ping","z":"12f44cb5.337193","name":"Weather Station ping","host":"10.0.0.171","timer":"60","x":140,"y":700,"wires":[["9f4c83d2.45f0d","a0df4b97.af7eb8"]]},{"id":"1efbff35.ac9cb1","type":"ping","z":"12f44cb5.337193","name":"Pool ping","host":"10.0.0.235","timer":"60","x":180,"y":660,"wires":[["9f4c83d2.45f0d","72fd4af2.61d874"]]},{"id":"2429bf0d.3aa6d","type":"ping","z":"12f44cb5.337193","name":"ShedCam ping","host":"10.0.0.100","timer":"60","x":160,"y":740,"wires":[["9f4c83d2.45f0d","bf23c9c0.d69fe8"]]},{"id":"54816b44.798704","type":"ping","z":"12f44cb5.337193","name":"WebBox ping","host":"10.0.0.122","timer":"60","x":170,"y":820,"wires":[["9f4c83d2.45f0d","b1857f1d.e1168"]]},{"id":"e536138c.3ed4f","type":"ping","z":"12f44cb5.337193","name":"Heating ping","host":"10.0.0.204","timer":"60","x":170,"y":780,"wires":[["9f4c83d2.45f0d","c2757a08.fb93e8"]]},{"id":"9f4c83d2.45f0d","type":"change","z":"12f44cb5.337193","name":"AddTopic","rules":[{"t":"change","p":"topic","pt":"msg","from":"10.0.0.","fromt":"str","to":"Ping","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"9999","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":500,"wires":[["21a8d4ed.0fa2bc"]]},{"id":"21a8d4ed.0fa2bc","type":"rbe","z":"12f44cb5.337193","name":"Change>0.5 mSec","func":"deadband","gap":"0.5","start":"","inout":"out","property":"payload","x":640,"y":500,"wires":[["6730fc64.9e7824"]]},{"id":"6d773d88.1a3994","type":"ping","z":"12f44cb5.337193","name":"Vege Patch ping","host":"10.0.0.242","timer":"10","x":160,"y":620,"wires":[["9f4c83d2.45f0d","8816e835.675368"]]},{"id":"2ed0af50.2b067","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":4,"label":"VegePatch","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"VegePatch LED","x":660,"y":620,"wires":[]},{"id":"8816e835.675368","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":620,"wires":[["2ed0af50.2b067","62b5b4b3.dda95c"]]},{"id":"c163e6b1.9913f8","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":3,"label":"Pool","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"Pool LED","x":640,"y":660,"wires":[]},{"id":"72fd4af2.61d874","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":660,"wires":[["c163e6b1.9913f8"]]},{"id":"5c337833.b83eb8","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":8,"label":"Weather","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"Weather LED","x":660,"y":700,"wires":[]},{"id":"a0df4b97.af7eb8","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":700,"wires":[["5c337833.b83eb8"]]},{"id":"ffb64c06.b44da","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":7,"label":"ShedCam","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"ShedCamLED","x":660,"y":740,"wires":[]},{"id":"bf23c9c0.d69fe8","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":740,"wires":[["ffb64c06.b44da"]]},{"id":"7909d473.bfd9cc","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":6,"label":"Heating","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"Heating LED","x":650,"y":780,"wires":[]},{"id":"c2757a08.fb93e8","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":780,"wires":[["7909d473.bfd9cc"]]},{"id":"fd39548c.8e1598","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":5,"label":"Sunny Webbox","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"WebboxLED","x":650,"y":820,"wires":[]},{"id":"b1857f1d.e1168","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":820,"wires":[["fd39548c.8e1598"]]},{"id":"f6a9be43.87815","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":2,"label":"NAS","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"yellow","value":"Slow","valueType":"str"}],"name":"NAS LED","x":640,"y":540,"wires":[]},{"id":"38f49c90.d77554","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":540,"wires":[["f6a9be43.87815","1ce82bd0.f41234","ec2bc2e7.8f555"]]},{"id":"975e0569.1d0b38","type":"ping","z":"12f44cb5.337193","name":"Router ping","host":"10.0.0.001","timer":"60","x":150,"y":580,"wires":[["4c1a3167.6b6a1"]]},{"id":"681f8993.420f88","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":1,"label":"Router","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"yellow","value":"Slow","valueType":"str"}],"name":"Router LED","x":650,"y":580,"wires":[]},{"id":"4c1a3167.6b6a1","type":"change","z":"12f44cb5.337193","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = false)? \"Down\" : (payload >2.0) ? \"Slow\" : \"Good\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":580,"wires":[["681f8993.420f88"]]},{"id":"a2b6682d.639468","type":"ui_button","z":"12f44cb5.337193","name":"set to Down","group":"996b46f6.ffc338","order":9,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"just press me","color":"","bgcolor":"","icon":"","payload":"Down","payloadType":"str","topic":"","x":450,"y":880,"wires":[["fd39548c.8e1598"]]},{"id":"62b5b4b3.dda95c","type":"ui_led","z":"12f44cb5.337193","group":"c2749915.2e3758","order":4,"label":"VegePatch","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"Yellow","value":"Slow","valueType":"str"}],"name":"VegePatch LED","x":900,"y":620,"wires":[]},{"id":"c6481e37.87eeb","type":"inject","z":"12f44cb5.337193","name":"","topic":"","payload":"Slow","payloadType":"str","repeat":"6","crontab":"","once":false,"onceDelay":0.1,"x":870,"y":520,"wires":[["ec2bc2e7.8f555","1ce82bd0.f41234"]]},{"id":"1ce82bd0.f41234","type":"ui_led","z":"12f44cb5.337193","group":"996b46f6.ffc338","order":4,"label":"{{msg.payload}}","colorForValue":[{"color":"red","value":"Down","valueType":"str"},{"color":"green","value":"Good","valueType":"str"},{"color":"yellow","value":"Slow","valueType":"str"}],"name":"","x":1070,"y":560,"wires":[]},{"id":"ec2bc2e7.8f555","type":"debug","z":"12f44cb5.337193","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":480,"wires":[]},{"id":"996b46f6.ffc338","type":"ui_group","z":"","name":"Status","tab":"4fcb4fe9.d6391","order":2,"disp":true,"width":"6","collapse":false},{"id":"c2749915.2e3758","type":"ui_group","z":"","name":"Manual Control","tab":"15398257.058b8e","order":1,"disp":true,"width":"6","collapse":false},{"id":"4fcb4fe9.d6391","type":"ui_tab","z":"","name":"Network","icon":"usb","order":4},{"id":"15398257.058b8e","type":"ui_tab","z":"","name":"Irrigation","icon":"fa-tint","order":2}]