MySensors Debug print @ 5.3Mbit/sec freeing Hardware Serial Port

MySensors provides a lot of useful debugging information on the serial port when MY_DEBUG is defined, I need to use the HardwareSerial for another purpose. but would still like to have the option to see the debug prints. which could look something like this

In Debugging @ 5.3Mbit/sec (5333333 Baud) on Arduino and other Embedded systems I demonstrate how to implement a fast and low overhead method of getting debug prints out on a normal i/o pin, moving the buffering complexity to a USB-Serial-port.

Only output is important so the above solution would be adequate for the debug prints from MySensors. Hence the way forward is to create an Arduino Library, we will call it DebugSerial, which contains two files

libraries/DebugSerial/DebugSerial.h

libraries/DebugSerial/DebugSerial.cpp

Finally we need to make MySensors aware of the new library, applying this patch to MySensors

To redirect the standard MySensors debug print to digital pin 13 add this to your MySensors sketch

Thats it connect a PL2303 USB-serial-port to pin D13 and you will be able to follow the debug stream from MySensors.

ToDo: The Hardware serial port code is still included and initialized I have to look into the use of MY_DISABLED_SERIAL

Print Friendly, PDF & Email
This entry was posted in Arduino, Embedded, MySensors. Bookmark the permalink.

1 Response to MySensors Debug print @ 5.3Mbit/sec freeing Hardware Serial Port

  1. Pingback: Debugging @ 5.3Mbit/sec (5333333 Baud) on Arduino and other Embedded systems | Peter Lorenzen

Comments are closed.