Page 1 of 1

Changing W5500 Networking Parameters

Posted: Mon Apr 08, 2024 7:01 pm
by Brendan
Hi Guys,

Just a quickie that I'm sure someone will be able to answer...

Using the TCP_IP_W5500 component, I need to be able to change networking IP/SubNet/Port/MAC parameters on the fly, allowing users to change/set configuration values to EEPROM, with the code updating W5500 parameters when changed.

Not sure how to functionally support this process however.

Is there something I need to call/do to reliably invoke the new parameters before re-opening the socket(s), would a hard reset and then recalling the Initialise function cover this, or am I over-thinking/complicating things ?

Apologies, although I'm new to networking it's all working perfectly. Merely limited component familiarity and just another small hurdle to cross before I can deliver :)

Many thanks in advance,

Brendan

Re: Changing W5500 Networking Parameters

Posted: Mon Apr 08, 2024 7:35 pm
by chipfryer27
Hi

From what I take, you want something that allows your users to enter the required parameters and save, then when next run it uses these parameters?

Will the "project" be delivered with empty fields or preset to a known that may change at some point?

One possible way which may not suit your particular scenario would be to:-

Load parameters from EEPROM at start
If empty branch to Macro allowing you to enter parameters and save before continuing

When running
Try and connect to target
If fails (incorrect parameters) branch to macro allowing you to enter parameters and save before continuing

The above could be in there own loops or you could perhaps issue a reset to force the uC to start afresh.

Hope this is of some help.

Regards

Re: Changing W5500 Networking Parameters

Posted: Tue Apr 09, 2024 1:38 pm
by Brendan
Thank you Chipfryer.

The project will be delivered with arbitrary test defaults declared in Flowcode's W5500 component properties, and presently all working well with those parameters. My thoughts were really based upon W5500 initially using declared parameters in the W5500 component with network connected, before such time they were changed in the program flow.

Static IP addresses will ultimately be assigned by IT, requiring the confirmed parameters to be written to EEPROM and then used, though a relatively minor inconvenience if I should require the user to first disconnect the network before setting new parameters in EEPROM, with a possible cold reboot if necessary.

I'm still somewhat shaky on networking and its possibly many varied operational caveats, so maybe the above would be the best policy.

Thank you again.
Brendan

Re: Changing W5500 Networking Parameters

Posted: Tue Apr 09, 2024 6:58 pm
by chipfryer27
Hi

All sounds quite "doable" with nothing to suggest you will have problems.

Obviously IP addresses need to be correct to actually connect, but reassigning an address etc doesn't necessary require resetting the uC, it can be done on the fly. Changing the parameters in the component macro before connecting should do it (or perhaps if you are using a reset pin toggle it to reset the W5500).

I might have a chance to try on HW at the weekend.

Regards

Re: Changing W5500 Networking Parameters

Posted: Wed Apr 10, 2024 10:35 am
by Brendan
Thanks again Chipfryer.

Your informed reply gives me the confidence to proceed to roll-out, and I'll be able to test this today on existing hardware, with working/editable EEPROM tables already set up and the W5500 dedicated reset line indeed returned to MCU port.

I'll post back results, to the possible future benefit of other Flowcode users on a similar trajectory as myself :)

That said, nothing at-all like the issues and confusion I've read elsewhere from non-Flowcode communities, that originally inspired my doubts and concerns :lol:

Best regards,
Brendan