Webserver (WIZ810MJ) component
Posted: Sun Aug 20, 2017 8:56 am
Hi All,
I need a help. I created an example app using the Webserver component:
The application utilizes 8 physical buttons to toggle the LED states on and off. This is possible on a physical panel as well by using the WEB page.
The goal is to show the update of the LED on the web independently and also to be able to flip the lights from the web. I succeeded more or less, so I need your help to improve in particular the web part.
I believe there are a few issues (potentially bugs) with the WIZ810MJ webserver component in Flowcode7. Not sure if I'm doing something wrong or indeed there is a bug. I spent quite a time by trying to debug this and I decided to seek your help.
Please find attached Flowcode app. The 3D panel has only 4 groups of components:
8x Switches (individual)
8x LED (array)
1x LCD
1x Webserver
The application has a web page (which is really clumsy if you have any improvement suggestions you are very much welcome).
Please note that the status background for SW5,6,and 7 is not working (the code is not updating the %x parameters). This are black as incorrect value is in the HTML. Have a look for problem description bellow. So in general terms, the concept is working but there are a few issues:
1. The SetOutValue function is working for index from 0, 1, 2, 3, 4 only. Any index over 4 is creating interference. Like index 5 will override the 0.
My code in "Set_WEB_Button_color" jumps to end after doing indexes from 0-4. You can comment this out, so to see the problem. Not sure if this is a feature or a bug. I would expect at least 16 indexes to be available to create any decent web page.
2. The GetInValue keeps the last received value for ever. In my example, this is a problem since the button controls should arrive on each click of the button. So if the same button is pushed more than once, there is no way for an application to determine. I created a lock mechanism so the WEB control is executed only once (until changes it). However, this would prevent to toggle the same button. Another button needs to be pushed in order to get change. Kind of workaround was in web page java script to have different (neutral) value when the page is refreshed: location.href = "?0=SW8". My used data are from SW0 - SW7 and SW8 are not used. I'm not HTML nor JS expert, so to find this solution (as I coded for the webpage) it took me a lot of digging around and trial and error.
3. A smooth WEB refresh solution. I know this has nothing to do with flow code, but it is a struggle to get a basic. I believe having some buttons to push or submit some value and have a real-time update from the device is something that is really expected with today's (other) web technology in place. If anyone can provide some input and make the page refresh to go smoothly it would be really good. I'm sure it would help many people (like me). It would be really good if such "web page code builder" is part of the Flowcode to match the capability of the simple web server. Perhaps the AJAX parsing could be implemented in future components?
I would appreciate any suggestions and solution which you may have to get this all going as I originally intended.
Regards,
Igor
I need a help. I created an example app using the Webserver component:
The application utilizes 8 physical buttons to toggle the LED states on and off. This is possible on a physical panel as well by using the WEB page.
The goal is to show the update of the LED on the web independently and also to be able to flip the lights from the web. I succeeded more or less, so I need your help to improve in particular the web part.
I believe there are a few issues (potentially bugs) with the WIZ810MJ webserver component in Flowcode7. Not sure if I'm doing something wrong or indeed there is a bug. I spent quite a time by trying to debug this and I decided to seek your help.
Please find attached Flowcode app. The 3D panel has only 4 groups of components:
8x Switches (individual)
8x LED (array)
1x LCD
1x Webserver
The application has a web page (which is really clumsy if you have any improvement suggestions you are very much welcome).
Please note that the status background for SW5,6,and 7 is not working (the code is not updating the %x parameters). This are black as incorrect value is in the HTML. Have a look for problem description bellow. So in general terms, the concept is working but there are a few issues:
1. The SetOutValue function is working for index from 0, 1, 2, 3, 4 only. Any index over 4 is creating interference. Like index 5 will override the 0.
My code in "Set_WEB_Button_color" jumps to end after doing indexes from 0-4. You can comment this out, so to see the problem. Not sure if this is a feature or a bug. I would expect at least 16 indexes to be available to create any decent web page.
2. The GetInValue keeps the last received value for ever. In my example, this is a problem since the button controls should arrive on each click of the button. So if the same button is pushed more than once, there is no way for an application to determine. I created a lock mechanism so the WEB control is executed only once (until changes it). However, this would prevent to toggle the same button. Another button needs to be pushed in order to get change. Kind of workaround was in web page java script to have different (neutral) value when the page is refreshed: location.href = "?0=SW8". My used data are from SW0 - SW7 and SW8 are not used. I'm not HTML nor JS expert, so to find this solution (as I coded for the webpage) it took me a lot of digging around and trial and error.
3. A smooth WEB refresh solution. I know this has nothing to do with flow code, but it is a struggle to get a basic. I believe having some buttons to push or submit some value and have a real-time update from the device is something that is really expected with today's (other) web technology in place. If anyone can provide some input and make the page refresh to go smoothly it would be really good. I'm sure it would help many people (like me). It would be really good if such "web page code builder" is part of the Flowcode to match the capability of the simple web server. Perhaps the AJAX parsing could be implemented in future components?
I would appreciate any suggestions and solution which you may have to get this all going as I originally intended.
Regards,
Igor