maixpy and fm/board_info


I recently got my maix go kit and I’m trying to automatically connect to a WiFi AP on boot. I can connect with the sample code in the network module but when I try to put that in my it fails because fm and board_info objects aren’t available. What do I need to import to access these?

It also seems that globals in might not really be globals. I worked around the above by added a function to “def init_network(fm, board_info)” which includes a “global uart,net” line. I connect when I “import boot; boot.init_network(fm, board_info)” but then the net object seems to go out of scope and shuts down the wifi connection.


I think you can write these code in your or
from board import board_info
from fpioa_manager import *
import network
from machine import UART
uart = UART(UART.UART2,115200,timeout=1000, read_buf_len=4096)


board_info import didn’t work but with fm available I was able to use the pin numbers instead of enums.


would you be king to detail with pin numbers?
Thanks in advance


You can get them by printing the enum values.

 fm.register(7, 67)  # WIFI_RX -> UART2_TX
 fm.register(6, 66)  # WIFI_TX -> UART2_RX


Thanks! I notice, that time-to-time symbolic names works. Now I’m trying to find correct conditions.


one more question
I found the only definitions of RX pins only in one place, i.e. in Maix_fpioa.c:

i.e. RX pins definitions does not apear in .py modules at all.

And WIFI pins are defined in
self.WIFI_TX = 6
self.WIFI_RX = 7

but using of WIFI_TX/WIFI_RX results in error, while using UART2_TX/UART2_RX does not(e.g. fm.register(7, fm.fpioa.UART2_TX))

It is quite unlogical things.