nickovs / slimDNS

Simple, Lightweight Implementation of Multicast DNS
Apache License 2.0
87 stars 9 forks source link

Cannot create server object #2

Closed MoeweX closed 6 years ago

MoeweX commented 6 years ago

Hi,

I am trying to use slimDNS on my Wipy 3.0 board. However, when I try to create the server, I get the following error:

>>> server = slimDNS.SlimDNSServer(addr, "esp32")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/flash/lib/slimDNS.py", line 189, in __init__
  File "/flash/lib/slimDNS.py", line 207, in _make_socket
AttributeError: 'module' object has no attribute 'IPPROTO_IP'

Is the socket library provided as part of the wipy firmware not compatible? In case you wonder, I am using version v1.8.6-849-046b350 of the firmware.

Best, Jonathan.

nickovs commented 6 years ago

@MoeweX Thanks for the message.

I don't have access to a WiPy board so I had never tried SlimDNS on one. Looking at the cc3200 micropython port it seems that it's socket module provides a setsockopt() method but does not expose the constants for the supported options the way that other micropython ports do. WIthout these platform-specific constants being exported there's no way to wrote portable code that will work on the WiPy.

I suggest that you file an issue with the WiPy project to ask them to expose all of the constants for the socket options they support, or at least the subset of them that are supported by other micropython implementations.

MoeweX commented 6 years ago

Thanks for the response. I opened an issue in the Pycom repository.