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

Cant get Basic Server Demo to work with TouchOSC #131

Open
HarlekinSimplex opened this issue Apr 3, 2021 · 2 comments
Open

Cant get Basic Server Demo to work with TouchOSC #131

HarlekinSimplex opened this issue Apr 3, 2021 · 2 comments

Comments

@HarlekinSimplex
Copy link

Hi,

I just used the following sample code to test the server with my TouchOSC Surface:

from pythonosc.dispatcher import Dispatcher
from pythonosc.osc_server import BlockingOSCUDPServer

def print_handler(address, *args):
    print(f"{address}: {args}")

def default_handler(address, *args):
    print(f"DEFAULT {address}: {args}")

dispatcher = Dispatcher()
dispatcher.map("/scene/*", print_handler)
dispatcher.set_default_handler(default_handler)

ip = "127.0.0.1"
port = 8006

server = BlockingOSCUDPServer((ip, port), dispatcher)
server.serve_forever()  # Blocks forever

TouchOSC sends to port 8006 and receives on port 9006.
Sending messages to TouchOSC works nicely but the server does not give any output.
Regardless what I set as the address used by the dispatcher.
Neither the function to handle the set mapping nor the default handler seem to be called.

PyCharm gives two warnings for the disptcher calls:
Expected type 'FunctionType', got '(address: Any, args: Tuple[Any, ...]) -> None' instead
May that be a hint what is wrong?

Im running that code on Windows10 Pro using PyCharm.
What am I doing wrong here?

Cheers
Harlekin

@HarlekinSimplex
Copy link
Author

Just changed ip address from 127.0.0.1 to my real address 192.168.2.100 and it started working...
Wiered.

However the 'FunctionType' Warnings are still there...
Any idea how to hint PyCharm properly here?

Cheers
Harlekin

@jpc0
Copy link

jpc0 commented Jan 25, 2022

See my comment #144 (comment)

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