cancel
Showing results for 
Search instead for 
Did you mean: 

How to release an IP address

Patrick Papin
Associate II
Posted on February 19, 2018 at 17:13

Hello,

I use a SPWF04SC, and I create a web page on it 's memory.

I want to limit the access at only one client.

I use the command  'ip_num_clients = 1', that  work good but when the client is dissociated , no more client can be associated because the IP adress is use.

What command can let the IP adress free for a another client,

Best regards

#what-command-can-let-the-ip-adress-free-for-a-another-c
7 REPLIES 7
Elio Cometti
Senior II
Posted on February 19, 2018 at 17:26

Hello,

I suppose the SPWF04 is MiniAP, so I see two ways:

- make the client release the lease and disconnect: the IP address wille become immediately available for another client/station;

- reduce the lease time: the IP will become available at most half the lease time after the station has disconnected (e.g. lease time = 120 seconds: the IP becomes available less than 60 second after the station has disconnected).

Posted on February 20, 2018 at 09:09

Hello Elio,

Thank you for your answer.

-Effectively the SPWF04 is MiniAP, and it have a web page.

-At a moment only one client can be connect to the server and consult the web page.

-When the client are disconnected, a new client can connect to the AP and consult the Web page.

For that, I configure this parameters:   -ip_num_clients=1;

 when the client disconnect, and after the lease time: a new client can be associated but  but don't have IP address ?

Best regards

Posted on February 20, 2018 at 15:02

Hello,

I'm not sure I got your point.

1st of all let me correct a mistake in my previous post: when station disconnect then its assigned IP is made available by server after lease_time seconds from last renew (and not half that period).

Please take care the min value for ip_dhcp_lease_time is 60 seconds. Smaller values will cause the DHCP server to not start.

Also, the ip_num_clients config vars actually control the number of IP the DHCP server will deliver to associated stations, while maximum number of station that can associate to the MiniAP is always 5.

Let's make an example.

Let's pretend to set ip_num_clients=1, ip_dhcp_lease_time=70, to setup the SPWF04 in MiniAP mode with DHCP server activated and 2 stations (Station0 and Station1) to come around at some time.

Let's assume Station0 associate and receive an IP lease at time t

0

: the lease will expire at t

0

+70, but likely Station0 will issue a new DHCP Request (to get confirmation of the lease) at about t

1

=t

0

+35.

Now, let's pretend Station0 to disassociate at t

1

+20: its IP will remain allocated until t

2

=t

1

+70, then lease will be reused by DHCP server.

Station1 can associate at any time, but (because ip_num_clients=1) will get an IP only if the HDCP discover message is issued after t

2

.

Hope this answer your question.

Best Regards,

Elio

Posted on February 21, 2018 at 08:55

Hello Elio,

Thank you for your answer

I'm agree with you about the theorical

operation of the module

.

However, by performing the test with a module, this one never releases the IP address.

To reset the IP address  i' must to disable and then enable the radio  wifi after each disconnection of the client.( by the command: AT+S.WIFI=0 and 1)

Did you do the test with a module?

Best regards

Posted on February 21, 2018 at 10:04

Hello Patrik,

I got the point.

Could you please attach the result of AT+S.GCFG and AT+S.STS?

Please also attach the result of AT+S.PEERS when the station is associated and after the station has disassociated.

I'll try to understand why you module is behaving differently from mine.

Thanks,

Elio

Posted on February 21, 2018 at 11:56

Hello Elio,

I don’t post the message on the STMICROELECTRONIC COMMUNITY, (tell me if you wan’t I post it)

I send to you (In attached files) your request :

For commands : AT+S.GCFG : GCFG.txt

For commands : AT+S.STS: STS.txt

For commands : AT+S.PEERS: PEERS_ASSIOCIATED.txt (When client are connected)

For commands : AT+S.PEERS: PEERS_DISSOCIATED.txt (When client are disconnected)

Thanks for All

Best Regards,

Patrick

De : Elio Cometti

Envoyé : mercredi 21 février 2018 10:06

À : Patrick Papin <ppapin@stramatel.fr>

Objet : Re: - Re: How to release an IP address

<https://community.st.com/?et=watches.email.thread> STMicroelectronics Community

Re: How to release an IP address

reply from Elio Cometti <https://community.st.com/people/cometti.elio?et=watches.email.thread> in Interface and Connectivity ICs - View the full discussion <https://community.st.com/message/186398-re-how-to-release-an-ip-address?commentID=186398&et=watches.email.thread#comment-186398>

________________

Attachments :

GCFG.txt.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxny&d=%2Fa%2F0X0000000b2h%2F9aA5ibeslr0XiyAEhkIPcceEY0jO8u5L5K15OH7BY_k&asPdf=false

STS.txt.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxwx&d=%2Fa%2F0X0000000b2e%2F_viCGwFG4SaH.bZS98QWfL3SY32f2whjhJrIT2ReYrE&asPdf=false

PEERS_ASSOCIATED.txt.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxsO&d=%2Fa%2F0X0000000b2c%2Fc1BZ5u1h1WFtJDBf_JmdB25hbUSOATxGANqCixPyM0U&asPdf=false

PEERS_DISSOCIATED.txt.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxwn&d=%2Fa%2F0X0000000b2b%2FYQ44KfuHYp_WfmZufZfBYkI3nJ6mgXTbojqYQ0P3Ezc&asPdf=false
Elio Cometti
Senior II
Posted on February 21, 2018 at 16:05

Hello Patrick,

I see your module's FW is 1.0.0, while I'm using 1.1.0.

I was not aware of this behavior with FW 1.0, my apologizes.

Please move to FW 1.1.0.

Elio