WiFi
The MayaW476 library, access point and station modes, video over WiFi, and the WiFi module firmware.
The Neuro Vision OV5640-W and TFT-W carriers carry a u-blox MAYA-W476 module, an NXP IW610 WiFi and Bluetooth LE combination radio connected over SDIO. The MayaW476 library brings the module up, runs the NXP WiFi driver and a lwIP TCP/IP stack, and provides access point and station modes. Video to Neuro Studio can be routed over WiFi in place of USB. The OV5640, TFT, STCam and Thermal modules do not have the radio, and a WiFi transport on them falls back to USB.
Video over WiFi
#include <MayaW476.h>
#include <OV5640_Arduino.h>
#include <PostProcess.h>
#pragma neuron6 model="yolov8n_256_quant_pc_ii_seg_coco-st.tflite" name=yolov8_iseg
OV5640 camera;
NEURON6_DECLARE_MODEL(yolov8_iseg);
void setup() {
MayaW476.setTimeout(10000);
MayaW476.setTcpPort(5000); // Neuro Studio's port
wl_status_t st = MayaW476.beginAP("NeuroN6-Cam", "password");
// or: MayaW476.begin("YourNetwork", "YourPassword");
VisionConfig cfg;
cfg.transport = TRANSPORT_WIFI_SOFTAP; // or TRANSPORT_WIFI_STA
Vision.begin(&NN_Instance_yolov8_iseg, PostProcess_YOLOv8_ISEG(0.4f, 0.5f), cfg);
}
void loop() {
Vision.run();
}The include is required; without it a WiFi transport falls back to USB with a warning. beginAP(ssid, password) hosts an access point. begin(ssid, password) joins an existing network. Both block until the radio is up or the timeout elapses and return a status. cfg.transport matches the mode chosen.
Once connected, a client joins the network and points Neuro Studio at the board's address on port 5000. The wire format is identical to USB. In both modes the board also sends its address to any USB host as a META_BOARD_IPV4 record about once per second, so Neuro Studio can fill in the target automatically.
Bring-up sequence
Vision.begin() with a WiFi transport performs the following inside setup():
- Powers the module, probes it over SDIO and downloads the IW610 firmware from external flash at
0x91E00000. This takes one to two seconds. - Starts the connection manager, which associates to the access point (station) or hosts one (access point) in a background task.
- Starts a TCP video server on the configured port.
If the radio cannot be brought up, begin() prints a warning and falls back to USB.
Module firmware
The IW610 firmware, sduartspi_iw610.bin.se, ships in the library's firmware/ directory. It is flashed like model weights: any sketch that includes MayaW476.h, BluetoothMaya.h or ArduinoBLE.h causes the uploader to write it to 0x91E00000 on the next upload, and Tools > Model weights controls whether it is rewritten when unchanged. No separate programmer step is required.
Configuration
WifiStaConfig sta;
sta.ssid = "MyHomeNetwork";
sta.psk = "wifipassword";
sta.security = WIFI_SECURITY_WPA2;
MayaW476.setSTA(sta);
WifiSoftApConfig ap;
ap.ssid = "NeuroN6-AP";
ap.psk = "apsecret"; // 8 or more characters
ap.security = WIFI_SECURITY_WPA2;
ap.channel = 6;
MayaW476.setSoftAP(ap); // default network 192.168.10.0/24, board at .1| Security value | Meaning |
|---|---|
WIFI_SECURITY_NONE | Open |
WIFI_SECURITY_WEP | WEP, not recommended |
WIFI_SECURITY_WPA | WPA-PSK |
WIFI_SECURITY_WPA2 | WPA2-PSK, the default |
WIFI_SECURITY_WPA_WPA2 | Mixed |
WIFI_SECURITY_WPA3_SAE | WPA3 personal |
WIFI_SECURITY_WPA2_WPA3 | Mixed |
status() returns WL_CONNECTED, WL_AP_LISTENING, WL_AP_CONNECTED, WL_AP_FAILED or WL_NO_MODULE. localIP() and ipv4String() return the address. The access point starts before it has an address to hand out, so localIP() may read 0.0.0.0 briefly.
2.4 GHz only
The driver is compiled with 5 GHz support disabled. Every 5 GHz channel, sub-band and transmit power table is compiled out. The access point is forced to a 2.4 GHz channel and station mode can only scan and join 2.4 GHz networks. 802.11b, g, n and ax remain available. This confines the radio to the 2.4 GHz regulatory regime. See Regulatory Compliance.
Passwords
The WiFiVideoStream example derives the access point password from the chip's unique ID, so each board hosts a different password, and prints it on the console at start. The example comments state that a product must not ship the same password on every unit.
Tasks
A WiFi transport adds two FreeRTOS tasks: a one-shot connection task and a video consumer task that drains the WiFi frame queue into a TCP socket. The USB task continues to run, so the serial console and the b bootloader command remain available while video flows over WiFi. See FreeRTOS Under the Hood.
Coexistence with Bluetooth
Both radios share the module firmware that the WiFi bring-up loads. The WiFiAccessPoint example runs an access point, a connectable BLE peripheral through ArduinoBLE, the camera, the display and the speaker together. BluetoothMaya and ArduinoBLE cannot both be used in one sketch. See Bluetooth LE.
Verification status
Access point mode has been verified end to end on hardware. Station mode is implemented; its on-air behaviour has not been verified.
Licence
The NXP WiFi driver and firmware are proprietary and distributed under NXP's licence agreement, included in the library. See Licensing.