Closed tripzero closed 9 years ago
Can you use i2c in raw mode to check its not an 0 != 7 issue?
Otherwise not sure, can you paste the output of journalctl &| syslog?
Tried with i = mraa.I2c(0, raw=True), same result. Below is the journalctl output:
Aug 07 21:09:47 intel-corei7-64 libmraa[504]: libmraa version v0.7.3 initialised by user 'root' with EUID 0
...
Aug 07 21:18:49 intel-corei7-64 libmraa[504]: i2c: Failed to write
Aug 07 21:18:58 intel-corei7-64 libmraa[504]: i2c: Failed to write
You'd want:
mraa.I2c(7, True) On 7 Aug 2015 22:20, "Kevron Rees" notifications@github.com wrote:
Tried with i = mraa.I2c(0, raw=True), same result. Below is the journalctl output:
Aug 07 21:09:47 intel-corei7-64 libmraa[504]: libmraa version v0.7.3 initialised by user 'root' with EUID 0 ... Aug 07 21:18:49 intel-corei7-64 libmraa[504]: i2c: Failed to write Aug 07 21:18:58 intel-corei7-64 libmraa[504]: i2c: Failed to write
— Reply to this email directly or view it on GitHub https://github.com/intel-iot-devkit/mraa/issues/251#issuecomment-128836394 .
import mraa
i = mraa.I2c(7, True)
i.address(0x40)
i.writeReg(0x00, 0x31)
0
Looks like 0 != 7. How to fix?
What mraa version are you running exactly? Any patches? Can you try with master and see if you can reproduce? I'd also like to see syslog output.
Testing master without any patches I get:
import mraa
i = mraa.I2c(0)
i.address(0x40)
5
i = mraa.I2c(7, True)
i.address(0x40)
0
journalctl sees:
Aug 11 17:14:32 intel-corei7-64 libmraa[495]: libmraa version v0.7.3 initialised by user 'root' with EUID 0 Aug 11 17:14:41 intel-corei7-64 libmraa[495]: i2c: Failed to open requested i2c port /dev/i2c-1264 Aug 11 17:14:41 intel-corei7-64 libmraa[495]: i2c: Failed to get I2C_FUNC map from device Aug 11 17:14:48 intel-corei7-64 libmraa[495]: i2c: Failed to set slave address 64
I installed mraa, while it is problem for me with Invalid I2c bus. Can you help me?
Here's my output from testing:
I'm testing with the max and the pca9685 PWM controller from adafruit. writeReg() returns INVALID_HANDLE (5).
i2cset, however seems to work: