TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: BULLEID@KU.GRO.LIOFF
from: ADRIAN
date: 2019-02-01 16:40:00
subject: Re: i2c problem

In message , Adrian
 writes
>I'm having problems with i2c, and after a couple of hours trying all
>the options that Google throws up, I'm stumped.
>
>Pi 3 4.14.79-v7+
>
>sudo i2cdetect -y 1
>Error: could not open file '/dev/i2c/1': No such file or directory
>
>cat /etc/modules
>i2c-bcm2708
>i2c-dev
>
>tail /boot/config.txt
>
>dtparam=i2c=on
>dtparam=i2c_arm=on
>dtparam=i2c_vc
>device_tree_param=i2c=on1=on
>dtparam=spi=on
>dtparam=i2s=on
>
>/etc/modprobe.d/raspi-blacklist.conf is empty
>
>Any suggestions ?
>
>TIA
>
>Adrian


A bit more digging.

I'm trying to listen to a BME280 sensor (temperature, pressure and
humidity), and there is some Python code available to do so.  That uses
/dev/i2c/1, however, if I alter the code slightly, and tell it to use a
different port (so it points to /dev/i2c-0), I get a different error (no
great surprise) :

Traceback (most recent call last):
   File "bme280_sensor.py", line 9, in 
     bme280.load_calibration_params(bus, address)
   File "/usr/local/lib/python3.5/dist-packages/bme280/__init__.py", line
155, in load_calibration_params
     compensation_params.dig_T1 = read.unsigned_short(0x88)
   File "/usr/local/lib/python3.5/dist-packages/bme280/reader.py", line
40, in unsigned_short
     return self._bus.read_word_data(self._address, register) & 0xffff
   File "/usr/local/lib/python3.5/dist-packages/smbus2/smbus2.py", line
410, in read_word_data
     ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error

sudo i2cdetect -y 0
gives me :

      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

So, does that suggest that the bus is working, or that that I've got the
right bus, but there is no data or what ?

Thanks

Adrian
--
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
Sorry for the rigmarole, If I want spam, I'll go to the shops
Every time someone says "I don't believe in trolls", another one dies.

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.