Open halfer opened 1 year ago
Ah, so it's not PHP 8.2 - I have just reset to PHP 8.1, and I get the same error (with of course the modified Zend year/version number in the directory).
From a bit of research, it looks like there is a class of I2C functions that have been removed from Linux modules, so would guess I would need to link to an earlier version.
More information here: https://github.com/hallard/ArduiPi_OLED/issues/15#issuecomment-322444243
Hi @halfer , sorry for the radio silence, days have been a bit busy on this end. The error is indeed a difference between the kernel version against which you compiled the extension and the kernel version you are running it on. Would you please let me know each version so I can take a look at the changes?
No worries, thank you. As it happens I was trying to solve a problem the wrong way anyway - it turns out that I need to talk to the MCP2221 via USB, which will issue I2C commands on my behalf!
Let me get the information I think you need. First the kernel:
uname --all
Linux raspberrypi 6.1.23-v8+ #1642 SMP PREEMPT Mon Apr 3 17:42:16 BST 2023 aarch64 GNU/Linux
I have done the build and the run on the same Raspberry Pi 3B.
I wonder if you need information about libi2c, but I can't find it - I thought it would be available via lsmod
. Do let me know what you need, and how I can get it.
Ah, just looking at modinfo i2c_dev
- vermagic
gives me 6.1.28-v8+
, though I note this is slightly different to the uname
line above.
it turns out that I need to talk to the MCP2221 via USB, which will issue I2C commands on my behalf!
Indeed that's the case! Sorry that I did not mention that before, the error got my full attention and I left that behind.
as to kernel and module version, I'll do some research here
I am working on a project on a Raspberry Pi 3 that combines a MCP2221 chip with a ST7789V2 LCD panel. The first of these connects to the Pi via USB, and connects to the LCD via a Grove/Stemma wire. I'd like to be able to write graphics primitives to the panel from USB.
I have installed PHP 8.2 on the latest Raspberry Pi OS via the additional "Sury" repo, this seems fine.
I then went through the ext-i2c build steps and I can see
i2c
in myphp -m
.I am using this resource to understand what bytes to send to the LCD panel. I think I need to communicate in raw I2C, but I have very little idea of what I am doing!
I know the LCD device has a default wire address of 0x3e.
For the 0x04 command (get firmware version) I believe I need to send one byte and get back four. I am trying to do it with this code (typed by hand, I don't have a GUI on the Pi):
When I run this I get a low-level error:
Should I try PHP 8.1? Might my ext-i2c build have been defective?