-
Notifications
You must be signed in to change notification settings - Fork 13.3k
PPP packets from Serial on interrupt basis #7646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
David may have meant to send you to the gitter, https://gitter.im/esp8266/Arduino |
It is possible to do that. |
Nice, thanks @d-a-v ! |
Scheduled functions are registered using Uart ISR must be modified to trigger interrupt from the first byte ( |
(edited) A recurrent scheduled proposal is in #6680, as transparent background transfer in CONT stack (user stack). It may be a bit too fast and not adapted with serial link speed. Maybe using the serial irq would be more efficient. Indeed a PPP packet is 8 bytes length at minimum, the potential Serial interrupt API could be adapted to take this kind of input into account. Also bypassing the HardwareSerial class by making another Serial class, not buffering but based only on interrupt might me more efficient for that kind of use-case (let's consider #6680 first?). However as said in gitter by @devyte, doing this in a user |
I could try to modify my sketch in order to try the mechanism with the user Unfortunately, I'm not that good at writing such low level code; I could give it a try, but I can't guarantee my work will be that good. |
In your main loop:
|
After a month of tests, here's my conclusion:
|
Thanks for the report ! By rereading the posts above, I should have realized that the main loop solution couldn't work because of the second reason you just gave. Sorry for that. A similar issue was hapenning with ethernet and a mqtt library stuck in its connecting loop. That was initially what led me to add recurrent scheduled functions, for network management in background in CONT. Glad to know it's also efficient with PPP. Still, I'm wondering if a recurrent scheduled function returning false and installed by serial interrupt would not be the most efficient. Did you try that ? Remember that a simple scheduled functions is executed not more often that once at every loop, while a recurrent one returning false (= executed once like a not-recurrent one) can also be triggered at |
I didn't try it yet. The problem is that I'm used to program at higher levels, so it's a bit difficult for me to put hands on that part of code without having some sort of guide or explanation about it... I think it would take a lot of time only to understand what the code is doing, then by the time I try to change something, version 12 of this sdk would have already come out 🤣 |
It's point 1:
but instead of handling packet, you need to defer handling in a recurrent scheduled function like this:
|
Basic Infos
Platform
Settings in IDE
Problem Description
I talked with @d-a-v about implementing a mechanism using interrupts to handle data coming from Serial and send it directly to
ppp_input()
function. Can someone point me to the right direction?The text was updated successfully, but these errors were encountered: