0

I tried using usocket.IPPROTO_SEC for micropython however it does not seem available. Is there anything else I should do to get access to usocket.IPPROTO_SEC?

Setup

I use this docker image.

Micropython version: 1.11

Description

The micropython docs say that usocket.IPPROTO_SEC is an available constant, however when I try to access it, it is not there.

The output below shows how I am trying to access it and what are the attributes available inside usocket.

MicroPython v1.11-10-g84f1067f7 on 2019-06-02; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import usocket
>>> usocket.IPPROTO_SEC
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'IPPROTO_SEC'
>>> usocket.
__class__       __name__        AF_INET         AF_INET6
AF_UNIX         MSG_DONTROUTE   MSG_DONTWAIT    SOCK_DGRAM
SOCK_RAW        SOCK_STREAM     SOL_SOCKET      SO_BROADCAST
SO_ERROR        SO_KEEPALIVE    SO_LINGER       SO_REUSEADDR
getaddrinfo     inet_ntop       inet_pton       sockaddr
socket
Pedro Borges
  • 1,240
  • 10
  • 20
  • 2
    The section of the documentation that you linked to is clearly marked "Constants specific to WiPy", which is a specific hardware platform. – jasonharper Oct 16 '19 at 15:01
  • I saw the reference. The way I interpreted is that the main micropython lib would have these constants but they would only take effect on specific hardware. When installing micropython from micropython-lib is there a way to specify the wipy feature set? – Pedro Borges Oct 16 '19 at 15:40
  • I would guess that the WiPy module has built-in hardware support for SSL, and that micropython's support consists solely of knowing how to use that hardware (rather than a software-only implementation of SSL that would work on arbitrary platforms). Having even the constant available on other platforms would therefore be a waste of space. – jasonharper Oct 16 '19 at 15:45

0 Answers0