I have just completed the first activity in the Explore IoT kit, but my board is behaving strangely. From what I understand, when I unplug the board's USB after uploading, it should remember the program. However, the program does not work after I disconnect and then reconnect.
My serial output is also frequently throwing errors and saying some of the sensors are not connected.
The program works when I first upload it, and then once I disconnect and reconnect I get the error messages and it doesn't run properly. I am stuck on what to do and haven't been able to find any answers online.
Yes I do have it in setup but my problem persists. After a fresh upload the L1 & L2 lights are both off, but when I disconnect and reconnect they are both on. Not sure if that has anything to do with the problem.
void setup() {
Serial.begin(9600); // Baud rate of 9600 | standard
delay(1500); // Wait to open Serial monitor to start program and see error details
while (!Serial);
// Set if enclosure is mounted
CARRIER_CASE = false;
// Initialize IoTSK carrier and output errors to serial monitor
carrier.begin();
}
This is my setup function. The board still does not seem to remember the program when I disconnect and reconnect the USB.
The board is consistently assigned COM3, and I have been plugging it into the same physical USB port on my computer in case that matters. Serial monitor remains closed the entire time, during the upload process and when I disconnect and reconnect.
I'm wondering if something is wrong with the actual board?
I can't see the LED blinking at all. The board is connected to the carrier if that changes anything, but I don't believe it would affect the LED_BUILTIN.
It seems my LED_BUILTIN is working strangely. The LED_BUILTIN only blinks if my board is not attached to the IoT carrier. It doesn't work when connected to the carrier.
Reset the MKR1010 Wifi board by double tapping the reset button fast and check the status of the onboard "L" LED. If the onboard LED fade in and out slowly (pulsating), upload an example sketch (Blink LED) from the IDE to the board. This will reset your board.
After this, try running some Arduino_MKRIoTCarrier examples ( with the carrier also powered by the recommended batttery) from the IDE to check that your board is now working fine. If this works fine, then remove any piece of code you have in your own sketch that waits for a serial (USB) connection to run in your sketch.
If the Arduino_MKRIoTCarrier examples does not work, then contact Arduino Support via https://www.arduino.cc/en/contact-us/
The board is working fine. The problem lies with the IoT carrier not being able to connect to its sensors when I run my program, unless the program is a fresh upload.