Page 1 of 2

WLAN Component

Posted: Sun Aug 18, 2013 3:17 pm
by Jordy101091
Hi all,

Im playing around with my WLAN module "WIZ610WI FW: 1.2.3" and I'm experiencing some trouble to get it to function properly.
The first thing I notices is:

*IP Address doesn't seem to have any effect when I connect to the wireless module by clicking on the SSID I cannot access this module by the IP address that I have specified. When I use the wizard application from wiznet, this tells me that the IP address and Gateway address is still the same as the factory settings

*SSID Broadcast if this option is set to "YES" the SSID doesn't show up in my wireless network list. When I set this to "No" the SSID shows up. So this doesn't work as it should be.

*The Data Rate does not take affect when I change this from lets say 54Mbps to 48Mbps my wireless scanning tool still tells me that the data rate is 54Mbps.


So I hope that the matrix team has some time to look into this.

Regards Jordy

Re: WLAN Component

Posted: Thu Aug 22, 2013 6:53 pm
by Jordy101091
rather than starting a new topic, I will post my next WLAN BUG or whatever its called: Typo, drastic failure :twisted: you give it a name. :wink:

So when Initialize the WLAN module (which is by-the-way not yet fixed) To make sure the user know that the component is properly initialized I want to read back some of the configurations such as the SSID and IP Address.

The datasheet tells me that the following command can be used to call the SSID this command is "<DS>" so in the sendcommand macro I fill in "<DS>" than after that I use the ReceiveIncoming to catch the SSID (atleast I Think) and sins this macro is the only macro with a string return value Im pretty shore that this is the macro that I need.

When I print the result on my GLCD which of course Ben has fixed :wink: I only see this "<S>" which means "Command successfully" I don't know whats wrong here so maybe the matrix staff can have A look at this problem with the WLAN Component.

Ore it just could be me that doesn't understand it hahaha wouldn't be the first time :lol:

Regards Jordy

PS. look in this macro "WiFi_Init"

Re: WLAN Component

Posted: Tue Aug 27, 2013 2:17 pm
by LeighM
Hi Jordy

Thanks for your feedback on this component. I have now had chance to look into the issues.

You are correct, the SSID Enable was setting the wrong state. I have now fixed this and updated the component, attached.

I see that in your test2 you have the initialisation in a loop whilst it returns non-zero, which is good, that usually fixes initialisation issues.

As for the responses, I think all that is needed to fix this is a delay (say a few seconds) between the SendCommand() and the ReceiveIncoming() to allow the response to be received into the buffer before you attempt to read it.

I checked that the data rate is set and read back with <DR> and this was OK, but I don’t currently have access to scanning tool to check the WIZnet output.

Please let me know if you have any other issues with it.
Thanks again.
Leigh

Re: WLAN Component

Posted: Tue Aug 27, 2013 7:09 pm
by Jordy101091
Thanks for your response, I was almost thinking of that the matrix team didn't noticed my problem :wink:

But I want to compile with the new component in my component library but the compile process to hex takes for every to complete,
Im almost waiting 5 minutes, and event after these 5 minutes it does not complete. Can you check this for me.

Regards Jordy

Re: WLAN Component

Posted: Tue Aug 27, 2013 7:28 pm
by medelec35
Hi Jordy,
Jordy101091 wrote:but the compile process to hex takes for every to complete,
Im almost waiting 5 minutes, and event after these 5 minutes it does not complete
I have got the same issue with a Flowchart that does not have WLAN.
Since flowchart is commercially sensitive, I have PM'd Jonny with it.
Odd how it just started to happen.

Re: WLAN Component

Posted: Wed Aug 28, 2013 9:12 pm
by Jordy101091
LeighM,

Could you take another look for me at the WLAN component, I'm experiencing some trouble to get it configured correctly.

The meaning of that im using this component is to allow data monitoring over internet and make a nice graphic user interface so that the user can configure different kind of settings online (remote config).

Things I can configure are:

- SSID Name
- SSID Broadcast
- Channel
- TX Power

Things that I cannot configure:

