Connection to Arduino IoT Cloud

Has anyone managed to connect Opta using the built-in WiFi module with Arduino IoT Cloud?

Port monitoring:
**** Arduino IoT Cloud - configuration info ****
Device ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
MQTT Broker: mqtts-sa.iot.arduino.cc:8883
WiFi.status(): 0
File not found
Please run the "WiFiFirmwareUpdater" sketch once to install the WiFi firmware.

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"

  Arduino IoT Cloud Variables description

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

  bool test;

  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 <WiFi.h>
#include "thingProperties.h"

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
  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(4);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here
  test = true;
  delay(1000);
  test = false;
  delay(1000);
}

1 Like

It works :blush: but another problem

"ArduinoIoTCloudTCP::handle_WaitDeviceConfig device waiting for valid thing_id"

on serial monitor... :face_with_raised_eyebrow:

@marcinl87 That error means that the thing ID is wrong, or you did not attached your device to the proper thing.

Check your IoT Cloud project to see if you configure that correctly.