Skip to content

Instantly share code, notes, and snippets.

@abuvanth
Last active November 19, 2023 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abuvanth/001aa1cb28617faff9c3ab72409dd20a to your computer and use it in GitHub Desktop.
Save abuvanth/001aa1cb28617faff9c3ab72409dd20a to your computer and use it in GitHub Desktop.
from time import sleep
from machine import UART
import time
import network
uart = UART(2, baudrate=115200, tx=17, rx=16)
uart.write("AT+CGDCONT=1,\"IP\",\"jionet\"\r\n")
sleep(1.5)
uart.write("ATD*99#\r\n")
sleep(1.5)
uart.write("AT+CGDATA=\"PPP\",1\r\n")
sleep(1.5)
ppp = network.PPP(uart)
ppp.active(True)
ppp.connect()
sleep(3)
print(ppp.ifconfig())
print(ppp.isconnected())
import urequests as rt
print(rt.get("https://cyberfly.io/").text)
@abuvanth
Copy link
Author

revision -2
time optimized and removed un necessary code

@sumithshetty82
Copy link

Can you also please provide the circuit schematic?
I'm unable to get RX TX signal from it using C++

@abuvanth
Copy link
Author

Can you also please provide the circuit schematic? I'm unable to get RX TX signal from it using C++

if you bought LTE module from ktron.in then you should connect TX to TX and RX to RX.

@sumithshetty82
Copy link

Can you also please provide the circuit schematic? I'm unable to get RX TX signal from it using C++

if you bought LTE module from ktron.in then you should connect TX to TX and RX to RX.

That's odd. Yes. I bought it from ktron.
Generally we need to cross connect it right? Rx to TX and TX to Rx

@abuvanth
Copy link
Author

Can you also please provide the circuit schematic? I'm unable to get RX TX signal from it using C++

if you bought LTE module from ktron.in then you should connect TX to TX and RX to RX.

That's odd. Yes. I bought it from ktron. Generally we need to cross connect it right? Rx to TX and TX to Rx

yes but ktron done that cross connection in their PCB itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment