Applab 0.4.0 Forces loading a Arduino Sketch even if Blank

With previous versions of Applab I was able to load and run a sketch through the IDE while debugging the Python side.

With the current release it appears that regardless of having an blank sketch in AppLab and only Python script it loads a blank sketch to the MCU overriding whats already there.

Simple test setup.

  1. Load the Blink example sketch from the IDE - led should show blinking.
  2. Create a blank test app in applab and delete everything in the sketch in applab.
  3. Run the app - you will see python printing "Hello World" and the Q has stop blinking.

This worked in the past.

so 2 things

  1. Why? Personally I am not thrilled with this behavior.
  2. Is there a way to change this behavior. Why would I want to do this - easy..
  • If I have a fully debugged and working MCU sketch why do I have to keep loading it while I am debugging the python script.
  • Also gives the user a preference to working in the ide for the MCU! Also easier access to libraries.

Thanks in advance.

2 Likes

Hi @Merlin513. Try deleting the sketch folder entirely. It isn't possible to do this via Arduino App Lab, so you'll need to do it via the shell terminal on the UNO Q's Linux machine. For example;

arduino@joscelin:/$ rm -rf ~/ArduinoApps/1429132/sketch/

The following code:

Is conditional on the existence of the sketch folder, not on the contents of the folder. So if the folder is present, then the microcontroller is disabled (note the call to micro.Disable()).

It isn't clear to me what the specific conditions are under which the code is executed. When I was investigating your report, I saw this "Stopping microcontroller..." message in the "App launch" view of the Arduino App Lab console when I started an App where I had deleted the .ino file, and I was able to reproduce the behavior you described of the previously uploaded sketch not running. This is what led to the code. However, when I tried it again, the message does not appear and my sketch program continues to run when I start the App.

@ptillisch
Just gave your suggestion a try.

Deleted the sketch folder entirely with rm -r sketch before starting the app and ran the app with just the Python folder and seems to be working.

The python script prints "Hello World" and the MCU is still blinking away very happily :slight_smile:

Never thought about trying just deleting the folder. Thanks makes life alot easier - also makes using libraries easier.

You are welcome. I'm glad it is working with the workaround I provided.

It makes sense regardless to remove the sketch folder from an App that doesn't have a sketch component. It is unfortunate that there isn't support for deleting folders via App Lab at this time. A request has been submitted to the developers for addition of that capability.

1 Like

@ptillisch

Was experimenting a little more with this and found that if you just delete the sketch.ino file from the sketch folder you get the same effect as deleting the whole sketch folder and you can delete the sketch.ino file from applab.

Just thought you would like to know.

Great news. I actually assumed that was what you meant by "blank sketch" from the start. I began the investigation by trying to reproduce the fault you reported by just deleting the .ino file and that was when I did experience the problem of the previously loaded sketch stopping, seemingly correlated to the appearance of the "Stopping microcontroller... " message in the "App launch" view of the Arduino App Lab console when I started an App.

However, as I mentioned, when I later tried to reproduce the fault once again with that same setup, the fault did not occur, and also I never saw that "Stopping microcontroller... " message again. So I was left unsure what the problem might be, as well as being uncertain that it was even necessary to delete the sketch folder entirely.

1 Like