I am trying to work out a way of sending data to and receiving data from an HTML page using the WLAN module.
I have worked out how to send 4 individual Byte sized variables using the "Swap Variables" indexed 0-3 and that works fine. I need to be able to send String data of variable lengths to and from the server using the URL in the same way as the swap variables. Can this be done using the current macros available?
The application this is being used for is a home lighting and control system where a central control node has the wifi module and a series of sub nodes on a CAN bus are used to control the various lights (LED) around the house and garden. The lights are controlled either manually via the local nodes or centrally via the wifi node and an iPod, iPad or iPhone. Any changes made to light settings locally are then reported back to the central node using CAN bus messages. The central wifi node is responsible for maintaining tyhe system status which can then be reported to a wifi enabled device via an HTML page. To this end I need to be able to construct a reasonably detailed command string to send via an HTML page to the wifi node for onward distribution to the relevant node on the CAN bus.
At the moment I do this via the 4 swap variables but this limits what I can do.
Any ideas?
many thanks
Sefi+
WLAN module
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WLAN module
Hi Sefi,
The current code cannot handle strings at all. Saying this strings should be possible but you will have to use the custom code feature to play around with the WLAN component C code.
Have a play and see what you come up with. If you post up what you have so far then we can try and help you to get the mechanism working.
I believe the function that currently deals with the swap variables is the "Check_For_Page_Requests" function.
The current code cannot handle strings at all. Saying this strings should be possible but you will have to use the custom code feature to play around with the WLAN component C code.
Have a play and see what you come up with. If you post up what you have so far then we can try and help you to get the mechanism working.
I believe the function that currently deals with the swap variables is the "Check_For_Page_Requests" function.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 17
- Joined: Sat Sep 17, 2011 7:10 pm
- Location: Belgium
- Has thanked: 8 times
- Been thanked: 5 times
Re: WLAN module
Hi,
I'm currently adapting the webserver component of the Internet EB023-1 Internet E-Block to allgin it with the webserver component of the EB069 Wireless LAN E-Block.
The differences between EB023-1 and EB069 webserver I'm working on are :
- return value of the macro : (EB023-1 returns status while EB069 returns the page requested (finished)
- macro cal after analysing the requested page, before sending the reply page. It"s not supported by either component but i needed it and it's very simple to do (finished)
- swap in variables : EB023-1 does not support this, i've added the same functionality as supported by the WLAN webserver component (finished)
- swap in variables : not sure yet what to do...
The EB023 supports swap out variables by default, but in a different way as the WLAN does. Both methods with their pro and cons as usual.
For now, i have implemented the same swap in varible support in the modified EB023-1 webserver component as by default supported by the WLAN component.
However, depending on what i'll do to allign (or not) the swap out variables, i might very wel change the swap in variables for both components once more to align in and out swap methods.
At the same time I'm also considering to take this one step further and support different variable types (which is what you are after).
At this moment i'm not yet sure which direction to take for this. There are several options with pro and cons.
When ready (this might take a while), i'll post an example and will also create a suggestion to allign both components in some future release.
Meanwhile i confirm "Check_For_Page_Requests" is the place to look if you want to change something yourself in the WLAN webserver component regarding swap variables.
The analysis of recieved swap variables is taking place from line 68 to 99.
All this said, I'm not sure you need string variables to solve your problem. Your HTML pages can perfectly show text while the requests sent via the URL variables are byte.
Take a look at this peace of HTML used to test something similar as what you are doing :
<html>
<a href="index.htm">Main Page</a><br>
<a href="page2.htm?1=1">Licht ON</a><br>
<a href="page2.htm?1=2">Licht OFF</a><br>
<a href="page2.htm?1=3">Licht toggle</a><br>
</html>
This is showing URL text in the browser, but sending the request as numerical text string which is supported by the WLAN webserver component.
Regards,
Ivan
I'm currently adapting the webserver component of the Internet EB023-1 Internet E-Block to allgin it with the webserver component of the EB069 Wireless LAN E-Block.
The differences between EB023-1 and EB069 webserver I'm working on are :
- return value of the macro : (EB023-1 returns status while EB069 returns the page requested (finished)
- macro cal after analysing the requested page, before sending the reply page. It"s not supported by either component but i needed it and it's very simple to do (finished)
- swap in variables : EB023-1 does not support this, i've added the same functionality as supported by the WLAN webserver component (finished)
- swap in variables : not sure yet what to do...
The EB023 supports swap out variables by default, but in a different way as the WLAN does. Both methods with their pro and cons as usual.
For now, i have implemented the same swap in varible support in the modified EB023-1 webserver component as by default supported by the WLAN component.
However, depending on what i'll do to allign (or not) the swap out variables, i might very wel change the swap in variables for both components once more to align in and out swap methods.
At the same time I'm also considering to take this one step further and support different variable types (which is what you are after).
At this moment i'm not yet sure which direction to take for this. There are several options with pro and cons.
When ready (this might take a while), i'll post an example and will also create a suggestion to allign both components in some future release.
Meanwhile i confirm "Check_For_Page_Requests" is the place to look if you want to change something yourself in the WLAN webserver component regarding swap variables.
The analysis of recieved swap variables is taking place from line 68 to 99.
All this said, I'm not sure you need string variables to solve your problem. Your HTML pages can perfectly show text while the requests sent via the URL variables are byte.
Take a look at this peace of HTML used to test something similar as what you are doing :
<html>
<a href="index.htm">Main Page</a><br>
<a href="page2.htm?1=1">Licht ON</a><br>
<a href="page2.htm?1=2">Licht OFF</a><br>
<a href="page2.htm?1=3">Licht toggle</a><br>
</html>
This is showing URL text in the browser, but sending the request as numerical text string which is supported by the WLAN webserver component.
Regards,
Ivan