MicroPython interface eric7

Tue, 10 Oct 2023 16:28:45 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Oct 2023 16:28:45 +0200
branch
eric7
changeset 10235
4a12b160094c
parent 10234
6b6fe61bba38
child 10236
c270c9501f1c

MicroPython interface
- Made the ESP device WiFi connect methdo a bit more robust w.r.t. additional output.

src/eric7/MicroPython/Devices/EspDevices.py file | annotate | diff | comparison | revisions
--- a/src/eric7/MicroPython/Devices/EspDevices.py	Tue Oct 10 14:53:23 2023 +0200
+++ b/src/eric7/MicroPython/Devices/EspDevices.py	Tue Oct 10 16:28:45 2023 +0200
@@ -789,6 +789,9 @@
         if err:
             return False, err
 
+        while not out.startswith(b"{"):
+            # discard output until next newline
+            _, out = out.split(b"\r\n", 1)
         result = json.loads(out.decode("utf-8").strip())
         if result["connected"]:
             error = ""

eric ide

mercurial