[solved]raising LMIC_DEBUG_LEVEL is not increasing debug output

(Jim Hollister) #1

I’m building my first TTN device which consists of an Arduino Pro Mini 3.3V, a HopeRF RFM95, and Things Indoor Gateway. I’m having trouble getting the standard ttn-otaa example sketch to work correctly and I’m trying to diagnose the problem myself. The LMIC debug level seems like it would be helpful. I switched from LMIC_DEBUG_LEVEL = 0 to LMIC_DEBUG_LEVEL = 1 and I can see that this had an effect because much more of my available RAM was used at the higher debug level. However, I don’t see the debug messages on the Serial Monitor that the LMIC source code suggests I should be seeing. I am seeing messages like this:

09:05:23.217 -> 457: EV_JOINING
09:05:23.217 -> 953: EV_TXSTART
09:05:29.934 -> 421982: EV_TXSTART

but I see those messages when the LMIC debug level set to 0. In other words, raising the LMIC debug level to 1 hasn’t changed the serial output at all. I’ve include the content of my lmic_project_config.h below.

Any suggestions for being able to see the LMIC debug messages?

// project-specific definitions
#define CFG_us915 1
#define CFG_sx1276_radio 1


// define this in lmic_project_config.h to disable all code related to ping
// define this in lmic_project_config.h to disable all code related to beacon tracking.
// Requires ping to be disabled too

(Couin) #2

Hi, Have you uncommented #define LMIC_PRINTF_TO Serial line?

(Jim Hollister) #3

No I had not and that solved the problem. Thank you! The README.md file I found in the Arduino library said this about that #define and so I assumed it would default to Serial:

The remaining variables are rarely used, but we list them here for completeness.

#### Changing debug output

#define LMIC_PRINTF_TO SerialLikeObject

This variable should be set to the name of a Serial-like object, used for printing messages. If not defined, Serial
is assumed.