I am trying to work with the (new) sparkfun razor IMU 9dof, I wrote a silple sktetch to calibrate the magnetometer:
#include <SparkFunMPU9250-DMP.h> // Include SparkFun MPU-9250-DMP library
#include <Wire.h> // Depending on your Arduino version, you may need to include Wire.h
MPU9250_DMP imu; // Create an instance of the MPU9250_DMP clas
void setup() {
Serial.begin(115200);
Serial.println(F("Adafruit 10 DOF Board AHRS Calibration Example")); Serial.println("");
if (imu.begin() != INV_SUCCESS){
while (1) {
Serial.println("Failed to initialize MPU-9250, loop forever");
}
}
imu.setGyroFSR(2000); // Set gyro to 2000 dps
imu.setAccelFSR(2); // Set accel to +/-2g
imu.setLPF(5); // Set LPF corner frequency to 5Hz
imu.setSampleRate(100); // Set sample rate to 10Hz
imu.setCompassSampleRate(100); // Set mag rate to 10Hz
}
void loop(void){
imu.update();
// Print the sensor data
Serial.print("Raw:");
Serial.print(imu.ax);
Serial.print(',');
Serial.print(imu.ay);
Serial.print(',');
Serial.print(imu.az);
Serial.print(',');
Serial.print(imu.gx);
Serial.print(',');
Serial.print(imu.gy);
Serial.print(',');
Serial.print(imu.gz);
Serial.print(',');
Serial.print(imu.mx);
Serial.print(',');
Serial.print(imu.my);
Serial.print(',');
Serial.print(imu.mz);
Serial.println();
delay(50);
}
To be sure the Arduino IDE can access to dev/ttcACM0, I did sudo chmod 666 /dev/ttyACM0
I can dowload successfully but when I want to open the terminal I got the following error:
Erreur d'ouverture du port série « /dev/ttyACM0 ». (Port busy) (see attached screenshot)
More over when I entered dmesg on the console, I can see the following messages:
[ 94.133923] usb 3-2: USB disconnect, device number 2
[ 94.133978] cdc_acm 3-2:1.1: urb 12 failed submission with -19
[ 94.135862] cdc_acm 3-2:1.1: urb 13 failed submission with -19
[ 94.136059] cdc_acm 3-2:1.1: urb 14 failed submission with -19
[ 94.136257] cdc_acm 3-2:1.1: urb 15 failed submission with -19
[ 94.136457] cdc_acm 3-2:1.1: urb 2 failed submission with -19
[ 94.136656] cdc_acm 3-2:1.1: urb 3 failed submission with -19
[ 94.136852] cdc_acm 3-2:1.1: urb 5 failed submission with -19
[ 94.137048] cdc_acm 3-2:1.1: urb 6 failed submission with -19
[ 94.138841] xhci_hcd 0000:03:00.0: WARN Cannot submit Set TR Deq Ptr
[ 94.138843] xhci_hcd 0000:03:00.0: A Set TR Deq Ptr command is pending.
[ 94.931853] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[ 95.316578] usb 3-2: New USB device found, idVendor=1b4f, idProduct=9d0f
[ 95.316581] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 95.316582] usb 3-2: Product: SFE 9DOF-D21
[ 95.316584] usb 3-2: Manufacturer: SparkFun
[ 95.320306] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[ 858.774849] usb 3-2: USB disconnect, device number 3
[ 904.529058] TCP: wlp1s0: Driver has suspect GRO implementation, TCP performance may be compromised.
Does anyone outhere experienced such issue?
Thank you for your help
Fabrice
modemmanager
package.lsof | grep ttyACM
to see which process is holding the port (might possibly need to run lsof as root, but try it first as yourself)