MKR1500 keeps going offline

Hi There,

I am using a MKR1500 with an Arduino SIM. I am able to upload the code on the device using the web editor. But when once I am done uploading the code, the device shows status offline and I am unable to check if the data is changing in the dashboard. I am running the below code to test. Also if i check when was the last time it was active, it generally shows before flashing.
Can someone please help me with it.
Thanks!

#include "thingProperties.h"
int readSensor;
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); 
  Serial.println("Hello world");
  // Defined in thingProperties.h
  initProperties();
  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}
void loop() {
  ArduinoCloud.update();
  // Your code here 
  int sensor1 = analogRead(A1);
  int carbonMonoxide = analogRead(A2);
  int methaneSensor = analogRead(A3);
  Serial.println(sensor1);
  Serial.println(carbonMonoxide);
  Serial.println(methaneSensor);
  delay(1000);
 }
void onADCvalueChange() {
  // Do something
}

Also found that when I detach the device from the web UI and select it again, it shows up the last active timing as when it was detached. But during that time I saw it was inactive. Is there something that i am missing?

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Actually the other post was regarding the IDE.. I posted the code even there for others to understand the issue I am facing

It was reported by somebody as a duplicate and I agreed that it was too similar.

no issues. I will post the question here.

Is there a way that I could use the offline/standalone version of the IDE as the cloud IDE is unstable? I am having issue importing the #include "thingProperties.h" header file.

You can use multiple IDE's.

There is no issue installing the regular IDE too.
Have a few of them here for testing etc.

Also do a search in the forum for "portable install"

I have used the portable version of the IDE, but the issue I am facing is if I have to test the Cloud firmware, I am unable to import the thingProperties header file and hence I am unable to compile the whole code and test it out.

@pert ?

I'm going to ask you to post some additional information that might help us to identify the problem.

Please do this:

  1. When you encounter an error, you'll see a button on the right side of the orange bar in the Arduino IDE: Copy error messages (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  2. Open a forum reply here by clicking the Reply button.
  3. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  4. Press Ctrl+V. This will paste the compilation output into the code block.
  5. Move the cursor outside of the code block markup before you add any additional text to your reply.
  6. Click the Reply button to post the output.
1 Like

Hi Pert, below is the error message data

Arduino: 1.8.15 (Windows Store 1.8.49.0) (Windows 10), Board: "Arduino MKR NB 1500"

cloud_test_issue:1:10: fatal error: thingProperties.h: No such file or directory

 #include "thingProperties.h"

          ^~~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

thingProperties.h: No such file or directory



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This is caused by not having downloaded the full sketch. The Arduino IoT Cloud editor only shows the primary sketch file, but there are two additional files hidden away:

  • thingProperties.h - contains the setup code generated by Arduino IoT Cloud when you created your Thing.
  • arduino_secrets.h - the definitions for your network credentials.

These files are essential for your Thing sketch to work, so if you only download the contents of the "cloud_test_issue" file, then you will get an error like this.

Here is how you can get your full Thing sketch from Arduino Cloud:

  1. Open your Thing in Arduino IoT Cloud.
  2. Click the "Sketch" tab.
  3. Click the "Open full editor" button.
  4. Click the ⬤⬤⬤ icon on the right side of the board and port selector.
  5. From the dropdown menu, select "Download Sketch".
  6. Wait for the download to finish.
  7. Open the folder the sketch was downloaded to.
  8. Unzip the downloaded .zip file.
  9. Open the sketch from that unzipped folder.
  10. Click the "arduino_secrets.h" tab.
  11. Enter your network credentials.

You should now be able to compile and upload the Thing sketch

1 Like

Thanks @pert. That worked for me.

On the other hand is there something related to the MKR1500 going offline or unable to receive data to the cloud. I used the above example and I am changing the ADC value on pin1, so when it changes the value it should upload the data to the cloud. But it seems to the cloud does not get any data at all. I have checked the network connectivity of the MKR1500 and also have run the code to reset the modem before I started with the coding.