---
title: "Problem with order of serial commands"
url: "https://maker.wiznet.io/forum/10087"
markdown_url: "https://maker.wiznet.io/forum/10087/md"
type: "Forum topic"
category: "Wireless"
author: "nils333"
created: "2014-03-24T11:39:41+09:00"
last_activity: "2017-05-04T08:33:21+09:00"
language: "en"
views: 1819
replies: 23
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Problem with order of serial commands

## Question

Asked by nils333 on 2014-03-24 in Wireless.

Hi,

I am still operating my device in AP Client Multibridge Mode. The modules firmware is the new 1.1.29 and meanwhile, I have got the impression, that there is a problem with the order, serial commands are given to the module.
I tested both, a variation of wait time during different commands for response as well as the wait time between commands itself.

The problem is, that we control the module via µC over serial interface and therefore need a stable communication between module and microcontroller.

At the moment I am commanding the following instructions in the following order:
, power setting, response ~~
, Alias, response ~~
, AP-SSID, response ~~
, asking for channel, response
&lt;PU5_3_0_0_123456789ab>, setting security, response ~~
setting of radio on/off with the series:~~~~~~~~

~~~~~~ ~~~~~~

&lt;ORnvram_set CountryCode IE>
&lt;ORnvram_set CountryRegion 1>
&lt;ORnvram_set CountryRegionABand 1>

Every command with response ~~~~

~~ ~~

, SSID setting, response ~~~~

~~ ~~

I perform a for site survey followed by a &lt;PIXNET39_123456789ab>
The response to this is &lt;4>

I so far have not fully understood the mechanism for connection to an AP.
Under which conditions the &lt;4> response is sent during command and when in general I need to send command ?

Could you please advise a specific order in using the above serial commands and if required is there a need for splitting the command series into pieces, maybe interrupted by additional reboot sequences.

## Replies

### Reply 1 by kaizen, 2014-03-25

Hi

I think that command’s response has some bug. Although command return &lt;4> response, WizFi630’s operation is well.

If you want another command, refer to below.

If you want to use environment as below.

[![](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/83e0935d22cb69b425b2ba01ce0ff51df22e1a5c.jpg) 666×788 122 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/83e0935d22cb69b425b2ba01ce0ff51df22e1a5c.jpg)

You have to use this command.

> ← WizFi630’s SSID
> &lt;GU5_3_0_0_abcdefghi> ← WizFi630’s KEY
> ← AP’s which you want to connect SSID
> &lt;PU5_3_0_0_123456789> ← AP’s which you want to connect KEY
>
>
> After Reboot
> If you issue command, you can check that WizFi630 receive IP address from AP.

### Reply 2 by nils333, 2014-03-28

Hi,

the command is no option, because we work with fixed IP address.

Is there another workaround instead of using command ?

### Reply 3 by kaizen, 2014-03-30

Hi

the command is no option, because we work with fixed IP address.

> You can use (Status Checking) command instead of command.

Is there another workaround instead of using command ?

> If you use these AT command, you don’t need to use command.

### Reply 4 by nils333, 2014-03-31

Hi,

I thought the command is necessary in order to make a new AP known to the Wiznet module ?

### Reply 5 by kaizen, 2014-03-31

Hi

command is not necessary in order to connect your AP and WizFi630(AP-Client Mode).

For connecting WizFi630(AP-Client Mode) to your AP, there are two method.

First Method

> You can use and command. But in this case, you have to reset WizFi630 using and command.

Second Method

> You can use command. In this case, you don’t have to reset WizFi630.

### Reply 6 by nils333, 2014-04-02

Sorry but I Don ’ t understand.
You say there is no need for using PI command in order to connect module an AP but then you tell me, that the second method
to do so is PI command.
What exactly does the PI command perform ?
My experience to a brand new unknown AP was, that besides of the security settings, the module
somehow needs to get informed about the APs BSSID. With Web Access this could be performed by the connect action,
which filled this information into the Form.
So if there is a way to command the APs BSSID to The module it might be the easiest way to perform
a switchover from one AP to another ?

### Reply 7 by kaizen, 2014-04-03

Hi

What exactly does the PI command perform ?

> command does connect WizFi630 to your AP without reboot of WizFi630.
> But It needs command if your AP set authentication method to WPA or WPA2.
>
> ![](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/520a91e2b17f68e87c4a0cbd055e79d8d841b2fb.jpg)

somehow needs to get informed about the APs BSSID. With Web Access this could be performed by the connect action,
which filled this information into the Form.

> If you want to use command, You don’t need to input command. Because command has AP’s SSID information.
> But if you don’t want to use command, you have to input ,, and command.
> you must do flash save and reboot of WizFi630 if you don’t use command. When WizFi630 restart, WizFi630 will try to connect to your AP.