- IP Address
- Subnet Mask
- Gateway IP
- DHCP
- Security
- Data Rate

But How does it work?

Maybe a stupid question, specially after shouting what is wrong with the component :oops:, but how does it work.
For example how do I configure my wireless LAN module in a specific way that I can use it as a server (so I can display data on a webpage) and read back some settings from that same webpage.
Also if I don't want to specify a IP address but assign this automatically via a DHCP server of my router how does this work.


For short what I want with this component is to show the user some reading from the ADC to a webpage that can be viewed with my GSM when im one my mobile network.

I hope we can make it work,
Regards Jordy

Re: WLAN Component

Posted: Thu Aug 29, 2013 8:45 am
by LeighM
Hi Jordy,

I have attached a test program that I have used successfully to test the webserver of the WLAN component.

It also demonstrates how to use the SetOutValue and GetInValue macros, these set the outgoing strings and read the incoming request parameters. Also have a look at the index.htm. Please note that this server accepts requests on port 5000, but you can change that property.

Change the IP, Subnet Mask, Gateway IP properties to suite your network.

As regards DHCP, the component does not currently support it. You would be best allocating an IP address to the WLAN that is outside of the DHCP range of your router. Your wireless LAN component will need a static IP anyway so that you can setup port forwarding at your gateway.

Hope that helps.
Leigh

Re: WLAN Component

Posted: Thu Aug 29, 2013 7:28 pm
by Jordy101091
Oke LeighM,

With you Flowcode on my second screen, I now know that the commands that u used where wrong I was sending this "<XX>" but it needs be in this form "XX" so now I can successfully read back the settings that I have configured.

But there are some troubles:
When I read back the Module IP Address it still says that default IP address is true, what I put in into Flowcode doesn't affect this, how ever I cannot reach this device in my web browser when I enter this IP address.

I can get it to connect my local wireless network but I don't seem to view the device webpage in my web browser.

This is so frustrating, why it doesn't work.

I hope you can help me out with this LeighM

Regards Jordy

Re: WLAN Component

Posted: Fri Aug 30, 2013 12:28 pm
by LeighM
Hi Jordy

I’ve done more investigation, and here is the best way to do this…
Once the component has initialised…

Send the command to connect to your WiFi Access Point GIssssss_kkkkkk
Where ssssss is the SSID and kkkkkk is the key

Then test until it is connected with command QP
Wait until you get a reply like <S1_SSID_BSSID_CHAN_RATE_RSSI>
rather than <S0> for not connected

Then to get your IP address issue command RI
It will reply with your IP address xxx.xxx.xxx.xxx

Then on your web browser (on same network) type http://xxx.xxx.xxx.xxx:5000

Hope that helps
Leigh

Re: WLAN Component

Posted: Mon Sep 02, 2013 10:34 am
by LeighM
… and just to add, if you did not know already, you can run the web server in simulation, just enter http://127.0.0.1:5000 in your local browser

Leigh

Re: WLAN Component

Posted: Mon Sep 02, 2013 2:20 pm
by Jordy101091
Hi leighM

I now are confident that there are now bugs with the WLAN component,
But I cannot seem to connect to my wireless network. Do you have suggestions?

Maybe I need to try and setup a test network with open security or something.
Will let you now how I'm going with this.

Also thank for letting me know that I can simulate the WLAN component in my web browser, I didn't know that.

Regards jordy

Re: WLAN Component

Posted: Thu Sep 05, 2013 9:55 pm
by Jordy101091
HI LeighM,

I have a working connection with my router.
I can access the configuration page of the WIZ module.

but the server, when I enter the IP address which in my case is 10.0.0.3 the server port in Flowcode is set to 5000.
So the address to acces the webserver should then be: 10.0.0.3:5000 but it doesn't show anything just the message from IE that the page doesn't exist.
Do I need to change a setting????

I op you can help me just one more time, because I can feel im close to a working program. :wink:

Anyway Hop you have some time for me,
Regards Jordy

Re: WLAN Component

Posted: Fri Sep 06, 2013 10:28 am
by LeighM
Hi Jordy
Does the Flowcode program work OK in simulation, using IE with the localhost address?
Is CheckForPageRequests() macro getting called regularly in a loop? (This does the actual server processing)
Regards,
Leigh

Re: WLAN Component

Posted: Fri Sep 06, 2013 11:02 am
by Jordy101091
No I'm not using this macro ad the moment. I will try this later when I come home.
Maybe is there a way that I can help with making the documention more complete, because the help file of some component is mostly empty.

Re: WLAN Component

Posted: Fri Sep 06, 2013 11:54 am
by Jordy101091
LeighM,

I have the server up and running now, but one thing is not clear for me.
How do I send analog reading lets say temperature to this webpage so I can view this realtime.
Do I need to use the SendOutValue macro for this, can you explaine this for me.

Also how do you automatically refresh this same webpage so the data send to this webpage keeps updating

Regards Jordy

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:11 pm
by LeighM
Hi

Yes, if you add text to your web page, such as …. The value is %0
Then in your Flowcode convert your analogue reading to a string ValueStr, e.g. “123.45”
Then add to your Flowcode the WLAN macro SetOutValue(0, ValueStr)
When the page is requested the %0 will be converted to the string 123.45 before it is sent to the browser.
Same for %1 and SetOutValue(1, “hello world”)

As for automatic refresh, the server cannot push data to the browser client.
The browser has to request it. But that can be done automatically with some Javascript added to your web page.
(I’ll have to do some googling to remind me of the exact code :O)

Regards,
Leigh

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:13 pm
by Jordy101091
I have tried it straight away and it works duh :) but if I change this analoge value is doesn't change on the webpage.
How can ik fix this

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:15 pm
by LeighM
Sorry, just did an edit about that ...

As for automatic refresh, the server cannot push data to the browser client.
The browser has to request it. But that can be done automatically with some Javascript added to your web page.
(I’ll have to do some googling to remind me of the exact code :O)

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:16 pm
by kersing
Jordy101091 wrote:Also how do you automatically refresh this same webpage so the data send to this webpage keeps updating
Hi Jordy,

You could use the methods mentioned on wikipedia for refreshing the page.

Jac

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:22 pm
by JonnyW
Hi. This might prove useful for you:
frame_page.zip
(1 KiB) Downloaded 393 times
This can auto-refresh a page a given number of times or as many as you want.

Jonny

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:31 pm
by Jordy101091
Sorry if I'm a bit difficult here, but what I'm looking for is something that only refreshes a part of the page rather then the hole page. I read something about this in the wiki link that kersing gave me and there they talk about using Ajax.

Can I implement this...?

Regards jordy

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:50 pm
by JonnyW
I have not heard of the ability to only update part of a page from the web except in a form, but I am no expert when it comes to the web. My assumption would be if you wanted to make it appear that part of your page is updated then put it in a sub-page and update the HTML dynamically from this data.

Again though, this is only based on my limited understanding.

Jonny

Re: WLAN Component

Posted: Fri Sep 06, 2013 12:56 pm
by LeighM
The page buffer (property) is limited in size, so you might start running out of space if you try anything too complex.
Keep it small and the page refresh time should be short too

Re: WLAN Component

Posted: Fri Sep 06, 2013 3:31 pm
by Jordy101091
HI LeighM,

Did you find your JavaScript, I have watched a number of videos but for me this is very hard to understand.
Hope you can and want to help me with this

Re: WLAN Component

Posted: Fri Sep 06, 2013 4:01 pm
by LeighM
Hi Jordy

This was the kind of thing I was thinking of …

Code: Select all

<html>
<head>
<script type="text/JavaScript">
<!--
function timedRefresh(timeoutPeriod) {
	setTimeout("location.reload(true);",timeoutPeriod);
}
//   -->
</script>
</head>
<body onload="timedRefresh(5000);">
page html ...
</body>
</html>

(It will achieve similar to the META version Jac posted above)
But you could do this for a separate (sub)page that loads into a frame.
http://www.w3schools.com/tags/tag_frameset.asp
Although frames are going out of fashion
Hope that helps
Leigh