matthias-bs / BresserWeatherSensorTTN

Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver based on ESP32 and RFM95W/SX1276 - sends data to a LoRaWAN Network (e.g. The Things Network)
MIT License
22 stars 9 forks source link

RPS debug logging output format not as desired #37

Open matthias-bs opened 1 year ago

matthias-bs commented 1 year ago

The debug output format for RPS information does not match other debug messages:

10:42:46.290 -> [ 47074][D][BresserWeatherSensorTTN.ino:820] NetTxComplete(): 
10:42:46.290 -> 41359 ms:[ 47090][I][BresserWeatherSensorTTN.ino:772] operator()(): TX @41359 ms: ch=2 rps=0x03 (SF9 BW125 CR 4/5 Crc IH=0)
10:42:46.290 -> 

(Preceeding extra timestamp 41359ms:, extra line-feed.)

This is due to the fact that there are still Serial.print() calls in ~/Arduino/libraries/MCCI_Arduino_LoRaWAN_Library/src/lib/arduino_lorawan_cEventLog.cpp even if debug output is implemented in the sketch with the myEventLog.logEvent() function. (see Arduino_LoRaWAN::cEventLog::processSingleEvent())

arduino_lorawan_cEventLog.cpp#L88

matthias-bs commented 1 year ago

Workaround

Comment out Serial.print() statements in arduino_lorawan_cEventLog.cpp:

bool
Arduino_LoRaWAN::cEventLog::processSingleEvent()
    {
    if (this->m_head == this->m_tail)
        {
        return false;
        }

    auto const pEvent = &this->m_queue[this->m_head];

    //Serial.print(osticks2ms(pEvent->time));
    //Serial.print(" ms:");
    pEvent->pCallBack(pEvent);
    //Serial.println();

    if (++m_head == sizeof(m_queue) / sizeof(m_queue[0]))
        {
        m_head = 0;
        }

    return true;
    }
matthias-bs commented 1 year ago

Created https://github.com/mcci-catena/arduino-lorawan/pull/211