OSError: stream operation not supported - Github OTA Library

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
xwb
Posts: 14
Joined: Sun Oct 25, 2020 8:33 am

OSError: stream operation not supported - Github OTA Library

Post by xwb » Sat Apr 03, 2021 2:43 pm

Dear all, I am using the library: https://github.com/rdehuyss/micropython ... /issues/18 for OTA Updates. However, I am experiencing the below error: OSError: stream operation not supported

The specific line where this error occurred is:

Code: Select all

result = ujson.load(self._socket)
where self._socket = None and type(self._socket) is <class 'NoneType'>
(not sure why)

I am aware that these may be potential solutions from previous four posts: (viewtopic.php?f=2&t=8817&p=55374&hilit= ... ion#p55374)

Code: Select all

MICROPY_PY_USSL = 1
MICROPY_SSL_MBEDTLS = 1
However, can someone please kindly explain what the "stream operation error" is about? It seems like there is little info about it. Thanks!

Here is the full stack trace: (more info can be found: https://github.com/rdehuyss/micropython ... /issues/18 , https://github.com/rdehuyss/micropython ... /issues/17)

Code: Select all

network config: ('192.168.31.16', '255.255.255.0', '192.168.31.1', '192.168.31.1')
<_SSLSocket 3ffec6e0>
<class 'ussl'>
Checking version... 
	Current version:  0.0
	Latest version:  4
Updating to version 4...
Downloading version 4
<_SSLSocket 3ffec6e0>
<class 'ussl'>
[{'type': 'file', '_links': {'html': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/__init__.py', 'self': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/__init__.py?ref=refs/tags/4', 'git': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/447c62121ffec6a6404c4977775e010f81602ffc'}, 'path': 'src/app/__init__.py', 'size': 8, 'name': '__init__.py', 'git_url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/447c62121ffec6a6404c4977775e010f81602ffc', 'html_url': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/__init__.py', 'download_url': 'https://raw.githubusercontent.com/FalconBFR/esp32otatestv3/refs/tags/4/src/app/__init__.py', 'url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/__init__.py?ref=refs/tags/4', 'sha': '447c62121ffec6a6404c4977775e010f81602ffc'}, {'type': 'file', '_links': {'html': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/httpclientforotaupdater.py', 'self': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/httpclientforotaupdater.py?ref=refs/tags/4', 'git': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/4b6e2779d0caf7a722b04967c1447392596dc627'}, 'path': 'src/app/httpclientforotaupdater.py', 'size': 4898, 'name': 'httpclientforotaupdater.py', 'git_url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/4b6e2779d0caf7a722b04967c1447392596dc627', 'html_url': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/httpclientforotaupdater.py', 'download_url': 'https://raw.githubusercontent.com/FalconBFR/esp32otatestv3/refs/tags/4/src/app/httpclientforotaupdater.py', 'url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/httpclientforotaupdater.py?ref=refs/tags/4', 'sha': '4b6e2779d0caf7a722b04967c1447392596dc627'}, {'type': 'file', '_links': {'html': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/onstart.py', 'self': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/onstart.py?ref=refs/tags/4', 'git': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/de7d314322b6411436ad1683cf3d0dacb75050d9'}, 'path': 'src/app/onstart.py', 'size': 1125, 'name': 'onstart.py', 'git_url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/de7d314322b6411436ad1683cf3d0dacb75050d9', 'html_url': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/onstart.py', 'download_url': 'https://raw.githubusercontent.com/FalconBFR/esp32otatestv3/refs/tags/4/src/app/onstart.py', 'url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/onstart.py?ref=refs/tags/4', 'sha': 'de7d314322b6411436ad1683cf3d0dacb75050d9'}, {'type': 'file', '_links': {'html': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/ota_updater.py', 'self': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/ota_updater.py?ref=refs/tags/4', 'git': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/89ee90e29a5f0f3e50ae2fdf5262c8b1a1ef7391'}, 'path': 'src/app/ota_updater.py', 'size': 10039, 'name': 'ota_updater.py', 'git_url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/blobs/89ee90e29a5f0f3e50ae2fdf5262c8b1a1ef7391', 'html_url': 'https://github.com/FalconBFR/esp32otatestv3/blob/refs/tags/4/src/app/ota_updater.py', 'download_url': 'https://raw.githubusercontent.com/FalconBFR/esp32otatestv3/refs/tags/4/src/app/ota_updater.py', 'url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/ota_updater.py?ref=refs/tags/4', 'sha': '89ee90e29a5f0f3e50ae2fdf5262c8b1a1ef7391'}, {'type': 'dir', '_links': {'html': 'https://github.com/FalconBFR/esp32otatestv3/tree/refs/tags/4/src/app/updater', 'self': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/updater?ref=refs/tags/4', 'git': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/trees/4a72155f06860c4c87c7de1d83d40631eef9a966'}, 'path': 'src/app/updater', 'size': 0, 'name': 'updater', 'git_url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/git/trees/4a72155f06860c4c87c7de1d83d40631eef9a966', 'html_url': 'https://github.com/FalconBFR/esp32otatestv3/tree/refs/tags/4/src/app/updater', 'download_url': None, 'url': 'https://api.github.com/repos/FalconBFR/esp32otatestv3/contents/src/app/updater?ref=refs/tags/4', 'sha': '4a72155f06860c4c87c7de1d83d40631eef9a966'}]
None
<class 'NoneType'>
Traceback (most recent call last):
  File "main.py", line 5, in <module>
  File "app/onstart.py", line 34, in <module>
  File "app/onstart.py", line 23, in connectToWifiAndUpdate
  File "app/updater/ota_updater.py", line 78, in install_update_if_available
  File "app/updater/ota_updater.py", line 129, in _download_new_version
  File "app/updater/ota_updater.py", line 137, in _download_all_files
  File "app/updater/httpclientforotaupdater.py", line 44, in json
OSError: stream operation not supported
MicroPython v1.14 on 2021-02-02; ESP32 module with ESP32
Type "help()" for more information.

Thanks in advance!

Post Reply