I’m using a portenta with a vison shield with ethernet module.
I’m a bit confuse with the lan.status()
It suppose to show the status of the lan interface:
0: Link Down
1: Link Join
2: Link No-IP
3: Link Up
It’s actually show the status of the previous lan connection.
If i connect the lan cable and connect to the network it show 0 but i got an ip adress from my dhcp.
then If i disconnect the lan cable it show 3 but i have a timeout error (which is expected.)
There is no deinit() function like the wlan.
My goal is to check if there is a cable connected to the ethernet module and if not to fall back on the wifi connection.
I could wait for the timeout with try: error: but i would prefer to check the status of the lan and act accordingly.
Am i doing something wrong ?