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.


    Interaction between Windows and iPhone over usb

    Pythonista
    question
    4
    8
    3214
    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.
    • walou213
      walou213 last edited by

      Hello,

      I’m considering purchasing pythonista 3 on iOS but I need to make sure before it it’s possible to interact between the Python script ruining on the iPhone and a Python script running on Windows, with both iPhone and computer connected through usb port.

      Like the iPhone script need at some point a variable then the script running on Windows send the variable ( through usb, can’t use internet ).

      Thanks for your answer

      cvp 1 Reply Last reply Reply Quote 0
      • mpvano
        mpvano last edited by mpvano

        I've had good luck with using Pythonista for SSH interactions with other networked computers. I use the paramiko library that's pre-installed.

        In cases where I can't use the internet, I use apple's Camera Connection Kit (a small dongle that allows USB devices to be plugged in to the iphone/ipad). It turns out that Apple supports RNDIS networking over USB with no configuration needed. It works great.

        Hint: most people don't realize that SSHD hosts accept command lines as part of the initial connection that are executed by a shell and then exit after returning the results. It's almost painless and easy to debug, since every platform works this way...

        I haven't used RNDIS for this purpose on windows, so I can't give you any advice on setting it up on Windows, but it's a Microsoft invention - so it can't be that complicated. I use it all the time between my iphone, ipad and raspberry pi boxes. It's very simple and reliable on that platform.

        Windows 10 now supports SSH via their own SSHD installation that's an option in their program manager. I use it all the time, but haven't tried the above mentioned SSH "poor man's IPC" this way with windows.

        Hope this gives you some ideas...

        M

        PS: Parmiko also works on almost any other host that supports python. I run the exact same python programs I wrote in Pythonista on my iPad on my Macbook Pro, Rasberry Pis and other computers to access my furnace monitoring system. It even works identically if you run the same programs under Pyto (if that's to your taste).
        m

        1 Reply Last reply Reply Quote 2
        • cvp
          cvp @walou213 last edited by cvp

          @walou213 said:

          iPhone and computer connected through usb port

          If you speak about usb on an iPhone, the only way I could see is to use Ethernet cable through an Ethernet/USB adapter on the iPhone side, but, thus, that's networking. (see here)

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

            RNDIS is networking, but it only requires a USB connection between the two devices. Look it up. It's pretty slick! The only complication is that one device must be a host and the other a client.

            For example, to connect a pi to an iPhone, you connect the lightning plug of an Apple camera connection kit adapter to the phone and then plug a standard USB type A to USB-c cable into it. Then you connect the other end of the cable into the PI, but it goes to the usb-c power connector, NOT the normal USB ports.

            The connection is via IP networking, but no other network adapter is needed.

            It acts like an Ethernet cable if you do it right, but you can turn off all other networking and it still works! I use it regularly.

            Sorry, I can't help you sort out the details of the cabling and drivers you'd need for Windows, but if you get it right it definitely works.

            Google RNDIS! It may do what you need.

            M

            P.S. I've looked into this a bit more, and while it should be possible to make this work (it's how tethering many phones to windows works!), the details appear to be hard to come by. Too bad - it works great between macOS/iOS and Linux machines that have fully supported USB-c.

            It appears that you need a windows machine with USB OTG capable ports, the correct OTG driver for that port, and the standard RNDIS network stack and some inside information from MS to do this.

            Sorry if it's not practical at this time with windows.

            M

            cvp 1 Reply Last reply Reply Quote 1
            • cvp
              cvp @mpvano last edited by

              @mpvano Thanks, I didn't know this way. The solution of Ethernet via the lightning/usbc slot of the iDevice has the advantage to be standard Ethernet.

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

                I'm sorry I can't give more help, but I'd also explore what happens when you tether an iphone to a Windows 10 computer to share the phones wireless connection. This requires only an ordinary charging cable and installing itunes on the windows machine. I believe it does something similar to rndis networking as well, but have not explored it.

                good luck with your project and I hope you get something like this working - all of us could use it...

                M

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

                  This post is deleted!
                  cvp 1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @natelik last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB Forums | Contributors