I am on an Mac, running macOS 13.7.8 and Arduino App Lab 0.5.0
When run this example code (from the app lab docs)"
#include <Arduino_RouterBridge.h>
void setup() {
// Initialize the Monitor
Monitor.begin();
}
void loop() {
// Transmit the string "Hello UNO Q" followed by a newline character
Monitor.println("Hello UNO Q");
delay(1000);
}
Python main file:
import time
from arduino.app_utils import App
print("Hello world!")
def loop():
"""This function is called repeatedly by the App framework."""
You can replace this with any code you want your App to run repeatedly.
time.sleep(10)
See: https://docs.arduino.cc/software/app-lab/tutorials/getting-started/#app-run
App.run(user_loop=loop)
I see nothing in the Console tab under Serial Monitor. I have tried this sketch in PC Hosted Mode and Network Mode.
When I use the same Q board but on a computer running Windows - it works as expected → I see the Serial Output in App Lab (in PC Hosted mode and Network Mode)
Your python you pasted here has errors, including indention.
Maybe it is not what you are actually running,
The default one that you create new app looks like:
import time
from arduino.app_utils import App
print("Hello world!")
def loop():
"""This function is called repeatedly by the App framework."""
# You can replace this with any code you want your App to run repeatedly.
time.sleep(10)
# See: https://docs.arduino.cc/software/app-lab/tutorials/getting-started/#app-run
App.run(user_loop=loop)
What type of MAC? May depend on newer type or older ones with different chips
Edit: Should mention, I tried installing on my old early 2013 Mac book pro, that I had to
jerry rig a little bit ago to install more up to date version of OS, that would run app lab.
I upgraded it to 0.50.0 and it did output stuff into the Serial monitor.
Side note: I was running an earlier version of applab like 3 releases ago and it did
not offer to update it, at least for several minutes, so instead I downloaded it and replaced it...
I just added it, does not seem to make a difference on my mac.
Side note, this Q, when I connect it to a windows machine and run the same app - the Serial Monitor in AppLab shows output on the Serial Monitor like I would expect.
I think it will be best practices to always call Bridge.begin in sketches that directly use the Bridge object, rather than relying on a side effect of Monitor.begin to serve as an equivalent.
However, in sketches that only directly use the Monitor object, it doesn't make sense to call Bridge.begin. Doing so only makes the sketch code more confusing without any benefit.
So my opinion is that there is no reason to add a Bridge.begin call to the code in post #1. The lack of such a call is surely not the cause of the "nothing in console" problem @programming_electronics_academy encountered.
Conversely, I do think it makes sense in a case like this: