embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
4.79k stars 650 forks source link

Help wanted: embassy-net-ppp #3096

Open KorribanMaster opened 1 week ago

KorribanMaster commented 1 week ago

Hello, I'm trying to set up a project with a simcom sim868 GSM/GNSS module using PPP. I managed to setup the module using PPP on linux successfully using the following guide as well as talking to the simcom module via serial from an stm32f449 and connecting it to a network and sending data using AT commands but using the ppp network from embassy seems much nicer integrated.

However I can not figure out how to setup embassy ppp from the example to connect using the real modem. I guess what i am missing is the modem and carrier specifics that are setup via the ppp config and the chatscript when using linux and pppd.

Has anyone already setup a real gsm modem using ppp and maybe could provide an example or some cues on the process?

Dirbaio commented 1 week ago

embassy-net-ppp only does the "PPP" part, not the "AT command" part. You can use it with a modem but you have to do the AT commands yourself.

Run the AT commands needed to setup the modem (write it as a string to the uart, then wait the modem to reply with OK). The last command ATD*99# is special: write it as a string, then wait for the modem to reply with CONNECT. After this, the UART is switched to "data mode", speaking PPP. After this is done, you can start forwarding bytes between the serial port and embassy-net-ppp.