I’ve been trying all day, but can’t seem to change the I2C buffer on my Boron. I just updated the OS firmware to 5.3.0 and thought that would do it, but the I2C data from my sensors is still being cutoff. I only need a few more bytes
I’ve tried my best to follow the guides/solutions in these threads:
Have you tried it with this line active (not commented)?
BTW, this line is not required
Particle.h already does that for you.
But most confusing for me is the fact that you setup your Boron as a I2C slave but then mention that you expect to read data from your sensors, which would require your Boron to be running as master.
Yes, I am also confused about the use the I2C slave mode, that’s almost never the way you communicate with an I2C sensor.
If you have a sensor connected to another device that’s the I2C master connecting to the Particle I2C slave, make sure you increase the buffer size on the master device as well, because the master side can also truncate the data. Arduino devices often default to 32 bytes.
I have tried it with that line uncommented, but received the same results.
Yes, it’s a bit of a weird setup. The Boron is connected to an Arduino Micro over I2C. The Micro is running a system of sensors independently of the Boron. It’s a prototype, so to hack in cell data transfer, I’m just having the Micro send the data collected to the Boron for cell data transmission.
Ah! I hadn’t thought of the I2C output buffer of the Arduino Micro also being limited, but yes also seems to be limited to 32 bytes. I had only verified the Arduino was outputting the correct data with the Serial monitor.
Regarding I2C setup, see response above. The Boron is essentially acting as an I2C slave to the Arduino Micro to simply publish data to the particle cloud.
Since this was a prototype for a client who didn’t know exactly what they wanted, cell data transmission was added as an afterthought. I designed around an Arduino Micro, and added the Boron for cell data later. Luckily the client is open to using Particle for future designs, and I’ll be designing natively around a particle cell module instead of a Micro for the next iteration.
Sadly, since increasing the I2C buffer on Arduino requires a library change, I have to suck it up and send the data in chunks. Otherwise I’d have to have the client upload with a custom Wire.h library as well. I was just being stubborn.
I’ve ran into this same issue using Arduino’s and specifically the wire library, IIRC they limit each write/read to 32 bytes. You have to go into the library files and increase the buffer size or use a different I2C library. It’s been a while since I had to do this, but if you google increasing wire buffer size or something along those lines you should be able to figure it out where to change the library. Good luck.
I first tried Serial between the 2 Micro USB ports on each board, but USB requires a host and both devices are clients. So that didn’t work. There a sensor on the UART, so I didn’t want to interfere with that. I2C was ideal because of addressing.
I can just send the data as two packets and concatenate them on the Boron side. Almost have that working. But I appreciate the ideas