Homeduino setup with Aduino Nano 33 IoT Issue

Hello there,

Just got a Arduino Nano 33 IoT, and installed the Homeduino app on my homey pro.

Can’t add the arduino on the homey… Getting this message about UDP. Tried to port forward the port 46639.

Anyone have idea what is wrong?

image

This is my Code:

// Homeyduino - Version: Latest
#include <Homey.h>
#include <WiFiNINA.h>


//please enter your sensitive data in the Secret tab
char ssid[] = SECRET_SSID;                // your network SSID (name)
char pass[] = SECRET_PASS;                // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;             // the Wi-Fi radio's status
unsigned long previousMillisInfo = 0;     //will store last time Wi-Fi information was updated
unsigned long previousMillisLED = 0;      // will store the last time LED was updated
const int intervalInfo = 5000;            // interval at which to update the board information

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial);

  // attempt to connect to Wi-Fi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to network: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

  // you're connected now, so print out the data:
  Serial.println("You're connected to the network");
  Serial.println("---------------------------------------");
  
    //Start Homey library
    
  Homey.begin("VacciGarage");
  /* Note:
     The name of each Arduino on the network needs to be unique
     since it will be used as the unique identifier for your device.
     The name is stored as a String and can thus be as long as you
     desire it to be.
  */

  //Register an example action
  
  //Homey.addAction("myaction", onExampleAction);

  //Register an example condition
  
  //Homey.addCondition("mycondition", onExampleCondition);

  /* Note:
   *  Names of actions and conditions can be at most 16 characters long.
   *  Names of both actions and conditions have to be unique on this device,
   *  which means that there can not be a condition and an action with the
   *  same name on the same device.
   *  
   *  An action is a function which returnes 'void'. While a condition is a function
   *  which returns a boolean ('bool').
   */
}

void loop() {
  //Handle incoming connections
  Homey.loop();
  /* Note:
   *  The Homey.loop(); function needs to be called as often as possible.
   *  Failing to do so will cause connection problems and instability.
   *  Avoid using the delay function at all times. Instead please use the
   *  method explaind on the following page on the Arduino website:
   *  https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
   */
}

Please format it using the </> button in the editor.

What does the serial console say? Your code is outputting some debugging information so it would be useful to know if it actually connects to your WiFi successfully.

Also, are you using the same WiFi network for Homey and your Arduino? If not, than that may be the problem.

Lastly, have you tried configuring the device manually?

Thx for response :slight_smile:
Code is formattet.

The console says that the arduino nano 33 IoT is connected to the network and i can ping the device from my computer. Homey, PC and Arduino is all on the same network.

I have tryed to manually add it, when going next step in the pairing wizard, sadly that dont help.

It just return a “Unknown Error” messages. So not much help there. Maybe the Arduino Nano 33 IoT is not supportet by the homeduino app?

I wrote a support ticket to Homey as well.

It should work, but I wonder if you perhaps need to define at least a device class (and possibly also at least one capability) in your sketch:

void setup() {
  …
  Homey.begin("VacciGarage");
  Homey.setClass("sensor");
  Homey.addCapability("measure_temperature");
}

I will try that when I return to my home later today!

Didn’t work… compiled fine but same error when trying to add the device.

Homey responded “no device exclused for Homeyduino but not all devices are tested so there is a change it is not compatible”

So no help there really… Maybeo something with my internal LAN setup, not able to talk together?

That’s a strange error message, I can’t find it anywhere in the Homeyduino code.

It could be related to LAN issues, but if Homey and your Arduino are on the same (wireless) network I don’t see why it wouldn’t work.

Have a look at this website, especially the “ARDUINO_SAMD_NANO_33_IOT” part:

This worked for me

2 Likes

Thank you so much! As soon as i modified homey.h it worked!