• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

StreamDebugger

Q&A Forum › Category: Arduino › StreamDebugger
0 Vote Up Vote Down
kennedy oinac asked 1 year ago

I don’t understand how this part of the code works, and I don’t even know why we use this library.
I would appreciate an explanation.

#ifdef DUMP_AT_COMMANDS
  #include <StreamDebugger.h>
  StreamDebugger debugger(SerialAT, SerialMon);
  TinyGsm modem(debugger);
#else
  TinyGsm modem(SerialAT);
#endif
Question Tags: ESP32
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
Can you tell me which project are you following?
Regards,
Sara

0 Vote Up Vote Down
kennedy oinac answered 1 year ago

It’s about ESP32 publishes data to cloud without Wi-Fi (TTGO T-Call ESP32 SIM800L)

0 Vote Up Vote Down
kennedy oinac answered 1 year ago

It’s about ESP32 publishes data to cloud without Wi-Fi (TTGO T-Call ESP32 SIM800L)

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi again.

That part of the code will include a library called StreamDebugger based on whether the DUMP_AT_COMMANDS macro is defined or not. In our case, it’s not because that line is commented in the code.

//#define DUMP_AT_COMMANDS

The StreamDebugger library is used to log and debug AT commands sent and received by the GSM module. I find it a bit confusing to use, I don’t think I use that in our examples.
We include this because it’s included in all library examples, even though it’s not used in our code.
In our case, because we don’t define the DUMP_AT_COMMANDS, it will use this line instead:

TinyGsm modem(SerialAT);

So, instead of this

#ifdef DUMP_AT_COMMANDS
  #include <StreamDebugger.h>
  StreamDebugger debugger(SerialAT, SerialMon);
  TinyGsm modem(debugger);
#else
  TinyGsm modem(SerialAT);
#endif

You can just include

TinyGsm modem(SerialAT);

 

Regards
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.