Page:
PPP on ESP32
Pages
Board FreeSOC
Board Arduino Due
Board BLACK F407VE
Board BLACK F407ZE
Board BLACK F407ZG
Board Crazyflie2
Board Espruino Pico
Board FEZ Cerb40 II
Board FEZ Cerb40
Board FEZ Lemur
Board G30HDR
Board HydraBus V1.0
Board NUCLEO F401RE
Board NetduinoPlus2
Board Nucleo F767ZI
Board Olimex STM32 405STK
Board Olimex STM32 E407
Board OpenMV
Board STM32F401 Discovery
Board STM32F407 Discovery
Board STM32F429
Board STM32F746 Discovery
Board Teensy 3.1 3.5 3.6
Board Tiva TM4C123G Launchpad
Board VCC GND STM32F407VET6 Mini
Boards Summary
Build Troubleshooting
Building Micropython Binaries
Building st flash
Collections module
ContributorGuidelines
CrossBranch
Developing on a microcontroller
Differences
Examples
FAQ
Getting Started Compiling Micropython for Ubuntu 16.04
Getting Started STM
Getting Started
HY STM32F4xxCore144
Hardware API
Home
Instrumenting code using GPIOs
LCD driver
LTO
Learn MicroPython
Memory Manager
Micro Python on Mac OSX
MicroPythonVsELua
Micropython Git Development Workflow
PPP on ESP32
PWM Timers
Performance
Programming Debugging the pyboard using ST Link v2
ProjectsUsingMicroPython
Pyboard Firmware Update
STM32F405 Timer Triggering
STM32F405 pinouts
Securing a MicroPython System
Servos
Soft reset
Standard Library Coverage
Symbolic Debugging for STM32
Threads
Timebase calculation and Clock sources
Timer Implementation
Timer capture mode
Timer one shot
Tips and Tricks
VS Code
Watchdogs, Crash prevention, Crash recovery
2
PPP on ESP32
Jim Mussared edited this page 2023-06-21 16:07:46 +10:00
Table of Contents
Using network.PPP
to connect to a Linux host over USB UART.
This is useful for testing the PPP driver.
With a USB UART available as /dev/ttyUSB1 connected to pins (e.g.) 5,22,18,21 on the device:
$ sudo pppd nodetach noauth crtscts lock proxyarp 192.168.150.1:192.168.150.2 /dev/ttyUSB1 115200
Then on the device:
import machine, network
u = machine.UART(1, baudrate=115200, tx=5, rx=22, cts=18, rts=21, flow=3)
p = network.PPP(u)
p.active(1)
p.connect()
On success, pppd
will print out
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB1
local LL address fe80::ad92:0d2c:01a6:4e6d
remote LL address fe80::2d30:5ecb:8702:97ba
local IP address 192.168.150.1
remote IP address 129.168.150.2
Authentication
To enable authentication, change noauth
to auth servername
and add an entry to `/etc/ppp/pap-secrets:
user servername pass 192.168.150.2
Then pass the authentication details to connect
:
p.connect(authmode=p.AUTH_PAP, username="user", password="pass")