Wire has hung the electron

I was trying to debug an issue I was having with the BME680 (just stopped giving data one day) I just tried to directly do Wire.begin() and Wire.requestFrom(0x76, 6) without using the lib from Adafruit.

However this seems to have broken the electron as it’s not even panicking like it usually does and has gone completly silent.

I have a minor issue with the Electron being located on the other side of the world so not really possible for me to do anything manual.

At this stage I will have to rebuild a new device and send it out to my friend, but this is just more of a warning to anyone using Wire, it seems to be a bit buggy on 0.7.0.

The only piece of code I added at setup() was:

Wire.begin(0x76);
Wire.requestFrom(0x76, 6);
Particle.publish("tbf/debug/i2c", String(Wire.available()), PRIVATE);

I was simply trying to see if I got any response from the I2C bus at all.

Wire.begin(0x76) is used for I2C slave mode, and Wire.requestFrom cannot be used in I2C slave mode.

You want the version of begin without a parameter, which uses the normal I2C master mode. The address you send to is passed in the Wire.requestFrom.

1 Like

Ah, I misread the docs.
But should it hang the electron?
It’s not running the loop or doing anything now, just sitting there with not a peep from it.
I would have expected it to at least go in to panic since I assume it has not run the Particle.process() as there has not been a handshake.