Some questions about networking in MAIXPY

  1. How to connect enc28j60 spi-ethernet module to MAIX Bit ?
  2. It’s possible to use WiFi on this board ? (I have a board with ESP32 (micropython included) is it possible to somehow adapt it for this purpose ?)

Question 2 - Solved.
Solution:
ESP32 WROOM DevKit 1 is used for this.
Step by step:

 esptool.py --chip esp32 --port <your_usb_port_with_esp32> --baud 460800 write_flash --flash_size=detect -fm dio 0 <path_to_file_with_firmware>
  • Connect MAIX Bit with ESP32:
Maix pin 25 to ESP32 pinD5
Maix pin 8 to ESP32 pin EN
Maix pin 9 to ESP32 pin D25
Maix pin 28 to ESP32 pin D14
Maix pin 26 to ESP32 pin D25 
Maix pin 27 to ESP32 pin D18

and connect GND pin from Maix Bit to ESP32 GND pin.

  • Use ESP32_SPI from module network for wifi connections and getting ADC values, for example:
import network
from Maix import GPIO
from fpioa_manager import fm, board_info

WIFI_SSID = "your_SSID"
WIFI_PASSWD = "your_wifi_password"

# firmware for ESP32: https://dl.sipeed.com/MAIX/factory_firmware/esp32

# IO map for ESP32 on Maixduino
# (pinmap here: https://www.waveshare.com/w/upload/8/89/Sipeed_Maixduino_Datasheet_V1.0.pdf)

#                                       <function>      <esp_wroom_32 pin>
fm.register(25,fm.fpioa.GPIOHS10)       # cs        ->   D5
fm.register(8,fm.fpioa.GPIOHS11)        # rst       ->   EN
fm.register(9,fm.fpioa.GPIOHS12)        # rdy       ->   D25
fm.register(28,fm.fpioa.GPIOHS13)       # mosi      ->   D14
fm.register(26,fm.fpioa.GPIOHS14)       # miso      ->   D25
fm.register(27,fm.fpioa.GPIOHS15)       # sclk      ->   D18

nic = network.ESP32_SPI(cs=fm.fpioa.GPIOHS10,rst=fm.fpioa.GPIOHS11,rdy=fm.fpioa.GPIOHS12, mosi=fm.fpioa.GPIOHS13,miso=fm.fpioa.GPIOHS14,sclk=fm.fpioa.GPIOHS15)

nic.connect(WIFI_SSID, WIFI_PASSWD)
print(nic.ifconfig())
print(nic.isconnected())
print("ping baidu.com:", nic.ping("baidu.com"), "ms")
nic.disconnect()