             // Distinguished 'invalid' valve position; never mistaken for a real valve.
             constexpr uint8_t valvePC = 0x7f;
             const uint8_t bodylen = OTRadioLink::SimpleSecureFrame32or0BodyTXV0p2::getInstance().generateSecureOFrameRawForTX(
-                  realTXFrameStart - offset, sizeof(buf) - (realTXFrameStart-buf) + offset,
-                  txIDLen, valvePC, (const char *)bufJSON, eW, sW, key);
+                  realTXFrameStart - offset, TX_MSG_BUF_SIZE - (realTXFrameStart-sW.buf) + offset,
+                  txIDLen, valvePC, (const char *)bufJSON, eW, subScratch, key);
             sendingJSONFailed = (0 == bodylen);
             wrote = bodylen - offset;
             if (sendingJSONFailed) OTV0P2BASE::serialPrintlnAndFlush(F("!TX Enc")); // Know why TX failed.

            // Write out unadjusted JSON or encrypted frame on secondary radio.
            // Assumes that framing (or not) of primary and secondary radios is the same (usually: both framed).
            SecondaryRadio.queueToSend(realTXFrameStart, wrote);
        }
        if(!sendingJSONFailed) {
            // Send directly to the primary radio...
            if(!PrimaryRadio.queueToSend(realTXFrameStart, wrote)) { sendingJSONFailed = true; }
        }
    }
    if(neededWaking) { OTV0P2BASE::flushSerialProductive(); OTV0P2BASE::powerDownSerial(); }

        // Push the JSON output to Serial.
        if(!sendingJSONFailed) {
            // Insert synthetic full ID/@ field for local stats, but no sequence number for now.
//            Serial.print(F("{\"@\":\"")); \\ XXX
//            for(int i = 0; i < OTV0P2BASE::OpenTRV_Node_ID_Bytes; ++i) { Serial.print(eeprom_read_byte((uint8_t *)V0P2BASE_EE_START_ID+i), HEX); }
//            Serial.print(F("\","));
//            Serial.write(bufJSON+1, wrote-1);
            Serial.write(bufJSON, wrote);
            Serial.println();
            OTV0P2BASE::flushSerialSCTSensitive(); // Ensure all flushed since system clock may be messed with...
        }
