Changing W5500 Networking Parameters

Use this section to discuss your embedded Flowcode projects.
Post Reply
Brendan
Posts: 43
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 35 times
Been thanked: 11 times

Flowcode v10 Changing W5500 Networking Parameters

Post 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

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 286 times
Been thanked: 412 times

Re: Changing W5500 Networking Parameters

Post 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

Brendan
Posts: 43
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 35 times
Been thanked: 11 times

Re: Changing W5500 Networking Parameters

Post 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
Last edited by Brendan on Wed Apr 10, 2024 10:25 am, edited 1 time in total.

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 286 times
Been thanked: 412 times

Re: Changing W5500 Networking Parameters

Post 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

Brendan
Posts: 43
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 35 times
Been thanked: 11 times

Re: Changing W5500 Networking Parameters

Post 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

Post Reply