I2C Uno Master Read, Nano Slave Write

I included the entire .ino file that I have on an Arduino Nano. It should reply to I2C requests from the master, an Uno, by sending the data contained in a variable length (roughly 75 byte) string. I occasionally receive the first 5 to 10 bytes on the Uno, but never the entire string of data. I have tried converting the string into a byte array but no improvement. I have tried pull-up resistors but no improvement. I have researched this for a few days now and I’ve looked at I2C posts on this forum, but still no luck.

I also included the Master code, since the problem might be there too.

I can do the Master Read, Slave Write example (sending Hello) and that does work.

I could use advice. Ultimately, I want to send this project up in a High Altitude Balloon. The slave unit will do all of the GPS and sensor reading, and the Master will control the radio and other tasks.

Thank you,


I2C_Master.ino (341 Bytes)

This is the main code for the Nano Slave Sender. I know it’s long but I worried that removing parts of it would be removing part of the problem.

GPS_Nano_I2C_Slave9.ino (5.96 KB)

Well, I discovered the 32 byte limit of Wire.write() so it appears I will need to split my data up into smaller chunks, and tell the master to request data multiple times, until it receives a certain flag character. Perhaps each group of data will be 30 bytes, with the last group being padded to fill up the 30 byte request. Maybe add a CRC in the final group.