Transaction Timeout / Reply to request didn't arrive from module in time

Tried the Arduino example (File → Examples → Blues Wireless Card → Example1_Notecardbasics) and get the following error.

09:16:08.975 → {“req”:“hub.set”,“product”:“com.foobar.demo:demo_1”,“mode”:“continuous”}
09:16:19.072 → reply to request didn’t arrive from module in time
09:16:19.072 → {“err”:“transaction timeout”}
09:16:19.823 → notecard not responding
09:16:20.838 → notecard not responding
09:16:21.853 → notecard not responding
09:16:22.826 → notecard not responding
09:16:23.845 → notecard not responding
09:16:24.830 → notecard not responding
09:16:25.835 → notecard not responding
09:16:26.866 → notecard not responding
09:16:27.850 → notecard not responding
09:16:28.834 → notecard not responding
09:16:29.350 → Sync Status = None

Fyi, the product I used is valid and just replaced with com.foobar.demo:demo_1 for discussion.

Already have done device firmware update 1.5.2.12200 to 1.5.3 12460.

Also, confirmed using quickstart browser that I can hub.sync and send / receive messages using (Quickstart - Blues Developers) so know it’s not anything from notecard to notehub.

Hardware using is Adafruit ESP32 Feather with Serial1 for TX, RX and Arduino Library approach.

Just can’t seem to get the feather RX, TX to get replies back from notecarrier/notecard.

What am I missing? Is this timeout issue? Is notecard in a state that I need to reset before it sends replies back to adafruit? Spent 3 days already so far to get to this point… need some assistance please:)

Here is the adruino code:

#include <Notecard.h>

#define serialNotecard Serial1
#define serialDebugOut Serial

#define myProductID “com.foobar.demo:demo_1”
Notecard notecard;

void setup()
{
delay(2500);
serialDebugOut.begin(115200);
notecard.setDebugOutputStream(serialDebugOut);

notecard.begin(serialNotecard, 9600);

J *req = notecard.newRequest("hub.set");
JAddStringToObject(req, "product", myProductID);
JAddStringToObject(req, "mode", "continuous");
notecard.sendRequest(req);

}

void loop()
{
String sync_status = “None”;
J *rsp = notecard.requestAndResponse(notecard.newRequest(“hub.sync.status”));
if (rsp != NULL) {
sync_status = JGetString(rsp, “status”);
notecard.deleteResponse(rsp);
}

serialDebugOut.print("Sync Status = ");
serialDebugOut.println(sync_status);

return;

}

Hi @webuser1, it’s great to have you in the forum!

It looks like you have a good grasp on the software setup, so please help me to review the hardware. When you say you are using the Adafruit ESP32 Feather, are you also using the Notecarrier-AF?

If so, the Feather socket on the Notecarrier-AF only has internal wiring to support the I2C bus, and not Serial. To utilize I2C, you would use notecard.begin() with no parameters. However, if you are not using the Notecarrier-AF, then can you please share which Notecarrier you are using, and a picture of the wiring.

Looking forward to hearing from you.
Zak

1 Like

So using the (Adafruit HUZZAH32 – ESP32 Feather Board) and the (Notecarrier_AA) which uses 3 AA batteries… but after many tries, I took the batteries out and found a spare micro-usb plug to power. Thought there might be some kind of setting when on battery power… idle the communication.

Included is image of wiring with TX to RX, and RX to TX, documentation on Feather says the TX, RX pins on feather are defined for “Serial1”, so don’t think it’s some kind of interrupt of PC to feather communication interfering with Notecarrier to Feather communication on the TX, RX pins.

Still new to IOT but hopefully getting up the learning curve…

First thing I noticed, is that you need a common reference to ground between the ESP32 and the Notecarrier. I assume they are connected to the same PC, so that sorta works, but it’s always a good habit to go ahead and connect the GND pins between the two devices.

TX → RX and RX → TX is correct :+1:

In order to correctly interpret the signals coming from the ESP32, the Notecarrier needs to know the logic level voltage of the ESP32. Remember, you are plugged into USB, so the Notecard is operating at 5V. However, the ESP32 is a 3V3 device. In order to let the Notecard know this, you will need to put a line from the 3V3 pin on the ESP32 to the VIO pin of the Notecarrier.

