A new code fragment is available here:
https://github.com/nkolban/esp32-snippe ... tatic_ip.c
The purpose of the fragment is to connect to an access point from our ESP32 using a static/fixed IP address as opposed to using DHCP for IP address allocation. The reason I am calling this out is because it has improved my coding workflow. I often find myself repeating the "edit, compile, flash, run, examine" cycle. When we use DHCP to be allocated an IP address there is a delay of a few seconds (at least in my environment) while the DHCP protocols are being exchanged and an IP given to the ESP32. Using a static IP address, I am finding that from the point of esp_wifi_connect() to the event indicating that I have an IP and am ready to start communicating becomes so quick that I don't perceive any delays. When one is doing a lot of reboots to test ... this can be a great boon.
[Info] Connecting to an access point with a fixed IP address ...
[Info] Connecting to an access point with a fixed IP address ...
Last edited by kolban on Fri Jan 20, 2017 10:28 am, edited 1 time in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Connecting to an access point with a fixed IP address ...
This is going to be super helpful. Thanks for sharing!
-
- Posts: 34
- Joined: Wed Feb 15, 2017 8:31 pm
Re: [Info] Connecting to an access point with a fixed IP address ...
Hello Mr Kolban
Thanks for your post, I already changed the IP for the wifi interface, now I would like to do it for the ethernet interface...
Do you think woul be possible? my impression is that stop_dhcp is not working yet for ethernet...
My goal is to connect my pc to the esp32 via ethernet interface with a cross cable, but I need some how to set up the ip in the esp32 for the ethernet interface...
What do you think? are my impressions ok at the moment?
Regards
Thanks in advance!
Juan
Thanks for your post, I already changed the IP for the wifi interface, now I would like to do it for the ethernet interface...
Do you think woul be possible? my impression is that stop_dhcp is not working yet for ethernet...
My goal is to connect my pc to the esp32 via ethernet interface with a cross cable, but I need some how to set up the ip in the esp32 for the ethernet interface...
What do you think? are my impressions ok at the moment?
Regards
Thanks in advance!
Juan
Re: [Info] Connecting to an access point with a fixed IP address ...
Howdy Juan,
Unfortunately I've no experience in using Ethernet with the ESP32 so can't help you yet. What are you using to connect your ESP32 to an Ethernet network? I'd love to try and play with Ethernet as well.
Neil
Unfortunately I've no experience in using Ethernet with the ESP32 so can't help you yet. What are you using to connect your ESP32 to an Ethernet network? I'd love to try and play with Ethernet as well.
Neil
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 34
- Joined: Wed Feb 15, 2017 8:31 pm
Re: [Info] Connecting to an access point with a fixed IP address ...
Mr Kolban,
For the Ethernet test I used this board
http://www.waveshare.com/dp83848-ethernet-board.htm
And took the example from the ESP32 IDF with small change in the PHYADR1and create the pinout for pin CRS
Please let me know how your test was doing!
Regards!!!
Juan
For the Ethernet test I used this board
http://www.waveshare.com/dp83848-ethernet-board.htm
And took the example from the ESP32 IDF with small change in the PHYADR1and create the pinout for pin CRS
Please let me know how your test was doing!
Regards!!!
Juan
Re: [Info] Connecting to an access point with a fixed IP address ...
It just does nothing. No ip is assigned.
I (10505) wifi<1,1>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
I (10515) wifi f8:5e:a0:df:e5:cb join, AID=1, bgn, 40U
I (10515) web config: station f8:5e:a0:df:e5:cb join, AID=1
I (10515) web config: starting server
W (10665) wifi:<ba-add>idx:4 (ifx:1, f8:5e:a0:df:e5:cb), tid:0, ssn:9, winSize:64
I (44735) wifi f8:5e:a0:df:e5:cb leave, AID = 1, bss_flags is 134243, bss:0x3ffd0270
I (44735) wifi<1,0>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
W (44735) wifi:<ba-del>idx
I (44735) web config: station f8:5e:a0:df:e5:cb leave, AID=1
I (10505) wifi<1,1>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
I (10515) wifi f8:5e:a0:df:e5:cb join, AID=1, bgn, 40U
I (10515) web config: station f8:5e:a0:df:e5:cb join, AID=1
I (10515) web config: starting server
W (10665) wifi:<ba-add>idx:4 (ifx:1, f8:5e:a0:df:e5:cb), tid:0, ssn:9, winSize:64
I (44735) wifi f8:5e:a0:df:e5:cb leave, AID = 1, bss_flags is 134243, bss:0x3ffd0270
I (44735) wifi<1,0>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
W (44735) wifi:<ba-del>idx
I (44735) web config: station f8:5e:a0:df:e5:cb leave, AID=1
-
- Posts: 1
- Joined: Mon Jun 19, 2023 11:14 pm
Re: [Info] Connecting to an access point with a fixed IP address ...
Hi Juan,santanapablo1975 wrote: ↑Tue May 02, 2017 1:11 pmMr Kolban,
For the Ethernet test I used this board
http://www.waveshare.com/dp83848-ethernet-board.htm
And took the example from the ESP32 IDF with small change in the PHYADR1and create the pinout for pin CRS
Please let me know how your test was doing!
Regards!!!
Juan
I'm trying to connect an ESP32 Devkit V1 with the DP83848 of waveshare, is this the configuration that you said you could do?
I'm trying to do it, if you have any example code and wiring diagram I will be grateful.
Regards,
Marcelo
Who is online
Users browsing this forum: No registered users and 13 guests