The goal is to setup a state of the art firmware on teensy 4.1, serving both ethernet and SD card.
I found there is NativeEthernet, but there is also QNEthernet.
So my first question is:
What criteria should I use to make my selection between those two libraries?
Note: I want that the firmware keeps running without the MQTT broker, even without ethernet cable.
Note2: When broker (or ethernet) comes online, the teensy must reconnect.
Note3: Preferable without using the brownout reset function.
Then I want a fast response from the teensy 4.1 to the MQTT message that are sent to it.
(PubSubClient)
However at the same time(well just in parallel) I want to write to SD card.
It might happen there is no SD card present, and this might take a while to discover this, meaning the teensy is blocked into the SD-routines for a time longer than I want for MQTT response.
So my second question is:
How do I cope with that?
Do I spin a new thread for the network routines, and keep SD card in main-loop?
Do I spin a new thread for the SD routines, and keep network in main-loop?
Or are there other than thread option?
Note: I have a 10ms timer interval ISR routine in parallel to this, but I think it is not relevant (it's a very short service routine).
Thanks,
Karel.
I found there is NativeEthernet, but there is also QNEthernet.
So my first question is:
What criteria should I use to make my selection between those two libraries?
Note: I want that the firmware keeps running without the MQTT broker, even without ethernet cable.
Note2: When broker (or ethernet) comes online, the teensy must reconnect.
Note3: Preferable without using the brownout reset function.
Then I want a fast response from the teensy 4.1 to the MQTT message that are sent to it.
(PubSubClient)
However at the same time(well just in parallel) I want to write to SD card.
It might happen there is no SD card present, and this might take a while to discover this, meaning the teensy is blocked into the SD-routines for a time longer than I want for MQTT response.
So my second question is:
How do I cope with that?
Do I spin a new thread for the network routines, and keep SD card in main-loop?
Do I spin a new thread for the SD routines, and keep network in main-loop?
Or are there other than thread option?
Note: I have a 10ms timer interval ISR routine in parallel to this, but I think it is not relevant (it's a very short service routine).
Thanks,
Karel.