Hi
after changing TWI_BUFFER_MAX in (C:\Users\user\AppData\Local\Arduino15\packages\rak_rui\hardware\apollo3\4.0.0\cores\apollo3\component\rui_v3_api) Wire.h I still continued to receive only 32 Bytes on RAK11720
Using: RAKwireless RUI Apollo3 Boards V. 4.0.0
Code
#define DEVICE_ADDRESS 0x10
#define REGISTER_POINTER 0xA0
#define DATA_LENGTH 64
/** Packet buffer for sending */
uint8_t collected_data[64] = { 0 };
void setup() {
Serial.begin(115200, RAK_AT_MODE);
Serial.println("Test I2C");
Serial.println("------------------------------------------------------");
// Start BLE UART advertisement for ever
api.ble.settings.blemode(RAK_BLE_UART_MODE);
api.ble.advertise.start(0);
Wire.begin(); // join i2c bus (address optional for master)
Wire.setClock(400000);
// Initialize the I2C communication
}
void requestdata() {
Wire.beginTransmission(DEVICE_ADDRESS);
Wire.write(byte(0xA0));
delay(10);
Wire.endTransmission();
Wire.requestFrom(DEVICE_ADDRESS, DATA_LENGTH); // Request 54 bytes from the device
int i = 0;
while (Wire.available()) {
collected_data[i] = Wire.read(); // Read each byte and store it in the array
i++;
}
Serial.printf("number of data: %d ", i);
Serial.println("Data Packet:");
for (int i = 0; i < DATA_LENGTH; i++) {
Serial.printf("0x%02X ", collected_data[i]);
}
Serial.println("");
}
void loop() {
requestdata();
delay(4000);
}