Experince with Starter Kit and Tutorials

First. Great details on the tutorials, my compliments.

Second. The Linux hint to apply the python-is python3 patch was a very helpful hint. I had been searching for that for a while.

Suggestions:

  • A VSCode/Codium setup with PlatformIO would be very useful for the millions of those IDEs users (like myself).
  • Display first the full code at the start of the tutorial and then g into the details. Having many separate code blocks to be pasted and looking where the code should be placed is a not so friendly user experience.
  • Add more tutorials.

Issues I was having with the tutorial code:

  1. The two tutorials it was not mentioned the code should be combined to work correctly.
  2. In the code:

With code:
J *req = notecard.newRequest(“hub.set”);
JAddStringToObject(req, “product”, productUID);
JAddStringToObject(req, “mode”, “continuous”);
notecard.sendRequest(req);
in Terminal:
{“req”:“hub.set”,“product”:“biz.yr-design.rob:kittywood”,“mode”:“continuous”}
{“err”:“cannot process request: unrecognized: z.yr-design.rob:kittywood","mode":"…”}

But with:

code:

J *req = notecard.newRequest(“hub.set”);
notecard.sendRequest(req);
req = notecard.newRequest(“service.set”);
JAddStringToObject(req, “mode”, “continuous”);
notecard.sendRequest(req);
req = notecard.newRequest(“service.set”);
JAddStringToObject(req, “product”, productUID);
notecard.sendRequest(req);

In terminal:

i2c reset
{“req”:“hub.set”}
{}
{“req”:“service.set”,“mode”:“continuous”}
{}
{“req”:“service.set”,“product”:“biz.yr-design.rob:kittywood”}
{}

Not sure if this is just the communication transport loosing data or something else is wrong.

1 Like

@robouden, thank you for the suggestions! We will be taking note of those and they will be discussed and prioritized appropriately.

Concerning your request issue, I will present that to the proper internal team, and I will report back in this thread with my findings.

Thank you for sharing your experience, we are glad to have you here!

1 Like

We tried to recreate the request error with your domain, but it was successful for us. Can you provide some more details?

  1. A link to the tutorial were you following.
  2. The OS you are using.
  3. The browser you are using.
  4. The IDE you are using.
  5. The results of {"req","card.version"}
  1. The tutorial I used was at https://dev.blues.io/build/tutorials/sensor-tutorial/notecarrier-af/esp32/arduino-wiring/

  2. OS:Linux Mint 20

  3. Browser: Brave

  4. IDE: Arduino and VSCodium

  5. I will test later.

Based on your error message:

{“err”:“cannot process request: unrecognized: z.yr-design.rob:kittywood”,“mode”:"…"}

…along with what we’ve been able to reproduce here, it appears that the first 30 characters are being dropped. 30 characters is not a random amount of data, it is the length of the default Arduino I2C transaction.

To that end, it appears the first I2C transaction is being lost somewhere along the way. Let’s focus on the details that may affect the I2C transmission.

Can you share the following with me:

  • how are you powering the device
    • battery
    • one or two USB cables (connected to the ESP32, Notecarrier-AF, or both)
  • the version of the Arduino IDE
  • the version of the Notecard library
  • the version of the Notecard firmware ( {"req","card.version"} )

You mentioned you are using both VSCodium and the Arduino IDE. I’m unfamiliar with VSCodium and how that may fit in. Are you writing the software in VSCodium, then using the Arduino IDE to compile and install the binary on the ESP32?

I’m asking because I want to understand all the details of the power supplied to the ESP32, Notecard, and Notecarrier. It seems like either the ESP32 is not ready to send (power or otherwise), and/or the Notecard is not ready to receive the I2C transaction. Both of these seem like potential power supply issues to me.

Once I’ve reproduced your error, then I will attach an oscilloscope and figure out exactly what is happening. Whether it has to do with timing, power or logic.

Zachary,

Answers:

  • The power comes only from the one USB cable connected to the Adafruit Feather32 from my laptop (MacBookPro 2015 running Linux Mint 20).
  • Arduino V1.8.13 and Arduino Nightly build (both tested) and same results.
  • Notecard library “lib_deps = blues/Blues Wireless Notecard@^1.2.8”
  • {
    “body”: {
    “org”: “Blues Wireless”,
    “product”: “Notecard”,
    “version”: “notecard-1.5.2”,
    “ver_major”: 1,
    “ver_minor”: 5,
    “ver_patch”: 2,
    “ver_build”: 12200,
    “built”: “Dec 7 2020 19:28:29”
    },
    “version”: “notecard-1.5.2.12200”,
    “device”: “dev:864475044223815”,
    “name”: “Blues Wireless Notecard”,
    “type”: 11,
    “sku”: “NOTE-NBGL500”
    }

I did some more testing and :

J *req = notecard.newRequest(“hub.set”);
notecard.sendRequest(req);

req = notecard.newRequest(“hub.set”);
JAddStringToObject(req, “mode”, “continuous”);
notecard.sendRequest(req);

req = notecard.newRequest(“hub.set”);
JAddStringToObject(req, “product”, productUID);
notecard.sendRequest(req);

worked fine to.

J *req = notecard.newRequest(“hub.set”);
notecard.sendRequest(req);

req = notecard.newRequest(“hub.set”);
JAddStringToObject(req, “mode”, “continuous”);
JAddStringToObject(req, “product”, productUID);
notecard.sendRequest(req);

worked fine too…

