Eth soft fail implementation

I would like to soft fail for Eth.

using ESP32 I tried to create a custom init script, as written by an AI, to call

mgos_ethernet_init

from

esp32_eth.c

however turns out mgos_ethernet_init is not global, so such a plan doesn’t really make sense. Instead if I can find where eth is initialised, I can fork that code, and create a retry function with a delay (as discussed elsewhere), and if the retry fails, I can set a flag, without the system going into a reboot loop.

I cannot find where mgos_ethernet_init() is called from.

:exploding_head: :exploding_head: :exploding_head:

I assume you’re trying to call mgos_ethernet_init() from here: ethernet/src/esp32/esp32_eth.c at master · mongoose-os-libs/ethernet · GitHub is that right?

Did it compile? What errors are you seeing?

I have reformatted my issue and goal in my initial posts

Not sure I really understand what you’re doing, but from what I gather you’re including this library in your project and then configuring from mos.yml as mentioned in the doco, and you’re not sure how to recover from a failed initialisation. Sounds like you’d like to detect a failure and keep retrying.

I’ve not tried any of these things myself, but where I’d probably start is:

  1. importing the source and running init myself
  2. programatically disabling/enabling the device and seeing if that’s enough to restart the driver or if it needs to be done on reboot
  3. knowing that a reboot will reinitialise the driver try and find a way to manage reboots.

Not really the answer you’re hoping for but maybe it leads you to an answer.

I don’t think it is you who does not understand what the OP is doing.

If I were the OP, instead of copying something given by an AI, I would search this forum for answers already given, read datasheets and user manuals, understand the problem, then ask specific questions.
Obviously I am not the OP

Thanks, I have tried enabling Eth using serial commands after boot, the device will reboot, and get stuck in a reboot cycle. I don’t have access to my reflow gear at present, so am just looking to include a solution in my code in the case that Eth fails, without causing a boot loop.

scaprile
I dont understand why you need to be a dick, I am trying to support this codebase, with a clear question, after spending many hours trying to solve this. Its a pretty simple question, but instead of helping you are sending me on a wild goose chase

What I don’t know is why you label people and insult people. Anyway, sometimes I do act like a dick, so no offense taken.
I remember having given some pointers on Eth stuff.
Usually when hw fails, fw resets trying to either magically fix or at least call for attention.
Most likely what you’re looking for is buried deep down into the IDF or a proprietary bootloader.
If you have an idea on where to go, go for it, AFAIK there is very little chance to add new code to mOS, so don’t hesitate to change your sources to get your goal.