Skip to main content
13 events
when toggle format what by license comment
Mar 2, 2018 at 1:27 comment added Janka Maybe you are missing these include files in your installation? They belong to the linux-libc-dev package in Raspbian.
Mar 2, 2018 at 1:22 comment added Brandon Williams Gcc filename.c -o exfilename
Mar 2, 2018 at 1:19 comment added Janka If you recompiled it with the additional includes, it should compile with no warnings at all. Sometimes -std=c99 is required, this depends on the compiler you used. You did gcc this on the Raspi, didn't you? Because an x86 binary won't run on the Raspi.
Mar 2, 2018 at 1:08 comment added Brandon Williams It gave me warnings originally during compilation about "assignment from incompatible pointer type" for i2c_transfer.msgs =i2c_msgs;, could that be the issue?
Mar 2, 2018 at 1:00 comment added Janka Hmm, that's unfortunate, because it works for me (with another chip at 0x50). Try running it with a debugger to find the culprit: gdb ./i2ctest2, then run at the gdb prompt.
Mar 2, 2018 at 0:44 comment added Brandon Williams After compilation, ./i2ctest2 (named it that with gcc -o) results in a Segmentation Fault
Mar 2, 2018 at 0:30 comment added Janka Please add #include <sys/ioctl.h> and #include <linux/i2c.h> to the list of includes. Unfortunately, the explicit includes needed change with each API version.
Mar 2, 2018 at 0:29 history edited Janka CC BY-SA 3.0
added 56 characters in body
Mar 1, 2018 at 23:42 comment added Brandon Williams In the code, i get several errors. The first is the struct i2c_msg i2c_msgs[2]; gets an error saying the array type has and incomplete element type. And secondly, did you mean something else than I2C_M_RD like something from here
Mar 1, 2018 at 21:30 comment added Janka If you are confused, what the kernel driver does is S,0x70WR, 0x08,S,0x70RD,xx,xx,xx,xx,xx,xx,P
Mar 1, 2018 at 21:28 comment added Janka The code on that site pocketmagic.net/mics-vz-89-air-quality-sensor says it's 6 bytes to read.
Mar 1, 2018 at 21:15 comment added Brandon Williams Are we ignoring the 7th byte since you defined length of rdata array as 6?
Mar 1, 2018 at 21:02 history answered Janka CC BY-SA 3.0