2025-03-27 1:49 AM - last edited on 2025-03-27 1:59 AM by Andrew Neil
hii every one
i have a question about setting up the ip of the STM32 MCU remotely
when we want to do client server in udp or tcp on stm32 controller , we are used to set the ip address manually in the ioc file in general settings in the lwip section in the middleware tab .
and i was wondering if there is a way to set up any default ip of mine , and is there a way to change this ip remotly after i am connected to the stm32 .
my goal is to design an application that can give me the ability to access and change the ip and mask and gateway of my stm32 controller , i be very thankful for help and to know if there is a method to do that
Solved! Go to Solution.
2025-03-27 2:12 AM - edited 2025-03-27 2:12 AM
You said, "we are used to set the ip address manually in the ioc file in general settings in the lwip section in the middleware tab" - so you already have this working?
So that code is your example!
That is the code that you browse, find the settings, then modify...
Did you try the internet search?
2025-03-27 1:56 AM - edited 2025-03-27 1:57 AM
The ioc file from cubeMx as i understood is just a point and click User Interface that generates code.
Here is what i would do:
2025-03-27 2:04 AM
This is going to be more down to the IP stack that you use (LwIP) rather than specific to STM32 - so try searching in general for "LwIP set IP address" and similar ...
Also, as @Javier1 said, browse the generated code to see where these things get set - then change them from compile-time constants to run-time settings ...
2025-03-27 2:06 AM
can yo guys give an example code where to look for thanks
2025-03-27 2:12 AM - edited 2025-03-27 2:12 AM
You said, "we are used to set the ip address manually in the ioc file in general settings in the lwip section in the middleware tab" - so you already have this working?
So that code is your example!
That is the code that you browse, find the settings, then modify...
Did you try the internet search?
2025-03-27 2:24 AM
@Javier1 wrote:
- Just put your project inside the version control of your choice (git?)
@abeba.1 If you don't already have version control, then I would certainly recommend that you should.
But you don't actually need it to do this - you can just use a simple copy:
If you don't already have a diff utility, try WinMerge: https://winmerge.org/?lang=en
A diff utility is an invaluable tool.
2025-03-27 3:34 AM
hii guyes thanks for help :)
2025-03-30 7:58 AM - last edited on 2025-03-31 2:09 AM by Andrew Neil
Duplicate - merged.
Please don't start multiple threads on the same topic.
hii everyone
in the stm32 in the middleware section we can set the ip address manually in general settings in static dhcp section
and compile the project and program it on my stm32 board .
lets say i manually set the ip to 198.162.127.100 so my server that is running on the stm32 board will be working with this ip .
lets say i want to remotly change the ip of the board (without compiling the project again ) to 198.162.127.101
and my question is this possible
my need is to be able to give the board a desired ip without compiling and downloading the new firmware to the stm32 controller
2025-03-30 9:00 AM - edited 2025-03-30 9:00 AM
Use DHCP. Tell the DHCP server to allocate specific address to your board.
2025-03-30 9:40 AM
hii i researched this topic and i saw that in order for the dhcp server to assign ip address
this process is called reservation , and its done at the level of the dhcp server
from what i see i need to know the mac address of my stm32 and then to search for a section in my dhcp server where i can enter the mac and the ip that i want so my stm32 boar will always get the same ip .
lets say that my board is connected to the network the dhcp server is out of my reach , i am not the administrator of the dhcp server on the network in order to set up the mac with the desired ip that i want .
beside of that lets say my board doesn't have an access to the network that means that my local network needs to have a dhcp server in order to do the ip reservation , am i right ?
second -is there away of accessing the configurations of the dhcp server on my network with terminal commands to put my stm32 mac address and my desired ip