 
         // Buffer to write JSON to before encryption.
         // Size for JSON in 'O' frame is:
-        constexpr uint8_t maxSecureJSONSize = OTRadioLink::ENC_BODY_SMALL_FIXED_PTEXT_MAX_SIZE - 2 + 1;
+//        constexpr uint8_t maxSecureJSONSize = OTRadioLink::ENC_BODY_SMALL_FIXED_PTEXT_MAX_SIZE - 2 + 1;
         // writeJSON() requires two further bytes including one for the trailing '\0'.
-        uint8_t ptextBuf[maxSecureJSONSize + 2];
+//        uint8_t ptextBuf[maxSecureJSONSize + 2];
 
         // Redirect JSON output appropriately.
-        uint8_t *const bufJSON = ptextBuf;
-        constexpr uint8_t bufJSONlen = sizeof(ptextBuf);
+//        uint8_t *const bufJSON = ptextBuf;
+        uint8_t *const bufJSON = sW.buf + TX_MSG_BUF_SIZE;
+//        constexpr uint8_t bufJSONlen = maxSecureJSONSize;
 
         // Number of bytes written for body.
         // For non-secure, this is the size of the JSON text.

    const int16_t minsp = OTV0P2BASE::MemoryChecks::getMinSPSpaceBelowStackToEnd();
    const uint8_t location = OTV0P2BASE::MemoryChecks::getLocation();
    OTV0P2BASE::serialPrintAndFlush(F("minsp: "));
    OTV0P2BASE::serialPrintAndFlush(minsp, HEX);
    OTV0P2BASE::serialPrintAndFlush(F(" loc:"));
    OTV0P2BASE::serialPrintAndFlush(location);
    OTV0P2BASE::serialPrintlnAndFlush();

        // then build encrypted frame from raw JSON.
        if(!sendingJSONFailed) {
            // Explicit-workspace version of encryption.
            OTV0P2BASE::ScratchSpaceL subScratch(sW, TX_ScratchSpaceNeeded);
            const OTRadioLink::SimpleSecureFrame32or0BodyTXBase::fixed32BTextSize12BNonce16BTagSimpleEncWithLWorkspace_ptr_t eW = OTAESGCM::fixed32BTextSize12BNonce16BTagSimpleEnc_DEFAULT_WITH_LWORKSPACE;

            constexpr uint8_t txIDLen = OTRadioLink::ENC_BODY_DEFAULT_ID_BYTES;
            // When sending on a channel with framing, do not explicitly send the frame length byte.
            constexpr uint8_t offset = 1;
