Collecting Sensor Data (tutorial)

On this Step:
If you’re using PlatformIO, open the Serial Monitor by clicking the plug icon in the bottom of VS Code.

You should see a few debug messages, including the JSON object you sent, as well as the response from the Notecard {}. (Note: You might need to upload your code a second time to see the result of the hub.set request, as the Serial Monitor only captures output when it’s actively running.)

after i got the success messages after running my code. On the monitor task instead of having this:
{“req”:“hub.set”,“product”:“com.blues. tvantoll:weather”, “mode”:“continuous”, “body”:{“a
gent”:“note-arduino”,“compiler”:“gcc 9.2.1 20191025 (release) [ARM/arm-9-branch revisi
on 277599]”,“req_interface”:“i2c”,“cpu_name”:“swan_r5”}}

I got some errors:
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution

Also mine don’t say Monitor task, instead it says PlataformIO.

Hey @Andres18,

Welcome to the Blues community! And sorry you hit an issue here.

To start, could you let me know what firmware version your Notecard is using? (You can get that by running the card.version request.)

Can you also try to power cycle the device to see if this error is happening consistently?

Thanks,
TJ

This is my platformio:
[env:bw_swan_r5]
platform = ststm32
board = bw_swan_r5
upload_protocol = dfu
framework = arduino
build_flags = -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
monitor_speed = 115200
lib_deps =
Wire
blues/Blues Wireless Notecard@^1.6.0

This is my Main CPP:
#include <Arduino.h>
#include <Notecard.h>

#define usbSerial Serial
#define productUID “edu.ncsu.aalop…”

Notecard notecard;

void setup()
{
// initialize digital pin LED_BUILTIN as an output.
delay(2500);
usbSerial.begin(115200);

notecard.begin();
notecard.setDebugOutputStream(usbSerial);

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

}

// the loop function runs over and over again forever
void loop()
{

}

After i run it i get a success messages!!! but the next step to press the serial Monitor and see the request. i see these errors and i can’t establish connection to my bluenotehub . I have connect the USB to the sawn nothing else connect it.

[ERROR] error encountered during I2C transmit hook execution
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution
[ERROR] i2c: received NACK on transmit of data {io}
[ERROR] error encountered during I2C transmit hook execution

Can you run the card.version request using the In-Browser Terminal and paste in what you get back here?

I’d like to see what firmware version your Notecard is using first.

Thanks,
TJ