Alexa Unable to Discover Arduino

I am trying to make a solar controlled light that can be enabled and disabled using Alexa. I have an Arduino Nano 33 IoT, connected to the same network as Alexa and an Alexa compatible variable (CloudLight). Whenever I enable the Alexa skill, it does not discover any devices.

Code:

/*
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/86c5cf06-5fb0-4a6b-89a4-65109a20f86c

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  CloudLight solarLight;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"

int lightLevel;

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  pinMode(9, OUTPUT);
  delay(1500);

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);

  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
  */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here
  lightLevel = analogRead(1); //Reads light level
  while(solarLight == true){
  if (lightLevel < 550) { //if low light, turn light on
    digitalWrite(9, HIGH);
    delay(2000);// prevents flashing light 
  } else {
    digitalWrite(9, LOW);
  }
  }
  if(solarLight == false){
   digitalWrite(9, LOW); 
  }
  }




Hi!

It is very weird indeed, as everything seems to be ok. The process is actually very straightforward.

Can you send a screenshot of the variable configuration?
Are you using the same Arduino account in Alexa and in your dashboards? (I guess so, but I just want to discard some errors :sweat_smile: )

Yes, I'm using the same accounts.
Variable Config:

Just figured it out... realized that read only meant that nothing could change the variable, changed it to read and write and my Alexa app connected immediately.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.