Problems WITH interface with the Nicla Sense ME using the ESLOV connector MKR1010

I'm having troubleshooting using this tutorial https://docs.arduino.cc/tutorials/nicla-sense-me/use-as-mkr-shield#next-steps, is really basic but when I open the serial monitor it doesn't show anything, I'm trying to use the ESLOV cable and I replace the NICLA_AS_SHIELD by NICLA_VIA_ESLOV but not results at all then I found this post about troubleshooting and in fact my cable is 30 cm long I think is the one included with Nicla. So I'm not sure what to do

Hi @fullmakeralchemist

Do you have the port of the MKR WiFi 1010 board selected in Arduino IDE when you opened Serial Monitor?

It can be a little confusing because the tutorial has us uploading sketches to two different boards on two different ports. In this case, it is the MKR WiFi 1010 that is the "host" communicating with the computer. The Nicla Sense ME board is only communicating via I2C so you won't see any serial communication if you have the Nicla Sense ME board connected to your computer with a USB cable and have that port selected in Arduino IDE.

Yes I open serial monitor with the MRK WiFi 1010

Try uploading this variation of the host sketch to your MKR WiFi 1010. The sketch from the tutorial doesn't check the result of the initialization calls in setup. I just added some extra serial output to give insight into whether those initialization calls are successful. If one of those were hanging that would explain the symptom you experienced of no serial output (I didn't actually look into the library code to see whether there is a condition where that could occur).

#include "Arduino.h"
#include "Arduino_BHY2Host.h"

SensorXYZ accel(SENSOR_ID_ACC);

void setup() {
  // debug port
  Serial.begin(115200);
  while (!Serial) {}

  Serial.print("Initializing BHY2Host: ");
  if (!BHY2Host.begin(false, NICLA_VIA_ESLOV)) {
    Serial.println("FAILED");
    while (true) {}  // Do not proceed with program.
  }
  Serial.println("success");

  Serial.print("Initializing accelerometer: ");
  if (!accel.begin()) {
    Serial.println("FAILED");
    while (true) {}  // Do not proceed with program.
  }
  Serial.println("success");
}

void loop() {
  static auto printTime = millis();
  BHY2Host.update();

  if (millis() - printTime >= 1000) {
    printTime = millis();
    Serial.println(String("Acceleration values: ") + accel.toString());
  }
}

My cable is 50 cm long and I am getting the expected results of acceleration data printed at 1 Hz after uploading the code from the tutorial to my MKR WiFi 1010 and Nicla Sense ME interconnected via the Eslov cable.

actually now appears this:

Initializing BHY2Host: success
Initializing accelerometer:

but nothing else like data

Thanks

not working maybe can you send me the code in Nicla? the one you have

It is the sketch from the tutorial, with the only different being that I changed the NICLA_AS_SHIELD parameter in the BHY2.begin call to NICLA_VIA_ESLOV:

https://docs.arduino.cc/tutorials/nicla-sense-me/use-as-mkr-shield#4-program-the-nicla-sense-me

#include "Arduino.h"
#include "Arduino_BHY2.h"

// Set DEBUG to true in order to enable debug print
#define DEBUG false

void setup(){
#if DEBUG
  Serial.begin(115200);
  BHY2.debug(Serial);
#endif

  BHY2.begin(NICLA_I2C, NICLA_VIA_ESLOV);
}

void loop(){
  // Update and then sleep
  BHY2.update(100);
}

Hi bro actually it still don't show anything I thing is the cable so when I get a new cable I'll try it again