OSError: [Errno 22] EINVAL, socket.SOCK_RAW
OSError: [Errno 22] EINVAL, socket.SOCK_RAW
Hi,
I have little experience with micropython, i'm working with thonny and writing a code but receive error report. What is wrong?
>>> import socket
>>> socket.socket(socket.AF_INET,socket.SOCK_RAW,0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] EINVAL
>>>
I have little experience with micropython, i'm working with thonny and writing a code but receive error report. What is wrong?
>>> import socket
>>> socket.socket(socket.AF_INET,socket.SOCK_RAW,0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] EINVAL
>>>
Last edited by mercan001 on Thu May 09, 2019 3:07 pm, edited 1 time in total.
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
Have you seen the tutorial at https://docs.micropython.org/en/latest/ ... k_tcp.html
What sort of server are you trying to connect to?
What sort of server are you trying to connect to?
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
Yes, I have seen. I don't want to connect to the server. If i wanted it i write different code.
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
Unfortunately SOCK_RAW is not supported -- see https://github.com/micropython/micropyt ... wip.c#L795
I don't know the history, especially why the implementation is partially commented out (perhaps it wasn't deemed important enough, so it's disabled to keep the code size small?).
I don't know the history, especially why the implementation is partially commented out (perhaps it wasn't deemed important enough, so it's disabled to keep the code size small?).
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
Thank you for your answers, but this is bad news.
Whereas I have to send raw code to net! I wonder if I can do it in a different way? Is there another way?
Whereas I have to send raw code to net! I wonder if I can do it in a different way? Is there another way?
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
I guess you could try building the firmware yourself and enable those lines? Search modlwip.c for any line containing the word "raw".
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
I do not know to build firmware myself.
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
If you're interested in learning more about the process, the build instructions are here: https://github.com/micropython/micropyt ... ts/esp8266
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
These linux and macOS operations i don't know linux.
Re: OSError: [Errno 22] EINVAL, socket.SOCK_RAW
I guess i will learn another programming language for esp. It will be the fourth language.