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

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 274|Reply: 0

I2C on 2G-IoT

[Copy link]

1

Threads

1

Posts

15

Credits

Novice

Rank: 1

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

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                       
                        updated:2018-02-07


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 pi_logo.py --port 2
  2. Traceback (most recent call last):
  3.   File "pi_logo.py", line 3, in <module>
  4.     from demo_opts import device
  5.   File "/root/ssd1306/examples/demo_opts.py", line 33, in <module>
  6.     device = Device(port=args.port, address=args.address)
  7.   File "/root/oledenv/local/lib/python2.7/site-packages/oled/device.py", line 179, in __init__
  8.     const.DISPLAYON)
  9.   File "/root/oledenv/local/lib/python2.7/site-packages/oled/device.py", 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/smbus2.py", 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!?
Thanks








This post contains more resources

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

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

Points Rules

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

2019-9-19 18:53 GMT+8 , Processed in 0.029268 second(s), 24 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list