I can't send sensor readings to slave via I2C but can send set variable values.

I’ve connected an Arduino MEGA (Master) to an MKR1010 (slave) using I2C to send various environmental data to my MKR and then Arduino Cloud.

The I2C communication appears to work as expected although the measured variables appear to stop updating once the MKR connects to the Arduino Cloud. So far I’ve been able to narrow down to be where I believe the problem occurs which is at the ArduinoCloud.update(); statement or somewhere within the reciveEvent function.

However the ArduinoCloud.update(); statement is required to update the variables used for the Arduino cloud’s dashboard variables.

I suspect that the problem has something to do with me using I2C in general or the I2C_Anything library which is used to send data larger than bytes. Which updates the variables measured in the void function receiveEvent.

Any help or potential insight as to what the problem may be are would be highly appreciated :slight_smile:

I2C_MKR1010_With_Arduino_Cloud.zip (11.8 KB)


I've managed to work around the problem, it appears that the code continues to work when connected to the arduino cloud when using the standard Wire.h library for I2C but not the I2C_Anything library. I still haven't figured out what specifically causes the bug but it is certainly related to this library.

I know no one has replied to this problem but hopefully this will provide others with future insight and save time on this problem if it becomes pparent for them too :slight_smile: