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

EOPNOTSUPP on Pi Pico W #1

Open
oxgr opened this issue Oct 21, 2023 · 3 comments
Open

EOPNOTSUPP on Pi Pico W #1

oxgr opened this issue Oct 21, 2023 · 3 comments

Comments

@oxgr
Copy link

oxgr commented Oct 21, 2023

hello! has there been any successful testing with this library on a Pi Pico W? I know ESP32 models are listed, but the Pico has native wifi module support and I still can't instantiate an OSC client.

Tried installing via circup as well as manually from main.

Using the example code, it errors at:
main.py

osc_client = microosc.OSCClient(pool, ip, port)

microosc.py

class OSCClient:
    ...
    def __init__(...):
        ...
        self._sock.setsockopt(IPPROTO_IP, IP_MULTICAST_TTL, ttl)

Error:

OSError: [Errno 95] EOPNOTSUPP

Versions:

  • microosc: 0.3
  • circup: 1.2.4
  • pip: 21.2.4

Checked on my socket_pool and IPPROTO_IP & IP_MULTICAST_TTL match the hardcoded ones from @jepler at [ 0, 5 ] respectively. I'm guessing that the wifi chip isn't fully supported?

At a dead-end in my troubleshooting now and would appreciate hints. Any ideas on what to look for?

@todbot
Copy link
Owner

todbot commented Oct 22, 2023

I can think of two issues:

  • the multicast magic constants are different in pico-sdk compared to ESP-IDF
  • multicast support isn't available yet on the Pico W.

I've only tested ESP32 and didn't think to try Pico W (had so much issue with it a year ago I gave up). I'll look into if this is a pico-sdk issue or a CircuitPython issue, see if I can get a simple multicast client/server working in pico-sdk. I know in pico-sdk multicast didn't work a year ago, but it was very new then.

todbot added a commit that referenced this issue Dec 14, 2023
…mples default to unicast UDP case. Fix #3 and is a workaround for #1
adafruit-adabot added a commit to adafruit/CircuitPython_Community_Bundle that referenced this issue Dec 15, 2023
Updating https://github.com/todbot/CircuitPython_MicroOSC to 0.4 from 0.3:
  > do check if multicast addr before setting multicast options, have examples default to unicast UDP case. Fix todbot/CircuitPython_MicroOSC#3 and is a workaround for todbot/CircuitPython_MicroOSC#1
  > fix readthedocs builds
  > update readme
@zax71
Copy link

zax71 commented Jan 5, 2025

I am currently getting this issue too on a Pico W:

Traceback (most recent call last):
  File "main.py", line 24, in <module>
  File "microosc.py", line 265, in __init__
OSError: [Errno 95] EOPNOTSUPP

The code is just the example with slight modifications: https://pastes.dev/sE5ZbZe0kN

The error occurs on line 265 that deals with multicast IPs, changing the IP to not begin with 224 fixes the issue for me

@jepler
Copy link

jepler commented Jan 5, 2025

I entered an enhancement request over in circuitpython about this: adafruit/circuitpython#9938

until that's implemented, the setsockopt call is going to fail on those microcontrollers. I don't know what the impact is of ignoring the failure (with a try/except); or whether other limitations/differences of the socket implementation on rp2 will also affect microOSC working properly.

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

4 participants