Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [Errno 49] Can't assign requested address - running simple server example #130

Open
tedunn1234 opened this issue Mar 31, 2021 · 2 comments

Comments

@tedunn1234
Copy link

tedunn1234 commented Mar 31, 2021

Hi,

I've been struggling with getting the OSC server working so that I can receive messages from software sending them on another machine.

I have the example client code working and can see my message received and can see a message coming back in Protokol.

I've changed the IP and Port to a different port on the other machine in the simple server example code. I get the Errno49 noted above when I run it.

I I use the lighting console software on the other machine to trigger an out going OSC message, I can see that in Protokol.

I've spent several days on this trying on different computers with different ports, etc. I disabled the firewall on the second computer with no change.

Any help would be appreciated. Thanks in advance.

Hope this code formats correctly.

======================================================


"""Small example OSC server

    This program listens to several addresses, and prints some information about
    received packets.
"""
import argparse
import math

from pythonosc import dispatcher
from pythonosc import osc_server

def print_volume_handler(unused_addr, args, volume):
    print("[{0}] ~ {1}".format(args[0], volume))

def print_compute_handler(unused_addr, args, volume):
  try:
      print("[{0}] ~ {1}".format(args[0], args[1](volume)))
  except ValueError: pass

if __name__ == "__main__":
  parser = argparse.ArgumentParser()
  parser.add_argument("--ip",
      default="192.168.86.91", help="The ip to listen on")
  parser.add_argument("--port",
      type=int, default=5005, help="The port to listen on")
  args = parser.parse_args()

  dispatcher1 = dispatcher.Dispatcher()
  dispatcher1.map("/filter", print)
  dispatcher1.map("/volume", print_volume_handler, "Volume")
  dispatcher1.map("/logvolume", print_compute_handler, "Log volume", math.log)

  server = osc_server.BlockingOSCUDPServer((args.ip, args.port), dispatcher1)
  print("Serving on {}".format(server.server_address))
  server.serve_forever()



@tedunn1234 tedunn1234 reopened this Apr 1, 2021
@tedunn1234
Copy link
Author

Sorry, the comment was my testing formatting the code. Accidentally closed the issue. Can't seem to delete the comment. But did get the code in the original post to format.

@santiruffino
Copy link

Hi! In the code, I'm using the IP 0.0.0.0, and in my iPad with TouchOSC, I have the IP 192.168.0.10. I didn't try to send information from my PC to the iPad, but from the iPad to the server, works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants