omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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?

    Pythonista
    6
    11
    8150
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • michael_recchione
      michael_recchione last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • michael_recchione
          michael_recchione last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • dgelessus
            dgelessus last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • michael_recchione
              michael_recchione last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • ccc
                ccc last edited by

                Click to dial is easy in Pythonista:

                import webbrowser
                webbrowser.open('tel:+1-212-555-0123')
                
                1 Reply Last reply Reply Quote 0
                • reefboy1
                  reefboy1 last edited by

                  The phone number above is a real phone number. I would recommend changing it. I called and someone actually picked up

                  1 Reply Last reply Reply Quote 0
                  • ccc
                    ccc last edited by

                    http://en.m.wikipedia.org/wiki/555_(telephone_number)

                    1 Reply Last reply Reply Quote 0
                    • JonB
                      JonB last edited by

                      This might be useful for getting the ip address of the tower you are connected to.

                      1 Reply Last reply Reply Quote 0
                      • ccc
                        ccc last edited by

                        @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
                        
                        1 Reply Last reply Reply Quote 0
                        • ihf
                          ihf last edited by

                          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.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Powered by NodeBB Forums | Contributors