Stream operation not supported: Explanation?
-
Hello other engineers
Micropython forum suggested to post this here.
I have a question about a stream operation which is not supported. I try to make an over the air update (OTA) with LTE. I got a working LTE connection and also the manifest is made within a localhost with the new version in it. The problem is that this manifest can not be streamed caused by this error. Can someone help and explain what this is and what I need to do that it is working?
Traceback (most recent call last):
File "main.py", line 55, in <module>
File "/flash/lib/OTA.py", line 54, in update
File "/flash/lib/OTA.py", line 49, in get_update_manifest
OSError: stream operation not supported
Pycom MicroPython 1.20.2.r6 [v1.11-c5a0a97] on 2021-10-28; GPy with ESP32
Pybytes Version: 1.7.1
Type "help()" for more information.If you need further information just ask. :D
Thanks a lot!
-
I am following the approach from https://github.com/pycom/pycom-libraries/tree/master/examples/OTA. The code lines which are making the problem are in 1.0.0/flash/lib/OTA.py:
def get_update_manifest(self): print(self.get_current_version()) req = "manifest.json?current_ver={}".format(self.get_current_version()) manifest_data = self.get_data(req).decode() print(manifest_data) manifest = ujson.load(manifest_data) gc.collect() return manifest
I hope you can help me to fix my code so that a basic program can be updated over the air.
-
Hello Cédric.
The error "OSError: stream operation not supported" happens when you call a streaming object with a read or write function that it does not support.
If you want more help from us, you will have to post the code block that is giving the error with enough context surrounding lines.