ItsyBitsy Serial after waking up from Standby

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
GuyBooth
 
Posts: 32
Joined: Wed Sep 08, 2021 3:56 pm

ItsyBitsy Serial after waking up from Standby

Post by GuyBooth »

I'm building a project that uses the ItsyBitsy MO Express.
I'm using the RocketScream LowPower library to put it into standby power mode, and waking it with an interrupt attached to Pin2.

Before I put it into standby power mode, I can read all the messages I have built into the code, using Serial.print functions. After I put it into standby power mode, and continuing after I wake it up, I have been unable to get the Serial.print functions to work.
I have tried reissuing the Serial.begin (9600) and USBDevice.attach instructions without success.

Does anyone know how to make this work?
Thanks.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: ItsyBitsy Serial after waking up from Standby

Post by mikeysklar »

Does it help if you add a:

Code: Select all

Serial.flush(); 
before dropping into low power mode?

Also would it help to close the Arduino Serial Monitor (or whatever you are watching the messages with) and only open it after coming out of low power mode?

User avatar
GuyBooth
 
Posts: 32
Joined: Wed Sep 08, 2021 3:56 pm

Re: ItsyBitsy Serial after waking up from Standby

Post by GuyBooth »

Serial.flush(); didn't make any difference.

The one thing that worked was to close the serial monitor before going into low power mode, and only opening it after powering back up.
No other variations of closing the serial monitor, powering down, opening the serial monitor and powering back up worked - e.g. leaving the serial monitor open when going into low power mode, closing it while in low power mode, and opening it again after powering back up.

Is there a way to close the Serial monitor from within the program?

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: ItsyBitsy Serial after waking up from Standby

Post by mikeysklar »

@GuyBooth,

Let me know if Serial.end() does the trick.
Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call Serial.begin().
https://www.arduino.cc/reference/en/lan ... erial/end/

User avatar
GuyBooth
 
Posts: 32
Joined: Wed Sep 08, 2021 3:56 pm

Re: ItsyBitsy Serial after waking up from Standby

Post by GuyBooth »

Nice try ...
but unfortunately not successful.
I even added a delay to give it time to shut the serial down before powering down.

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”