Closed tinamore closed 3 years ago
I doubt it reconnects. Your best guess is to track status events via on_status_event
.
Thank for your support. Do you have an example full code of maintaining a persistent connection. Obviously this is very important. Can I do this?
import utime
import cellular
import socket
cellular.gprs("v-internet", "", "")
while 1:
utime.sleep_ms(500)
if not cellular.gprs():
cellular.gprs("v-internet", "", "")
print("IP", socket.get_local_ip())
host = "httpstat.us"
port = 80
s = socket.socket()
s.connect((host, port))
message = "GET /200 HTTP/1.1\r\nHost: {}\r\nConnection: close\r\n\r\n"
s.write(message.format(host))
print(s.read(256))
s.close()
The most reliable way is to reboot the module before each payload.
Thank you very much.
Thank you for your wonderful Project.
I have a question that is:
Example When I run
will the cellular.gprs function take care of the reconect gprs automation? I don't need to check status gprs (then if not gprs then reconnect gprs) every time open socket?