Sporadic "OSError: -1071239368" on socket sendto (UDP)

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Sporadic "OSError: -1071239368" on socket sendto (UDP)

Post by kfricke » Sun Apr 24, 2016 11:46 am

While implementing my very simple remote syslog client i am running across a strange OSError on my Huzzah feather board. When using the Unix port everything works as intended. Seems to be a LWIP related issue!?

To reproduce the issue, check out the usyslog module, put the syslog*.py files into the scriots folder and run a make deploy to put them as frozen modules onto your ESP board.
My Huzzah does log initially, but throws messages as the following output. They are sporadically triggered by a log method of the UDPClient and last line in the trace is always line 82, the one sending UDP packets.

Code: Select all

>>> import usyslog_test
WLAN Connected:
  Network configuration: ('192.168..', '255.255.255.0', '192.168..', '')
Starting syslog tests...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "usyslog_test", line 28, in <module>
  File "usyslog", line 66, in info
  File "usyslog", line 82, in log
OSError: -1071239368
>>> pm open,type:2 0
The last line "pm open,type:2 0" seems to be some output from osdebug(), so i left it in the snippet, in case it is of use.

I am using version "MicroPython v1.7-150-g0d10e53 on 2016-04-24; ESP module with ESP8266". Haven't tried this on my alpha v4 firmware yet, but feel free to try!

(edit: less dramatic topic)
Last edited by kfricke on Mon Apr 25, 2016 3:02 pm, edited 1 time in total.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: My simple remote syslog client has problems

Post by kfricke » Sun Apr 24, 2016 1:17 pm

Further test runs do show the following behavior:
After a hard reset the error occurs in a random call to the log methods while sending an UDO packet. Doing a soft reset yields permanent errors on the first attempt to send an UDP packet... "rinse and repeat".

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Sporadic "OSError: -1071239368" on socket sendto (UDP)

Post by Damien » Tue Apr 26, 2016 12:06 pm

Try catching and ignoring this error. See http://forum.micropython.org/viewtopic. ... 295#p10295 for more info.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Sporadic "OSError: -1071239368" on socket sendto (UDP)

Post by kfricke » Tue Apr 26, 2016 3:23 pm

Thanks for the hint. Can I ignore catching the exception manually after applying your patch?

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Sporadic "OSError: -1071239368" on socket sendto (UDP)

Post by pfalcon » Tue Apr 26, 2016 9:49 pm

@kfricke: Yes. Suggestion to catch exception is for early-release-4, if you build from the latest source, it's already fixed.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply