I am checking to see if a note has arrived from Notehub using the get last command example. Each time through the loop the serial monitor outputs a continuous stream of the info shown below making it difficult to read other serial monitor output. I am checking for a new note at 1-2 second intervals. (is that a problem?) Please tell me how to turn of this [INFO] reporting.
INFO] {“err”:“no notes available {note-noexist}”}
[INFO] {“req”:“note.get”,“file”:“data.qi”,“delete”:true,“crc”:“041D:E8517A59”}
[INFO] {“err”:“no notes available {note-noexist}”}
[INFO] {“req”:“note.get”,“file”:“data.qi”,“delete”:true,“crc”:“041E:E8517A59”}
Please tell me how to turn of this [INFO] reporting.
You can disable the [INFO] logs by compiling with:
-DNOTE_C_LOG_LEVEL=1
If you are in an environment that does not have access to the compile flags (e.g. Arduino), then you will need to modify note.h.
Change:
#define NOTE_C_LOG_LEVEL NOTE_C_LOG_LEVEL_INFO
to:
#define NOTE_C_LOG_LEVEL NOTE_C_LOG_LEVEL_WARN
I have created a ticket to create a dynamic switch, which will allow you to adjust the behavior at runtime.
I am checking for a new note at 1-2 second intervals. (is that a problem?)
Not necessarily, but it’s not optimal.
The Notecard provides an ATTN pin that can be configured to alert you when a new message arrives. This would allow you to configure a hardware interrupt, so you would only poll the Notecard when something is available.
Please review our documentation describing the ATTN pin usage. However, instead of using a timer-based configuration (like we do in the doc), you would configure the Notecard to trip the ATTN pin when there is activity on the Notefile(s) in which you are interested. This can be accomplished using the files parameter of the card.attn API.