Closed flybrianfly closed 1 year ago
I’m curious, what kind of sending jitter are you seeing when you put the UDP transmission in loop()
?
Question two: Is it possible to split up the flushing so that sending UDP packets (rather, checking a timeout and possibly sending) gets interleaved with the flush operation(s)?
Thanks for the suggestion, yes, I think I can get the datalog to play nice enough with interleaving.
I just fixed the assertion failure output so the message is actually sent out before the abort()
call. See the new https://github.com/ssilverman/QNEthernet/commit/3df2b02c9343a2b92a149c5b64c54e5f4aad796a commit and the one preceding it. Now it should be apparent why a freeze happens. WIth your code, you should now see something like this:
Assertion "Function called from interrupt context" failed at line 173 in /Users/you/Documents/Arduino/libraries/QNEthernet/src/sys_arch.cpp
The library makes the core assumption that it's called in a non-concurrent way. A bunch of things would need to change to make it be able to run in a concurrent context. It's not that it's not advised, it's actively disallowed.
Hello, I'm trying to send a UDP packet from interrupt context. I know that's generally not advised, but I'm wondering if you know of a potential solution.
This is a minimum example:
Works if I send in loop, but not if I try to send in interrupt context. I see the "START" on the serial monitor and that's it. In the actual code, I have a datalogging task in loop (flushing a circular buffer to SD) and a data acquisition and telemetry task in interrupt context. Would like to use UDP to send telemetry packets and can't afford the jitter from doing it in the loop alongside the datalogging task.