     //   * max binary length, or max JSON length + 1 for CRC + 1 to allow detection of oversize message
     //   * terminating 0xff
     // Buffer need be no larger than leading length byte + typical 64-byte radio module TX buffer limit + optional terminator.
-    const uint8_t MSG_BUF_SIZE = 1 + 64 + 1;
-    uint8_t buf[MSG_BUF_SIZE];
+//    constexpr uint8_t MSG_BUF_SIZE = 1 + 64 + 1;
+
+    // Allow space in workspace for:
+    //   * Msg buffer
+    //   *
+    //   * Decode routine
+//    constexpr uint8_t scratchSpaceNeededHere = MSG_BUF_SIZE;
+//    constexpr size_t workspaceSize = OTRadioLink::SimpleSecureFrame32or0BodyTXBase::generateSecureOFrameRawForTX_total_scratch_usage_OTAESGCM_2p0 + scratchSpaceNeededHere;
+    uint8_t workspace[TX_WorkspaceSize];
+    OTV0P2BASE::ScratchSpaceL sW(workspace, sizeof(workspace));
 
     // Send binary *or* JSON on each attempt so as not to overwhelm the receiver.
     {
         // Send JSON message.
         bool sendingJSONFailed = false; // Set true and stop attempting JSON send in case of error.
 
+
         // Set pointer location based on whether start of message will have preamble TODO move to OTRFM23BLink queueToSend?
-        uint8_t *bptr = buf;
+        uint8_t *bptr = sW.buf;
         // Leave space for possible leading frame-length byte, eg for encrypted frame.
         ++bptr;
         // Where to write the real frame content.


        // 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;
        // writeJSON() requires two further bytes including one for the trailing '\0'.
        uint8_t ptextBuf[maxSecureJSONSize + 2];

        // Redirect JSON output appropriately.
        uint8_t *const bufJSON = ptextBuf;
        constexpr uint8_t bufJSONlen = sizeof(ptextBuf);

        // Number of bytes written for body.
        // For non-secure, this is the size of the JSON text.

        // 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;
