Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Letting two WiPy talk to each other

    Scheduled Pinned Locked Moved WiPy 2&3
    wifisocketcommunication
    10 Posts 3 Posters 2.0k Views 3 Watching
    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.
    • B Offline
      binux
      last edited by

      Hello,

      I'm currently failing to have two WiPy talk to each and another over WiFi.
      I am connecting one WiPy to the hotspot of another wipy.

      The server wipy the has a socket listening to port ('',9999). The in my loop I accept new connections with socket.accept().
      The other wipy then tries to connect its socket to that adress.

      However this is failing and I was looking for some good examples online. Sadly I found only this example on Github which does not work for me.

      Can anyone get me started so the two wipys can talk to each other?

      Thank you!

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @binux
        last edited by livius

        @binux said in Letting two WiPy talk to each other:

        However this is failing

        Have you some error message?
        And what is your firmware? os.uname()?
        And by Wipy - are you talking about Wipy1, Wipy2 or Wipy3?

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • B Offline
          binux
          last edited by

          Hi livius,

          I'm using the WiPy 2 (I guess - didn't know there was a third one).
          I have no error message. I was trying the example I linked above. Basically my "server" startsup and blocks while going in listening. Meanwhile my "client" tries to connect the IP. At some point the client stops with a OS error -1 (timeout I guess)

          Nothing else is happening...

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @binux
            last edited by

            @binux
            and os.uname()?
            And OSError - 1 i suppose is releated to memory alloc problem..

            think about people first, then computers

            B 1 Reply Last reply Reply Quote 0
            • B Offline
              binux @livius
              last edited by

              @livius

              (sysname='WiPy', nodename='WiPy', release='1.7.5.b2', version='v1.8.6-694-g25826866 on 2017-06-29', machine='WiPy with ESP32')

              L 1 Reply Last reply Reply Quote 0
              • L Offline
                livius @binux
                last edited by

                @binux
                i do not worked with this version but i suppose it should work
                but better try to update you firmware - current is 1.10.2.b1

                think about people first, then computers

                B 2 Replies Last reply Reply Quote 0
                • B Offline
                  binux @livius
                  last edited by

                  @livius

                  i got them updated now. No change. I now also use the code above 1:1 -> I still get the OSError: -1 at the point of socket.connect(addr)

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    binux @livius
                    last edited by

                    @livius

                    I just tried to connect the WiPy server with Putty and this worked. So the issue seems to be at the other side -> client wise, but I can't figure out what it is. Any other ideas?

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      binux
                      last edited by

                      I got the problem solved. It looks like the IP adress 192.168.4.1 creates the issue.

                      I got them connected to a seperate hotspot and with the new IP adresses it worked...

                      1 Reply Last reply Reply Quote 0
                      • C Offline
                        cc
                        last edited by

                        Hello @binux I know this is a slightly old thread, but i wondered if you could perhaps share your code please? I am trying to do something similar - I would like to run two pytracks accelerometer at or as near the same time so I can record vibrations at two positions and unless trying to reset both at the same time I am unsure how to do so, I thought your code may help!

                        Thanks

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post

                        Pycom on Twitter

                        Pycom