ESP32 Ausführung Script über WEBREPL nicht möglich
Verfasst: Montag 9. Dezember 2024, 18:48
Moin,
auf meinem ESP 32 ist folgendes Script installiert:
#sd-karte (lesen und) schreiben
import os
from time import sleep
import time
from machine import Pin,Timer,reset,SPI,I2C
import network, sdcard
#für die SD-Karte
#taste=Pin(0,Pin.IN,Pin.PULL_UP) #flash-taste zum Aushängen der Karte
#led= Pin(2,Pin.OUT,value=1)
spi=SPI(1,baudrate=1000000,sck=Pin(14),mosi=Pin(13),miso=Pin(15),polarity=0,phase=0)
sd = sdcard.SDCard(spi, Pin(5))
try:
os.mount(sd, '/sd')
print("SD-Card is mounted on /sd")
except OSError as e:
print(e)
print("SD-Card previously mounted")
a = 9552.7
a = str(a)
file = open('/sd/counter.csv', 'w')
file.write(a)
file.close()
file = open('/sd/counter.csv', 'r')
print(file.read())
file.close()
Wenn das Script direkt von Thonny ausgeführt wird, funktioniert es wie gewollt.
Aber beim Ausführen über WEBREPL wird folgender Fehler angezeigt:
PROBLEM IN THONNY'S BACK-END: Exception while handling 'Run' (thonny.plugins.micropython.connection.ReadingTimeoutError: Read bytes: bytearray(b' network, sdcard\n\n#f')).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.
Process ended with exit code 1.[/color]
Ich weiß nicht, wonach ich im backen.log suchen muss? Das ist ja sehr lang?
auf meinem ESP 32 ist folgendes Script installiert:
#sd-karte (lesen und) schreiben
import os
from time import sleep
import time
from machine import Pin,Timer,reset,SPI,I2C
import network, sdcard
#für die SD-Karte
#taste=Pin(0,Pin.IN,Pin.PULL_UP) #flash-taste zum Aushängen der Karte
#led= Pin(2,Pin.OUT,value=1)
spi=SPI(1,baudrate=1000000,sck=Pin(14),mosi=Pin(13),miso=Pin(15),polarity=0,phase=0)
sd = sdcard.SDCard(spi, Pin(5))
try:
os.mount(sd, '/sd')
print("SD-Card is mounted on /sd")
except OSError as e:
print(e)
print("SD-Card previously mounted")
a = 9552.7
a = str(a)
file = open('/sd/counter.csv', 'w')
file.write(a)
file.close()
file = open('/sd/counter.csv', 'r')
print(file.read())
file.close()
Wenn das Script direkt von Thonny ausgeführt wird, funktioniert es wie gewollt.
Aber beim Ausführen über WEBREPL wird folgender Fehler angezeigt:
PROBLEM IN THONNY'S BACK-END: Exception while handling 'Run' (thonny.plugins.micropython.connection.ReadingTimeoutError: Read bytes: bytearray(b' network, sdcard\n\n#f')).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.
Process ended with exit code 1.[/color]
Ich weiß nicht, wonach ich im backen.log suchen muss? Das ist ja sehr lang?