← index #6541PR #15242
Related · high · value 0.806
QUERY · ISSUE

ESP32: persistent PPP needed

openby emardopened 2020-10-11updated 2025-10-03
port-esp32

Currently PPP tries to connect during some time, around 10 seconds
and then it gives up. After the timeout, PPP's serial traffic which looks
like !}!}!} }4}"}&} } } } }%}&y is no longer active at serial line and other
end (pppd linux) can't establish connection after timeout.

In application I would need PPP to continuously be active
because if I restart PPP by deleting its instance and creating again
after ESP32 has connected to WiFi, then PPP will spoil WiFi routing
and I don't want this to happen.

Additionaly - is this bug? This won't manually restart PPP after timeout:

ppp.active(False)
ppp.active(True)

Does nothing, while I think it should reactivate PPP traffic to
attempt connection on serial line, the chars !}!}!} }4}"}&} } } } }%}&y
should appear again

CANDIDATE · PULL REQUEST

ports/esp32/network_ppp: Ensure clean shutdown of PPP connection.

closedby pablogventuraopened 2024-06-10updated 2024-08-26
port-esp32

Solves issue #15157

This pull request refactors the PPP connection handling in the ESP32 network_ppp.c file. It introduces changes to properly stop the task and close the PPP connection. The previous implementation had issues with clean closing and task shutdown. The new implementation ensures a clean close and task shutdown by using vTaskDelete and waiting for the clean close before proceeding. This improves the reliability and stability of the PPP connection.

Testing:
The changes were tested by simulating various connection scenarios using IDF v5.0.4, v5.0.5, v5.1.2 and v5.2.0, including abrupt disconnects and reconnects. The new implementation successfully handled all scenarios without leaving any tasks hanging or causing any crashes.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied