Please select To the mobile version | Continue to access the desktop computer version


Hot search: orangepi
View: 1065|Reply: 0

I2C on 2G-IoT

[Copy link]








Rank: 1

Post time 2019-7-13 22:29:12 | Show all posts |Read mode

I tried toaccess i2c-bus on he 2G-IoT Board to interface an OLED display. With theOrangepi zero H2+ I already had success. I used this manual:

I used the latest Image:
Ubuntu Server                       

I'accessing the board by uart and putty.

The 2G-IoT board has, according to its pinout two i2c-busses. I’m using bus 2. First I leti2cdetect run and it shows me the display connect with address 3c. However, itperforms really slow, about 1 sec per address. Orangepi zero had searched alladdresses within 1 second.
Nextstrange thing is, if I manually write to /dev/i2c-2 I get anerror:

  1. root@orangepi:~# echo hello >> /dev/i2c-2
  2. -bash: echo: write error: Operation not permitted
Copy the Code
its seems that i cant really write to the bus. However, the display is flickering shortly after I entered the command and shows noise, disordered dots and turns off.

  1. <font color="White"><span style="background-color: black;">(oledenv) root@orangepi:~/ssd1306/examples# python --port 2
  2. Traceback (most recent call last):
  3.   File "", line 3, in <module>
  4.     from demo_opts import device
  5.   File "/root/ssd1306/examples/", line 33, in <module>
  6.     device = Device(port=args.port, address=args.address)
  7.   File "/root/oledenv/local/lib/python2.7/site-packages/oled/", line 179, in __init__
  8.     const.DISPLAYON)
  9.   File "/root/oledenv/local/lib/python2.7/site-packages/oled/", line 73, in command
  10.     self.bus.write_i2c_block_data(self.addr, self.cmd_mode, list(cmd))
  11.   File "/root/oledenv/local/lib/python2.7/site-packages/smbus2/", line 482, in write_i2c_block_data
  12.     ioctl(self.fd, I2C_SMBUS, msg)
  13. IOError: [Errno 1] Operation not permitted</span></font>
Copy the Code
Same error here, display flashes shortly and turns off.

Do I have to enable i2c somehow, I have the feeling, that the OS or a device driver is blocking the calls!?

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2020-5-29 05:57 GMT+8 , Processed in 0.030713 second(s), 24 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list