Last active
June 4, 2024 23:00
-
-
Save abuvanth/001aa1cb28617faff9c3ab72409dd20a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When an interrupt comes from the ring indicator pin, I want to read the message from the UART without interrupting your internet connection, just suspend it and then activate your internet connection again.
I can disconnect the connection with ppp.active(False) and read the message from the UART, but; ppp.active(False) this time the internet connection is lost.
I am connecting to a socket server. If the internet connection is lost, I have problems when I connect again due to the nature of my project.
uart = UART(_id, baudRate=_baudRate, rx=_rx, tx=_tx)
uart.write('+++');
time.sleep(3);
uart.read() => None
Can you help me?