So if there is a way to command the APs BSSID to The module it might be the easiest way to perform
a switchover from one AP to another ?

> I think that you want to switch AP connection as below. Is it right?
>
> [![](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/c0001e82618cbd3d9f63b62c0914ead24de9f35f.jpg) 752×790 110 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/c0001e82618cbd3d9f63b62c0914ead24de9f35f.jpg)
>
>
>
> If it is right and if you don’t care about rebooting WizFi630, I recommend to use , , , command in order to switch AP.
>
> But it is not, I recommend to use , command.

### Reply 8 by nils333, 2014-04-03

Hi,

I have tested both solutions:

At first using the command for setting the modules security followed by command and command.
As stated before I get the &lt;4> response for the command response, checking the web page, everything is fine, but no connect.

Using the second solution I at first apply the change in formerly stated commands(see former message), I perform and command followed by for flash. It is very strange, that as soon as I have to change the SSID via command, the response time for increases to several seconds. Then I perform command for reboot. After that, no connection again.

I check the web page of the module and every single setting has been assigned correctly.
BUT, the indicated MAC address of the AP(which is marked as optional) is still the one of the former assigned AP.
As soon as I apply the correct MAC address of the AP and perform ‘apply’ action the connection is established.
So the modules behaviour is exactly as I have expected all the time.

