ESP8266 [Errno 103] ECONNABORTED\r\n')

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Posts: 1
Joined: Fri Mar 20, 2020 7:40 pm

ESP8266 [Errno 103] ECONNABORTED\r\n')

Post by gary » Fri Mar 20, 2020 7:51 pm


I am having issues running the following script for a longer period of time.
It is a nodemcu esp8266

Code: Select all

#!/usr/bin/env python3

import machine
import network
from time import sleep
import urequests
import json

wifiap = network.WLAN(network.AP_IF)
routercon = network.WLAN(network.STA_IF)
routercon.connect('mywifi', '123')
while not routercon.isconnected():


adc = machine.ADC(0)

while True:
    value =
    if value < 200:
       message = {'username': 'test', 'message': value, 'chatid': 'test', 'password': 'test', 'notifyself': 'false'}
       r =, data=json.dumps(message).encode())
It works as expected in the beginning but after some time I get the following stacktrace:

Code: Select all

Traceback (most recent call last):
  File "/usr/local/bin/ampy", line 11, in <module>
  File "/usr/local/lib/python3.6/dist-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/dist-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/ampy/", line 337, in run
    output =, not no_output)
  File "/usr/local/lib/python3.6/dist-packages/ampy/", line 303, in run
    out = self._pyboard.execfile(filename)
  File "/usr/local/lib/python3.6/dist-packages/ampy/", line 273, in execfile
    return self.exec_(pyfile)
  File "/usr/local/lib/python3.6/dist-packages/ampy/", line 267, in exec_
    raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n  File "<stdin>", line 28, in <module>\r\n  File "", line 152, in post\r\n  File "", line 89, in request\r\nOSError: [Errno 103] ECONNABORTED\r\n')
No idea what to do.
I tried to play around with the garbage collection but it didn't help.

Any ideas?


Post Reply