Closed sahinemreaslan closed 2 years ago
i am fixed.
Helllo, have you met this error - ImportError: no module named 'network_esp32'? I try to run your code or network demo will got this error.
my info:
ImportError: no module named 'network_esp32'
import network_esp32
print(network_esp32)
print(dir(network_esp32))
from network_esp32 import wifi
print(wifi)
Hi, I'm telling you what to do in order.
My Code: ` SSID = "MW40V" PASW = "***"
import sensor, image, time
sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000)
def enable_esp32(): from network_esp32 import wifi if wifi.isconnected() == False: for i in range(5): try:
Running within 3 seconds of power-up can cause an SD load error
enable_esp32()
def enable_espat(): from network_espat import wifi if wifi.isconnected() == False: for i in range(5): try:
Running within 3 seconds of power-up can cause an SD load error
enable_espat()
def network_wiznet5k(): from network_wiznet5k import lan from machine import SPI from Maix import GPIO if lan.isconnected() == False: WIZNET5K_SPI_SCK = 21 WIZNET5K_SPI_MOSI = 8 WIZNET5K_SPI_MISO = 15 WIZNET5K_SPI_CS = 20 spi1 = SPI(4, mode=SPI.MODE_MASTER, baudrate=600 * 1000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck=WIZNET5K_SPI_SCK, mosi=WIZNET5K_SPI_MOSI, miso=WIZNET5K_SPI_MISO) for i in range(5): try: lan.reset(spi1, WIZNET5K_SPI_CS) print('try connect lan...') if lan.isconnected(): break except Exception as e: print(e) print('network state:', lan.isconnected(), lan.ifconfig())
network_wiznet5k()
import socket
ADDR = ("192.168.1.", 23)
sock = socket.socket() sock.connect(ADDR) sock.settimeout(1) clock = time.clock() while 1: sock.send(sensor.get_fb())
data = sock.recv(10) # old maxipy have bug (recv timeout no return last data)
sock.close() ` What type of data should I send? I keep getting errors.(İMG CONVERT ??? Sensor.Snapshot() etc..)
Err Msg: "Traceback (most recent call last): File "", line 82, in
OSError: [Errno 5] EIO"