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?
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.
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.
I'm going to ask you to post some additional information that might help us to identify the problem.
Please do this:
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.
Open a forum reply here by clicking the Reply button.
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.
Press Ctrl+V. This will paste the compilation output into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
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:
Open your Thing in Arduino IoT Cloud.
Click the "Sketch" tab.
Click the "Open full editor" button.
Click the ⬤⬤⬤ icon on the right side of the board and port selector.
From the dropdown menu, select "Download Sketch".
Wait for the download to finish.
Open the folder the sketch was downloaded to.
Unzip the downloaded .zip file.
Open the sketch from that unzipped folder.
Click the "arduino_secrets.h" tab.
Enter your network credentials.
You should now be able to compile and upload the Thing sketch
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.