please choosego to mobile | Continue to access the PC version
View: 4283|Reply: 1

I2C on 2G-IoT

[Copy link]

1

threads

1

posts

15

credits

Novice

Rank: 1

credits
15
Published in 2019-7-13 22:29:12 | Show all floors |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 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 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 thread contains more resources

You need to Log in to download or view,No account?    Register

x

1

threads

647

posts

1699

credits

Gold member

Rank: 6Rank: 6

credits
1699
Published in 2024-4-7 19:23:27 | Show all floors
Document thrilled along with the researching you will designed to makes precise put up impressive. Delightful adventure!        Pharmaceutical Sales jobs
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list