How to stop Monitor ? OPLA IoT Kit - MKRIoTCarrier

1.How do I stop Monitor via WebEditor?

  1. Can I stop Monitor via IoT Cloud?
  2. Can I start Monitor via IoT Cloud? I can upload but could not find how to start Monitor

would be amazing to find out if there is option to do it…

@ubidefeo is it something that you could advice? or suggest who could?

what do you mean with “start/stop”?
the monitor only works if you open a serial connection to the board.
If you don’t gave the tab open the board is not sending data to your computer.

If you refer to avoiding the Serial operations than it’s another story :slight_smile:

IoT Cloud has a serial port initialised for several output reasons, we could look into manually disabling it but we’ll have to investigate what could be affected

@ubidefeo thanks for reply,
I am quite new so please correct any of my wording…
what I learnt from playing and experimenting with tools is…

  1. serial connection is when we connect device via USB to PC

  2. we have two option ‘verify and save’ it is like rebuild project in Visual Studio and check errors
    second one ‘Upload and Save’ is to rebuild and upload to device to via serial USB connection

  3. now I have code on the device but I need to run - start code to execute as after upload nothing happens (unless I am wrong here and we can write in code to start after upload?)
    image

  4. in order to start/run/execute code I click ‘monitor’ and
    image


    I can now operate device from IoTCarrier and disconnect and got it working on battery

  5. however have my device in a remote location for few days…so have no access to PC…sometimes device stop in the middle of the night I guess some issue with cloud service and I am not able to stop and start service again… usually I have to bring the device and then connect to PC via USB and run ‘Upload and Save’ then click ‘Monitor’ disconnect and place device again in the location where I perform measurements. Wish could do all these steps remotely via WiFi

so therefor my questions where:
1.How do I stop Monitor via WebEditor? //can I stop running code on device via WebEditor or I have to overwrite it by clicking ‘Upload and Save’
2. Can I stop Monitor via IoT Cloud? //can I stop running code on the device via IoT Cloud website or I need to connect to USB and overwrite it by clicking ‘Upload and Save’ via WebEditor
2. Can I start Monitor via IoT Cloud? //how can I start/execute code via IoT Cloud website

I hope this will make it a bit clear now… let me know if you need any more detail explanation

we’ve all been new at some point :slight_smile:
I think I may know where your issue is.
If the Sketch won’t advance until you open a serial monitor/connection it means that the Sketch has a condition to wait for a Serial connection.
Do you happen to have a while(!Serial) at the beginning of the setup() method?
This is a blocking condition, so it needs to be reworked to give it a timeout.

Is the code yours or is it an example from a guide/tutorial?
Would you mind linking it so in case I can get it amended?

Thank you for sharing
u.

@ubidefeo thanks a lot for kind reply
this is I think exactly what I needed

while (!Serial);

so now I can start script on upload automatically via WebBrowser or IoT Cloud but I need have device connected via USB. I guess there is no option to upload code via WiFi only?

Is there any way to Stop running code? or to stop I need to upload new code with
while (!Serial);
so it will await me to click monitor to start?

here is my script that I combined from few other scripts and happy to share…
https://create.arduino.cc/editor/mdengusiak/08896ab0-23e2-4b56-ac83-9d32e42334d2/preview

ps. today it happens again I left the device overnight and froze it overnight so I have to upload new code again to get it started