And :

J *req = notecard.newRequest(“hub.set”);
JAddStringToObject(req, “mode”, “continuous”);
JAddStringToObject(req, “product”, productUID);
notecard.sendRequest(req);

Did not work. So It seems to me, that maybe the I2C needs to be initialized first?

Zachary,

After using Arduino for many years I was introduced to PlatformIO and VSCode/VSCodium by an intern at Safecast and since then I only use Arduino of fast simple code checks to see if the code I use, can be used in Arduino too. And I really like the Arduino Serial Plotter (sometimes need) and have not found a good replacement for it yet.

The integration of terminal/GitHub/intelligent suggestions for coding/etc. made me join the millions of VSCode/Codium users. And even when I could public my own theme ( at the marketplace at https://marketplace.visualstudio.com/items?itemName=robouden.robouden-dark) for my own theme, I am not intended to switch back to Arduino for coding.

I have recreated your project, but unfortunately I have not been able to reproduce your issue. The only difference between our setups, is that I am using the Arduino IDE directly.

Here is the code I was using to test:

#include <Notecard.h>

#define serialDebug Serial

#define productUID "biz.yr-design.rob:kittywood"

Notecard notecard;
   
void setup (void) {
  serialDebug.begin(115200);
  while (!serialDebug) {
    ; // wait for serial port to connect. Needed for native USB
  }

  notecard.begin();
  notecard.setDebugOutputStream(serialDebug);

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

void loop (void) {

}

The code above is simple and directly tests the error case. However, the I2C transaction was successful on my hardware and I was unable to reproduce your issue. If you believe the code is too simple or I have missed something, feel free to comment and I will modify to your liking.

Reviewing the tests you ran from your post, it appears the first I2C message is being dropped, which leads me to believe either the Huzzah32 or the Notecard is not ready.

We recommend you to provide an additional USB cable (power only) to the Notecarrier’s micro-USB port. The Notecard draws significant current when attempting to use it’s cellular and GPS capabilities. When powered only through your PC’s USB port, this can cause brown-outs on the host MCU or the Notecard. Once you have additional power supplied to the Notecarrier, then we can be certain the Notecard is fully powered and ready to receive the I2C transaction. Then we could narrow our focus to the MCU.

One of my colleagues has hardware that can reproduce the issue, but he is on holiday so there will be a short delay before he is able to help us.

Zak,

I did run the code on Arduino IDE V1.8.13 and I did get the following error:

17:16:15.909 → {“err”:“cannot process request: unrecognized: z.yr-design.rob:kittywood","mode":"…”}

But with slower serial speed like:

serialDebug.begin(9600);

the response is:

17:44:25.200 → i2c reset
17:44:25.200 → {“req”:“hub.set”}
17:44:26.130 → received NACK on transmit of address
17:44:26.196 → i2c receive error
17:44:26.196 → {“err”:“received NACK on transmit of address”}
17:44:26.262 → i2c reset
17:44:26.262 → received NACK on transmit of address
17:44:26.295 → notecard not responding
17:44:28.187 → i2c reset
17:44:28.220 → {“req”:“hub.set”,“product”:“biz.yr-design.rob:kittywood”,“mode”:“continuous”}
17:44:28.320 → {}
17:44:28.320 →

I tried with two USB cables hooked up too. Same results.

Regards,
Rob

Any suggestions?

Hi Rob! At first glance, it looks like the I2C connection is unstable. But it seems you are using the Notecarrier-AF, which makes that a bit unlikely.

This is a bit of a stretch, but is there any chance you have the Notecarrier resting on a conductive surface that could be touching a couple of solder joints?

I’m brainstorming here, wondering what could cause the i2c to drop out somewhat randomly that we can’t reproduce using the same hardware. The first thought I had is wondering if there is something about the environment that could be causing this behavior.

Gwolff,

Thanks for the reply. The Notecarrier-AF is on standoffs and not touching anything. I notice that there is an update on the Blues libraries to update to V1.2.9. I will have a look and test it on my setup and I will report back.

Regards,
rob

I replace the Blues library at PlatformIO, but when PlatformIO updates, It replaces V1.2.9 with the older v1.2.8 :frowning:

Regards,
rob

I manual replaced Blues V1.2.8 with V1.2.9. And the issue is gone.

Code for testing:

#include <Notecard.h>
#include <Wire.h>
#include <Adafruit_BME680.h>

#define serialDebug Serial
#define productUID “biz.yr-design.rob:kittywood”

Notecard notecard;

void setup (void) {
serialDebug.begin(115200);
while (!serialDebug) {
; // wait for serial port to connect. Needed for native USB
}
notecard.begin();
notecard.setDebugOutputStream(serialDebug);

J *req = notecard.newRequest(“hub.set”);
JAddStringToObject(req, “product”, productUID);
JAddStringToObject(req, “mode”, “continuous”);
notecard.sendRequest(req);
}

void loop (void) {

}

reply:

— Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
— Miniterm on /dev/ttyUSB0 115200,8,N,1 —
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —
i2c reset
{“req”:“hub.set”}
{}

{“req”:“hub.set”,“mode”:“continuous”,“product”:“biz.yr-design.rob:kittywood”}
{}

Temperature = 25 *C
Humidity = 67 %
{“req”:“note.add”,“file”:“sensors.qo”,“start”:true,“body”:{“temp”:25,“humidity”:67}}
{“total”:3}

2 Likes

Great to hear @robouden !