MCP3428 reading in round-robin instead of each inputs

I have a 4-Channel I2C 4-20mA Current Receiver with I2C Interface module connected to an Onion Omega2+.

The module has 3x 4-20mA ultrasonic sensors connected (IN1, IN2, IN3) to it that measure known distance. Each sensor has a different distance just for testing.

I used the example code in https://github.com/ControlEverythingCommunity/MCP3428/blob/master/Onion%20Omega%20Python/MCP3428_4Channel.py

Here is the output running the code multiple times:

root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 758
Digital Value of Analog Input on Channel-2: 758
Digital Value of Analog Input on Channel-3: 758
Digital Value of Analog Input on Channel-4: 758
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 1049
Digital Value of Analog Input on Channel-2: 1049
Digital Value of Analog Input on Channel-3: 1049
Digital Value of Analog Input on Channel-4: 1049
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 441
Digital Value of Analog Input on Channel-2: 441
Digital Value of Analog Input on Channel-3: 441
Digital Value of Analog Input on Channel-4: 441
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 758
Digital Value of Analog Input on Channel-2: 758
Digital Value of Analog Input on Channel-3: 758
Digital Value of Analog Input on Channel-4: 758
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 1048
Digital Value of Analog Input on Channel-2: 1048
Digital Value of Analog Input on Channel-3: 1048
Digital Value of Analog Input on Channel-4: 1048
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 441
Digital Value of Analog Input on Channel-2: 441
Digital Value of Analog Input on Channel-3: 441
Digital Value of Analog Input on Channel-4: 441
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 758
Digital Value of Analog Input on Channel-2: 758
Digital Value of Analog Input on Channel-3: 758
Digital Value of Analog Input on Channel-4: 758
root@Omega-2781:~# python test4.py
Digital Value of Analog Input on Channel-1: 10
Digital Value of Analog Input on Channel-2: 10
Digital Value of Analog Input on Channel-3: 10
Digital Value of Analog Input on Channel-4: 10

And It seems to be reading the same channels on each runs in a random or round-robin fashion…

Any hints on what I am doing wrong here ?

I have tested various incarnations of the python code and it’s always the same.

Thanks.

Hmmm just found this: https://github.com/bhaskar-anil429/Onion-Omega-2-4-20mA-Current-Receiver/blob/master/4_4-20mA.py

And it seems to work much better:

root@Omega-2781:~# python test5.py
Current Input at Channel One is    : 4.884
Current Input at Channel Two is    : 8.376
Current Input at Channel Three is  : 11.580
Current Input at Channel Four is   : 0.111
Current Input at Channel One is    : 4.884
Current Input at Channel Two is    : 8.376
Current Input at Channel Three is  : 11.580
Current Input at Channel Four is   : 0.111
Current Input at Channel One is    : 4.884
Current Input at Channel Two is    : 8.376
Current Input at Channel Three is  : 11.580
Current Input at Channel Four is   : 0.111
Current Input at Channel One is    : 4.884
Current Input at Channel Two is    : 8.376
Current Input at Channel Three is  : 11.580
Current Input at Channel Four is   : 0.111

Matching what I would expect.