Thank you @György-Farkas for detailed answer.
I've tried this ADC (on demo board) on Arduino and also received nothing.
I think that this board is broken.
I bought ADS1115 and now I can smoothly read from photodiode :)
If somebody will need that in future guys from Control Everything Community made working python example for Omega2.
(or at least it's working in my case with FW: 0.2.0 b191)
@Aurélien-Fi At the end of the day, the MT7688 chip in the Omega2 is really targeted in in a router, access point, or similar. It's good at connectivity (Wifi AP and client, ethernet), but not at things like cameras or displays.
The chip in a Raspberry Pi is the opposite - note that a Pi Zero doesn't have any way to connect Ethernet, but has HDMI, a camera interface, and USB device support.
My point here is that different processors have built-in hardware support that will make some things easier than others. The Pi Cameras are only so cheap because of the dedicated hardware in Pi.
So, this isn't something the Omega2 will be really great at doing. That said, there are ways. The main issue is one of bandwidth - I2C isn't that fast, so I'd look at SPI, UART, or especially USB. I think the Omega2S even breaks out PCIe, which opens lots of possibilities.
@Maximilian-Gerhardt wow! Thank you very much for your response, at least I don't have the feeling like I'm shouting into an empty cave!
I'm surprised at how beta the i2c library is for something that's been out for ~years. I feel like the first feature for boards like this (after GPIO control on its own pins) should be a matured and robust i2c library. Since, almost anything you want to do with them will require i2c communication...
Again, thank you for the heads up with known issues. I'll try to keep stumbling through this and if I succeed I'll make it available.
@OSO-Bear Judging by the output of the program and your makefile, it looks like your program was compiled for x86 (your computer). You'll have to use an xCompile.sh script like the example to cross compile your C program.
PS it's three backticks to open a code block, and three to close it. See this link for more markdown syntax.
@Paul-Cousins Let's suppose the Arduino Dock 2 and its HW environment on your IoT ONE board are perfect.
So your Arduino SW - almost certainly - has some bug(s).
You should debug it instead of restart the Omega's I2C master from time to time - I think.
The i2c bus is active low. Data is transmitted by pulling the data line to ground. When the data line isn't in use it floats to the supply voltage of the bus master.
In this case, everything is OK as you're powering the sensor off the 3v3 Omeaga supply.
If you needed to use a sensor that has (say) a 5v supply, then you have several options.
use a bidirectional opto isolator on tha data line. Only the clock and gnd are connected together.
use a bidirectonal level shifter to conver between the 5v and 3v3 systems , again only the clock and gnd are connected together.
the bus is driven by the master, and its voltage levels. You don't have to do anything special as 5v should never get anywhere near the data lines, and the sensor will pull the data line to gnd when it transmits data (connect the data, clock and gnd together).
Option1is the safest, the Aruinodo dock v2 uses option2 , but I've used option 3 to hook RPIs to Arduinos over i2c, with different supply voltages without anything going bang. The RPi (like the Omega) is a bus master and controls the line levels.
One caveat is if the sensor has pullup resistors to the supply line, so check any circuit diagrams if they are available.