Fail to connect to Arduino in Access Point mode.

Hi everyone,

I’m working on a project for which I needed the Arduino to work as an Access Point and send OSC to my Mac.

I tested my code with two different MKR1010. It works fine with the first, but my Mac failed to connect when I tested the other. I’m not getting any error on the IDE console, and the Mac basically tries for minutes to connect before switching back to another WiFi network.

The Firmware is updated on both MKR.

Any clue on what could be the problem or what I should look for?

Here’s the code I’m using, also on Github.

  WiFi Access Point for OSC Communication

  A simple web server that lets you send OSC messages over a closed network.
  This sketch will create a new access point with password.
  It will then launch a new server, print out the IP address
  to the Serial monitor, and then send an OSC message over UDP to a specific IP address. 

  created 24 Nov 2018
  by Federico Peliti

  based on 
  WiFi Simple Web Server by Tom Igoe
  WiFi UDP Send and Receive String by dlf
  UDP Send Message by Adrian Freed

  Tested with 
  Arduino MKR1010
  NINA Firmware 1.2.1

  Requires the following libraries:
  WiFi by Arduino
  WiFiNINA by Arduino
  OSC by Adrian Freed, Yotam Mann

#include <SPI.h>
#include <WiFiNINA.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>

int status = WL_IDLE_STATUS;
#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password

//You can specify the Arduino's IP
//IPAddress arduIp(128, 32, 122, 252);
//destination IP
IPAddress outIp(192, 168, 4, 2);

//ports to listen for and send OSC messages
unsigned int localPort = 9999;
const unsigned int outPort = 8001;

WiFiServer server(80);
WiFiUDP Udp;

void setup() {
  //Initialize serial and wait for port to open:
  // You can comment out the next 4 lines to use the Arduino without a USB cable
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only

  Serial.println("OSC Access Point");

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);

  String fv = WiFi.firmwareVersion();
  if (fv < "1.0.0") {
    Serial.println("Please upgrade the firmware");

  // by default the local IP address of will be
  // you can override it with the following:
  // WiFi.config(arduIp);

  // print the network name (SSID);
  Serial.print("Creating access point named: ");

  // Create open network. Change this line if you want to create an WEP network:
  status = WiFi.beginAP(ssid, pass);
  if (status != WL_AP_LISTENING) {
    Serial.println("Creating access point failed");
    // don't continue
    while (true);

  // wait 10 seconds for connection:

  // start the web server on port 80

  // you're connected now, so print out the status

  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:

void loop() {
  //the message wants an OSC address as first argument
  OSCMessage msg("/test/0");
  msg.add("Hello OSC");
  Udp.beginPacket(outIp, outPort);
    msg.send(Udp); // send the bytes to the SLIP stream
  Udp.endPacket(); // mark the end of the OSC Packet
  msg.empty(); // free space occupied by message


void printWiFiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");


Hi AhUhmm, i have tested your sketch with two different 1010 and in both, sniffing the packet with wireshark, i'm able to see the UDP "hello packet" sended by each one.
In my test the two board are not turned on in the same time, before i turn on the first, connect to the board's AP and sniff the OSC message, after i turn off the first and turn on the second one and do same thing.
Can I ask you more information for example, have you the two board connected in the same time?, are you able to ping the board from your Mac?
witch version of library are you using?

Also, have you updated the firmware on the NINA to the latest version?

Can I ask you more information for example, have you the two board connected in the same time?, are you able to ping the board from your Mac?
witch version of library are you using?

I'm using the latest version of both library and firmware.

I'm actually connecting my Mac to the Arduino to receive OSC from the board. I spent a couple of days trying to make the first board I had to work as an access point, then changed it and it worked right away. I've been using it for days now and works perfectly. Could it be possible that the first board I tested it on is somehow damaged?

The problem is that I see the Network been displayed in WiFi nets list, but no device can connect to it and the they all revert another one after the first attempt times out.

Also, have you updated the firmware on the NINA to the latest version?

I did. I updated it because I thought the firmware could be the source of the problem, but it wasn't. I tried all the 3 versions available, and the board fails to work only when I try to use it as an access point.

How are you powering the board?

With a 1000mah LiPo battery. But I tried also directly from my mac, and it doesn't work either way. It works smoothly with the "good" MKR1010 though.

Hi @AhUhmm,

Please contact about the MKR WiFi 1010 board that is not working.