I am using the Arduino MKR1010 board. It seems to be stuck offline.
It was working fine on Port 4 before.
I had changed to a different WiFi, and after returning home i switched back to my home WiFi. Now the board seems to connect on Port 6 of my PC. I don't know what caused this. I checked PC Device Manager. It shows that Port 3, 4 and 5 are in use. I don't know by what.
Using the web-based Full Editor, I successfully uploaded the sketch to my board.
However, on the IoT Cloud, Thing, Device, Sketch tab, it still shows my device is still offline. Serial Monitor does not work.
Press and release the button on your MKR WiFi 1010 board that is marked "RST" quickly twice. You should now see the "L" LED on the board pulsing, which means the bootloader is running. The double press causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done).
The bootloader is a program on the ATSAMD21G18 microcontroller of the MKR WiFi 1010 that allows you to upload to the board over the USB cable. The bootloader program creates a virtual serial port on your computer, reads the data the computer sends to it during the upload, and then writes that data to the flash memory on the microcontroller so that it can run on the MKR WiFi 1010.
For this reason, the bootloader program must be activated during the upload process. The Arduino IDE does that automatically. However, it is possible for your sketch code to put the MKR WiFi 1010 into a state where the Arduino IDE is not able to communicate with the board in able to put it into bootloader mode. For this reason, it is useful to be able to manually activate the bootloader mode so that you can recover the board from that condition and upload a fresh sketch.
It is expected that the board will have a different COM port number when it is in bootloader mode. It should switch back to the normal port number when the board goes back into the standard mode of running the sketch program.
The Arduino IDE is able to automatically handle this port number change during the upload.
There is a simple test you can do. Please try this:
Select File > New from the Arduino IDE menus. You will now have the bare minimum sketch that is just an empty setup and loop function. We know for certain that this is a good sketch that should work perfectly. Even though it doesn't appear to do much, under the hood there is actually all the USB code that generates the CDC serial port for the board. The important part is that there is nothing in the sketch code that can break that lower level USB code.
Do the double reset to put the MKR WiFi 1010 into bootloader mode.
Upload the bare minimum sketch to the MKR WiFi 1010.
Does the problem still occur? If no, then you will know for certain that it is related to something in your real sketch.