ESP32 Notecarrier-AA
GND GND
3V3 VIO
RX TX
TX RX

Give that a try and let me know if that helps.

Okay, so made these changes and progress was made…

Also, fixed one user error mistake of using wrong pins for TX, RX on ESP32.

So now the serial monitor says “unrecognized data from notecard”. No more timeout issue.

17:35:45.455 → unrecognized data from notecard
17:35:46.471 → notecard not responding
17:35:47.455 → unrecognized data from notecard
17:35:48.442 → notecard not responding
17:35:49.473 → notecard not responding

So then on the Notecarrier I unplugged micro-usb power to try and switch to battery power… and something happened. The serial monitor started showing… the requests being made? hub.sync.status and hub.set

17:36:19.301 → notecard not responding
17:36:20.287 → notecard not responding
17:36:21.319 → unrecognized data from notecard
17:36:22.287 → notecard not responding
17:36:23.319 → notecard not responding
17:36:24.303 → notecard not responding
17:36:25.335 → {“req”:“hub.sync.status”}

17:36:30.444 → rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
17:36:30.444 → configsip: 0, SPIWP:0xee
17:36:30.444 → clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
17:36:30.444 → mode:DIO, clock div:1
17:36:30.444 → load:0x3fff0018,len:4
17:36:30.444 → load:0x3fff001c,len:1044
17:36:30.444 → load:0x40078000,len:10124
17:36:30.444 → load:0x40080400,len:5856
17:36:30.444 → entry 0x400806a8
17:36:33.820 → {“req”:“hub.set”,“product”:“com.foobar.demo:demo_1”,“mode”:“continuous”}

Then when I put the batteries in the Notecarrier and reset ESP32 the messages go back to “unrecognized data from notecard”

Let’s see if the Notecard is receiving the request at all.

Hardware Setup

  1. Connect the ESP32 Feather to the Notecarrier-AA using the RX/TX pins,
  2. Connect USB port on Notecarrier-AA to laptop/desktop computer
  3. Connect USB port on Feather to laptop/desktop computer

Notecard Debug Trace

Once the Notecard is connected, enter the following requests from a serial terminal.
You can use Notecard Playground - Blues Developers if you have a Chrome-based browser

# filter out all trace information
{"req":"card.trace","trace":"-all"}

# enable just Notecard request/response messages
{"req":"card.trace","trace":"+req"}

# start the trace
{"req":"card.trace","mode":"on"}

As the Notecard requests are made, you will see them appear in this serial terminal. If the request if valid, you should see responses as well. You may also see some error messages.

To halt the trace

# start the trace
{"req":"card.trace","mode":"off"}

For some more information about gathering debug traces, see: How do I capture a trace information from Notecard?

Procedure (Roughly)

Restart the ESP32 program. Gather the debug trace information from the serial terminal connected to the Notecard, along with any info that comes back over the ESP32 debug serial connection, and reply to this thread with those results.

Awesome news! It now works!!! Thanks @zfields and @gwolff for the help in getting this to work. Really appreciate it.

So to diagnose the problem I used a multimeter to identify the voltage from the notecarrier being sent to Adafruit ESP32. In doing this, I discovered a continuity problem with the blue jumper cable.

Below is response to it working. Tried with micro-USB power and Battery power. Both work.

14:02:16.764 → {“req”:“hub.sync.status”}
14:02:16.889 → {“status”:“starting communications {wait-module} {connecting}”,“sync”:true}
14:02:16.889 → Sync Status = starting communications {wait-module} {connecting}

14:02:20.821 → {“req”:“hub.sync.status”}
14:02:20.915 → {“status”:“modem now ON {modem-on}”,“sync”:true}
14:02:20.915 → Sync Status = modem now ON {modem-on}

14:02:35.089 → {“req”:“hub.sync.status”}
14:02:35.230 → {“status”:“obtaining essential configuration information from modem”,“sync”:true}
14:02:35.230 → Sync Status = obtaining essential configuration information from modem

1 Like