I'm working with the WebServerLED example in the WiFiEsp.h library.
I wanted to make the IP static but wasn't able to figure it out. Every example I found in my searches of static IPs used other libraries, so they were of no help.
What I eventually did was to allow the sketch to get the IP via DHCP and then afterward change the IP by using the CIPSTA command shown here:
Serial1.println("AT+CIPSTA="192.168.75.201","192.168.75.1","255.255.255.0""). It works, just not the cleanest method.
I'm sure that there is a better way (other than using MAC address to set it in the Router) to do this with the WiFiEsp.h library.
Is there anything inherently wrong with my method and I shouldn't do it that way?
if you can update the AT firmware to AT 1.7 (SDK 3), then you could use my WiFiEspAT library which is much better than the old WiFiEsp library
@Juraj Thanks for your suggestion, but updating the AT firmware is out of my skill range with the equipment I have on hand. I've tried several of the youtube videos doing it using both a Nano and a Uno and I can't even communicate with the ESP-01s to see which version it has.
you can run the Tools/CheckFirmware example from WiFiEspAT library. the library is in Library Manager
Why? Just set up a permanent lease on your router.
I am curious why you are using Ancient Technology (AT) on an ESP01?
there is nothing ancient on using AT commands. most communication modules firmwares use AT commands. Arduino uses binary commands over SPI in its WiFi libraries/fw, but that is not really better.
@SteveMann I am not allowed to make changes on my router and if you are suggesting that I get a lease from the cable company for a static IP, that isn't the IP that I want static, I want a static internal IP so that I know consistently what it is.
Whether AT is Ancient Technology or not is beyond my knowledge, I know I can do what I want with it and there are lots of examples that I can learn from.
Why? It's your router.
An IP lease is DHCP terminology and has nothing to do with your cable company.
Some routers also call it static or fixed IP, but it is in fact a permanent lease.
@SteveMann Your modem may be yours, but I don't own the modem/router and I do not have the ability to modify its settings.
Making changes to it is not a solution.
That sounds very odd. Your router probably has a label with the router password. You log onto the router, probably 192.168.1.1 and use the password on the label and then you can make changes, including DHCP IP leases.
If you don't own the router, then how many times are you going to pay for it? There is no reason you can't buy your own.
@SteveMann
This conversation has gone off topic completely. Why I don't own and can't change the router setting has nothing to with my original post. Please stop trying to make me look stupid and inept.
That's not my goal.
Setting a static IP or permanent lease in the router is the easiest way to solve your problem.
However, setting a fixed IP in the device requires that you know what the router's DHCP pool is so that you avoid assigning an IP that the DHCP server in the router might reassign to a new device in the future, rendering both unreliable.
@Juraj
I've decided to try updating the AT firmware to the AT 1.7 (SDK 3) that you reference. I found ESP8266_AT_Bin_V1.7.zip and it contains several .bin files in the bin subfolder which is where my confusion starts.
There are .bin files named:
blank
boot_v1.2
boot_v1.6
boot_v1.7
esp_init_data_default_v05
esp_init_data_default_v08
There are also more bin files in other folders with names like user1.2048.new.5.bin as an example.
I would guess that I would only use the boot_v1.7.bin file, but all of the examples I see of the Flash Download Tool shows multiple files in the list to download.
I also have found lots of schematics for the wiring of the Uno to the ESP-01s to do the flashing, but there are conflicts in them. Do you have a link to one that you know works? Are you aware of a good set of instructions? I don't have one of the USB_to_ESP devices, so I have to do it with either a Nano, Uno or a Mega.
Any help will be greatly appreciated.
@Juraj
I'm still working on this, my biggest issue is that the ESP-01s modules I have are 1MB, so the bin files that are available are few and far between.
I did find a reference to one in the link that you provided. Now that I have a USB programmer, things whould be easier than trying to do it with a Uno.
@Juraj I really appreciate the help you have given me so far, but I am hopelessly lost.
Your last response took me to source files that I have no idea of how to turn them into a .bin file. There are a number of great videos and writeups on how to do the flash, but they all refer to groups of files that are either for a 2MB or higher ESP-01s or the link is invalid.
Is trying to do what I want, re-flashing my ESP-01s to 1.7.4 beyond the normal user's ability? Finding the right combination of files and the address load points seems to be only for folks of your knowledge and skill set.
Once again, thanks, but I think I am over my head with this endeavor.
the AT firmware release is in the bin folder. here is the upload command (from README file of WiFiEspAT library):
esptool.py write_flash --flash_size 1MB 0x0 boot_v1.7.bin 0x01000 at/512+512/user1.1024.new.2.bin 0xfb000 blank.bin 0xfc000 esp_init_data_default_v08.bin 0xfe000 blank.bin 0x7e000 blank.bin
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.