Skip to content
Jim Mussared edited this page Jun 21, 2023 · 2 revisions

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")
Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy