[ 41874][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1
I am using altimeter sensor, MPL3115A2 for measuring the height, but I get the above error for output. Can anyone explained to me what is this error and how to solve this problem? I worry that the error will affect the height reading of the sensor.
Did you write the MPL3115A2 code yourself or are you using a library?
The only reference i Can find it
opened 11:19PM - 06 Oct 22 UTC
closed 01:26AM - 08 Oct 22 UTC
Area: Peripherals API
Area: Libraries
### Board
ESP32-S3 DevKitC-1
### Device Description
ESP32-S3 Dev-Kit C attach… ed to my Windows 10 PC
### Hardware Configuration
MPU6050 IMU Chip is connected to ESP32-S3 (SDA = GPIO 8, SCL = GPIO 9)
### Version
latest master (checkout manually)
### IDE Name
VSCode with Platform.IO
### Operating System
Windows 10
### Flash frequency
40MHz (No idea, i never changed it)
### PSRAM enabled
no
### Upload speed
460800
### Description
I have a project that reads an IMU using i2c. This project is written with VS Code and Platform.IO plug-in with Arduino framework.
I can compile, upload and run my project and everything works beautifully with ESP32.
Unfortunately, the ESP32 does not support USB HID, so I decided to move up to the ESP32-S3.
I updated my platform.ini for the ESP32-S3. After compiling and uploading my project into the ESP32-S3,
the ESP32-S3 keeps printing out:
```
[549186][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549204][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549216][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549231][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549246][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
```
My connection is: SDA = GPIO 8, SCL = GPIO 9.
Has anyone been able to migrate their VS Code with Platform.IO from ESP32 to ESP32-S3?
What am i missing?
### Sketch
```cpp
Calling wire.requestFrom() causes error.
```
### Debug Message
```plain
[549186][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549204][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549216][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549231][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
[549246][E][Wire.cpp:513] requestFrom(): i2cRead returned Error -1
```
```
### Other Steps to Reproduce
_No response_
### I have checked existing issues, online documentation and the Troubleshooting Guide
- [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Code:
#include <Wire.h>
#include <Adafruit_MPL3115A2.h>
Adafruit_MPL3115A2 baro = Adafruit_MPL3115A2();
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("\n\n========= Height of Flying Drone =========");
if (! baro.begin())
{
Serial.println("Invalid Input!!");
return;
}
float altm = baro.getAltitude();
Serial.print(altm);
Serial.print(" meters\n");
delay(1000);
}
This is my code.
I used the library, Adafruit_MPL3115A2.
FYI, the board that I am using is ESP32 dev board, and PlatformIO.
Is see, that uses the Adafruit I2C_Device abstraction layer instead. Please file an issue in https://github.com/adafruit/Adafruit_MPL3115A2_Library/issues with your error message.
Ok, already asked question there, thanks for helping <3