As your current solutions don’t work in anyway I urgently ask you for a working solution, as I have already spent over 2 weeks for exploring the circumstances around the modules configuration. ![:blush:](https://emoji.discourse-cdn.com/twitter/blush.png?v=12) ![:open_mouth:](https://emoji.discourse-cdn.com/twitter/open_mouth.png?v=12) ![:cry:](https://emoji.discourse-cdn.com/twitter/cry.png?v=12)

To give you another help:
If I perform the manual action to alter the APs MAC address on the web page, the serial command interface returns the following string as a response to a cyclic request for the module status:
S1_iwconfig apcli0 | grep ESSID | cut -f2 -d" /
[AP configuration.txt](https://maker.wiznet.io/uploads/short-url/27Fqh9qsZBnN0XyHaPL1QQPuYeE) (2.5 KB)

### Reply 9 by kaizen, 2014-04-07

Hi nils333

I am sorry for late reply and we did not provide clearly solution.
Our test team does test about issue for supporting clearly solution.

Do you wait some time into your busy schedule? We will try to support solution.

Thank you.

### Reply 10 by nils333, 2014-04-07

Hi,

I really appreciate your support, so please let me know, if I can support you with additional information in order to get this problem fixed.

### Reply 11 by kaizen, 2014-04-08

Hi nils

Okay Thank you.
I will send fixed firmware or solution after modifying this problem.

Thank you.

### Reply 12 by nils333, 2014-04-15

Hi,

when do you think we can expect a solution for the problem ?

### Reply 13 by kaizen, 2014-04-17

Hi nils

We finish to modify firmware of WizFi630 about command. So I send e-mail to you attached firmware
Please test using it.

### Reply 14 by nils333, 2014-04-17

Hello,

what exactly has been modified with regards to the PI command ?
My current problem with the switching between APs is still the same. I still cannot switch over and the solution for the problem(manually connecting via the web page ) is also my only current option ?

What do you think about this ?

Best regards
Nils

### Reply 15 by kaizen, 2014-04-17

Hi

My test procedure is as below.

> ~~ &lt;-- It is WPA2-PSK/TKIP ~~ ~~
>
> wait for 10 seconds
>
> &lt;PU5_3_10_2_12345678> ← It is WPA-PSK/AES
> ~~
> &lt;PIWizFiDemoAP_12345678>
> ~~~~~~
>
> ~~~~
>
> wait for 10 seconds
>
> ~~~~~~~~~~

~~~~~~ ~~~~~~

~~~~~~

Is it different your test method? If No, I think that you need to check parameter of whether if same with authentication and encryption value of your AP.

For more detail information about command, refer to this document.
<http://wiznet.co.kr/UpLoad_Files/ReferenceFiles/WizFi630_UG_Serial_Security_Configuration_V100E.pdf>

~~~~~~

### Reply 16 by nils333, 2014-04-22

Hi,

my procedure looks like the following:

&lt;ORnvram_set CountryCode IE>
&lt;ORnvram_set CountryRegion 1>
&lt;ORnvram_set CountryRegionABand 1>
&lt;PU5_2_0_0_1a3fklzL45rf2a>

&lt;OR iwpriv ra0 set RadioOff 0>

here wait for 20seconds

to check for the existing networks

&lt;PIXNET1_1a3fklzL45rf2a>
the commands response is ~~ but query to status of module stays always with .~~

~~ ~~

When I change to another AP, do I have to apply new SSID via command.
I don’t see it in your test code.
I have to apply radio on/off command as well as country code as there are no commands to read them out, so I apply them every time.

### Reply 17 by kaizen, 2014-04-24

Hi nils

In our test environment, It is well. I attach the recording video file in your mail when I did test. Please check your e-mail and show video file.

Test Scenario is as below.

1. Factory Default ( Using command )

2. Set your configuration such as , &lt;OR….> ( Refer to video file )

3. Associate to WiznetKaizen AP

4. Switch AP to DIR-636L AP

5. Switch again to WiznetKaizen AP

I think that you can input wrong parameter of command such as WPA2/AES, WPA2/TKIP.
So please check again that your AP’s security information and parameter is same.

### Reply 18 by nils333, 2014-05-02

Hi,
sorry for the delay, I have been out of the company for a week.
I tested very carefully again and the result is as follows:
First test I perform with a second WizFi630 module configured as an AP. This works together with the version 1.1.31 of the Client module.
The second AP is an older Linksys type Wireless-G Access Point WAP54G version 3.1 from Cisco Systems.
With this AP, I cannot perform the same procedure for connection, it doesn’t work. The status is always .
But if I perfom the connect procedure via the web server, everything is fine.
And again…the only difference I see before I perfom the web server connect is, that the web page still shows the MAC address of the former AP. After performing the web connect, the correct MAC adress shows up on the web page and the connection works.

The attached file needs to be attached to extention .tmf for use with terminal program you are using.
With this I always use macro order M4, M5, , M6 and macros M7, M8 and M9 in order to switch between APs with SSIDs mynet and XNET33, but as I sayd, it doesn’t work no matter what I try.
[WiznetWifiMacros.txt](https://maker.wiznet.io/uploads/short-url/jnJvPKUeoyAksxtsfKFDWZro3O5) (511 Bytes)

### Reply 19 by nils333, 2014-05-06

Hi,
after checking your sequenzes again I realized the difference in not resetting to factory defaults after firmware update, so I did it and the AP switching started to work.
As a new strange effect:
In the past I always had to send &lt;+++> as the first command, by now I get the response &lt;1> for that, so I can directly start with serial commands without switching to command mode(maybe this is intended by the new firmware ?).

WIth regards to the status message of the connection:
If I change the password either on the AP or the client side, the connection does no longer exist, but is still indicated in the status telegram with short interruptions.
I guess that this is the result of the client asking for a connection, hence exchanges the password and is then disconnected due to the wrong password.
So the status telegram cannot be used for evaluation of a 100% valid connection, because there is no difference between a bad connection and a wrong security setting with regards to the status telegram.

Is there any other possibility to validate the connection also from the application point of view ?

### Reply 20 by kaizen, 2014-05-07

Hi

In the past I always had to send &lt;+++> as the first command, by now I get the response &lt;1> for that, so I can directly start with serial commands without switching to command mode(maybe this is intended by the new firmware ?).

> Because default value of is as below. So you can’t change command mode using &lt;+++>.
> ![](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/154e38c0d84732d062eb895222d31d499aeb2312.jpg)
>
> To avoid this problem, you have to set to on value as below.
> ![](https://maker.wiznet.io/forum_uploads/wiznet/original/1X/c8c40f8f9db0bf6ad7db6ec2987b25d5149d06a8.jpg)

And your second problem is reappearing in our laboratory. So we will find to solve this problem.

Thank you.

### Reply 21 by nils333, 2014-05-09

Hi,

meanwhile I performed some more tests and the status telegram shows some more problems.
If I turn off the radio, there is no response from the status telegram, it still appears as if the connection exist while it has gone. This behaviour is independet from if I switch off by serial command or web page.

### Reply 22 by swatboy79, 2014-05-20

Has this been solved yet? I have exactly the same issue with the WizFi 630 broadcasting its own SSID when in multibridge mode.

### Reply 23 by nils333, 2014-07-08

Hi,

I think I have tracked down the main problem with connecting to APs.

There is still a problem with the command of the serial channel:

The general behavior for password key phrase is, that the key is evaluated until a “*” is detected. The status of the command is ~~ and the rest of the PW-phrase is simply cut off.
The same appears, if I extend the “~~*~~” by “__”, there is no difference.~~

~~ ~~

If a “*” is part of the first 8 digits, the remaining part of the phrase including the “*” is cut off and the phrase by now is too short, so &lt;2> is returned as a logical error in parameter mismatch.

The web interface works correct, if I attach a key phrase with a “_” content everything works fine. I checked the result by terminal program.

I hope this helps to fix the problem.

---

Source: https://maker.wiznet.io/forum/10087
