Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Can you access information about cellular network performance and "phone events" using pythonista?
-
I would like to build an app that keeps track of location, signal strength, data rates for data connections, information about drops, blocks, call quality, connection times, etc. Is there a way to access this information in the iPhone from pythonista? Or anywhere, for that matter? I know there are apps that do this (and sell the information to cellular service providers), but I'd like to create one myself...
Any ideas?
-
Obtaining the
location
of your device is relatively straightforward.Obtaining upload and download data rates can be done by timing the sending and receiving of known blocks of data to and from known remote hosts.
I know of no way to obtain the other data you mentioned with Pythonista.
-
Thanks - that's a start. I know that the phone knows whether it sees 3G or 4G, it knows signal strength. And I know there are some apps that record that. Is there a way to see what's going on with TCP/IP, e.g. timeouts, packet failures, number of retransmission attempts? I know that seeing into the MAC layer events would probably require access to the APIs for the modem chip on the phone, but I'm wondering if layer 3 is visible somewhere.
-
The
socket
module in the standard library provides low-level TCP/IP interfaces, you might be able to use that. You probably can't get any information on other apps' connections though, that would probably require access to APIs that Pythonista doesn't have Python interfaces for. -
Thanks. That would be ok as a start. There must be an API on the phone, somewhere, that allows access to the modem - after all, things like click to dial, etc are supported. As are call-progress messages, for things like Skype and Google.
-
Click to dial
is easy in Pythonista:import webbrowser webbrowser.open('tel:+1-212-555-0123')
-
The phone number above is a real phone number. I would recommend changing it. I called and someone actually picked up
-
-
This might be useful for getting the ip address of the tower you are connected to.
-
@JonB, Were you able to get this to work? I got a socket error in Pythonista and on the Mac.
recv_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp) # --> socket.error: [Errno 1] Operation not permitted
-
Did you run it as root (on the Mac)? It seems to work on the Mac when run as root but gets the aforementioned error under Pythonista.