i2c register addresses #327
Replies: 17 comments 10 replies
-
What is the part number of this device ? (I will search for a datasheet ) |
Beta Was this translation helpful? Give feedback.
-
Here's the error.. appears to be a problem in pigpio which doesn't seem to have been updated for serveral years
|
Beta Was this translation helpful? Give feedback.
-
I don't know how that string of bits are used without finding the associated code. But you questioned if that was the device address as it was too great a value. Looking at the web page you identified : You can use the command i2cdetect -y 1 to confirm the device address. I could not find a datasheet for this device so your intent to read existing code is needed to write the java code. I looked at the python code from the web page: If you used this python, the same work is required to understand python code and write the corresponding java code. Maybe you prefer using the cpp. Adafruit_CircuitPython_seesaw/examples/seesaw_rotary_neopixel.py Adds function of monitoring a gpio for interrupts (gpio listener) and controlling a Neopixel LED. |
Beta Was this translation helpful? Give feedback.
-
At this point I pretty well know what I’m doing and I know where the 0x36 goes and I’ve looked around enough to know that pi4j does not support two byte register addresses which is different than the I2c bus address 0x36. It’s a problem for several others that have devices that require two byte REGISTER addresses. ---------------------------------Ronald T. ***@***.*** NHOn Feb 20, 2024, at 5:57 PM, Tom Aarts ***@***.***> wrote:
Pi4j does support multibyte writes to set the device address during a write/read operation. You can code it and compile but u must use linuxfs provider to execute the code. The error message u show leads me to think you are not passing a device address of 0x36 but a greater value
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Pi4 does support two byte address access to an i2c device
On Tue, Feb 20, 2024 at 8:09 PM RonaldTHerman ***@***.***>
wrote:
… At this point I pretty well know what I’m doing and I know where the 0x36
goes and I’ve looked around enough to know that pi4j does not support two
byte register addresses which is different than the I2c bus address 0x36.
It’s a problem for several others that have devices that require two byte
REGISTER addresses. ---------------------------------Ronald T. ***@***.***
NHOn Feb 20, 2024, at 5:57 PM, Tom Aarts ***@***.***> wrote:
Pi4j does support multibyte writes to set the device address during a
write/read operation. You can code it and compile but u must use linuxfs
provider to execute the code. The error message u show leads me to think
you are not passing a device address of 0x36 but a greater value
—Reply to this email directly, view it on GitHub, or unsubscribe.You are
receiving this because you authored the thread.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK5A3275NKSE5C4IPG5ZOADYUVJNNAVCNFSM6AAAAABDP7D626VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKMZXGMYTC>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
No it doesn’t. You obviously haven’t spent much time with it ---------------------------------Ronald T. ***@***.*** NHOn Feb 20, 2024, at 10:40 PM, Tom Aarts ***@***.***> wrote:
Pi4 does support two byte address access to an i2c device
On Tue, Feb 20, 2024 at 8:09 PM RonaldTHerman ***@***.***>
wrote:
At this point I pretty well know what I’m doing and I know where the 0x36
goes and I’ve looked around enough to know that pi4j does not support two
byte register addresses which is different than the I2c bus address 0x36.
It’s a problem for several others that have devices that require two byte
REGISTER addresses. ---------------------------------Ronald T. ***@***.***
NHOn Feb 20, 2024, at 5:57 PM, Tom Aarts ***@***.***> wrote:
Pi4j does support multibyte writes to set the device address during a
write/read operation. You can code it and compile but u must use linuxfs
provider to execute the code. The error message u show leads me to think
you are not passing a device address of 0x36 but a greater value
—Reply to this email directly, view it on GitHub, or unsubscribe.You are
receiving this because you authored the thread.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK5A3275NKSE5C4IPG5ZOADYUVJNNAVCNFSM6AAAAABDP7D626VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKMZXGMYTC>
.
You are receiving this because you commented.Message ID:
***@***.***>
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@RonaldTHerman your error message contains pigpio, which means it is not using the linux-fs provider. Can you please try the linux-fs provider? Here is the documentation: https://pi4j.com/documentation/providers/linuxfs/ |
Beta Was this translation helpful? Give feedback.
-
@RonaldTHerman Would you please again review the interface I suggested and let us know how it fails to provide for your usage. I wrote : The parameter register is an array of bytes. The number of bytes supplied is not restricted. What ever number bytes are in the array are all written to the device and then a restart and bytes from the device I use this interface to access a large capacity EEPROM. The datasheet reads For all operations except the current address read, two 8‑bit word address bytes must be transmitted to the device |
Beta Was this translation helpful? Give feedback.
-
are you doing this on a raspberry pi?
… On Feb 21, 2024, at 12:53 PM, Tom Aarts ***@***.***> wrote:
@RonaldTHerman <https://github.com/RonaldTHerman> Would you please again review the interface I suggested and let us know how it fails to provide for your usage. I wrote : The parameter register is an array of bytes. The number of bytes supplied is not restricted. What ever number bytes are in the array are all written to the device and then a restart and bytes from the device
*/
@OverRide <https://github.com/OverRide>
public int readRegister(byte[] register, byte[] buffer, int offset, int length) {
I use this interface to access a large capacity EEPROM. The datasheet reads For all operations except the current address read, two 8‑bit word address bytes must be transmitted to the device
immediately following the device address byte. The word address bytes consist of the 16‑bit memory array word
address, and are used to specify which byte location in the EEPROM to start reading or writing.
—
Reply to this email directly, view it on GitHub <#327 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR7NUA3BX62P4FXAUH4NALYUYYDJAVCNFSM6AAAAABDP7D626VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKNBXGA2TQ>.
You are receiving this because you were mentioned.
---------------------------------
Ronald T. Herman
***@***.***
Canterbury NH
|
Beta Was this translation helpful? Give feedback.
-
message received.. thanks..
he’s been rather persistent :-)
… On Feb 21, 2024, at 1:24 AM, Frank Delporte ***@***.***> wrote:
Pi4J is a true opensource project in the sense that it's driven by volunteers who "love to tinker with electronics and Java". @taartspi <https://github.com/taartspi> is one of the most active contributors (see https://github.com/Pi4J/pi4j-example-devices) and his many answers in issues and discussions.
Please stay friendly to get further feedback on your questions.
—
Reply to this email directly, view it on GitHub <#327 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR7NUFI5XLFQ3J6TLATKLLYUWHKHAVCNFSM6AAAAABDP7D626VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKMZZGEZDC>.
You are receiving this because you authored the thread.
---------------------------------
Ronald T. Herman
***@***.***
Canterbury NH
|
Beta Was this translation helpful? Give feedback.
-
I apologize for my impertanance. I saw linux and decided it was not meant for the raspberry.. I see it now.. Is there a jar file plugin for this provider or do I need to build it myself?
… On Feb 21, 2024, at 6:52 AM, Robert von Burg ***@***.***> wrote:
@RonaldTHerman <https://github.com/RonaldTHerman> your error message contains pigpio, which means it is not using the linux-fs provider. Can you please try the linux-fs provider? Here is the documentation: https://pi4j.com/documentation/providers/linuxfs/
—
Reply to this email directly, view it on GitHub <#327 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR7NUEWAWG32LUCK5AKA3DYUXNYFAVCNFSM6AAAAABDP7D626VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKNBSGU3DO>.
You are receiving this because you were mentioned.
---------------------------------
Ronald T. Herman
***@***.***
Canterbury NH
|
Beta Was this translation helpful? Give feedback.
-
Ok I found the jar download.. need to figure out how to get it to work with the I2c code I have. ---------------------------------Ronald T. ***@***.*** NHOn Feb 21, 2024, at 2:45 PM, Ronald Herman ***@***.***> wrote:I apologize for my impertanance. I saw linux and decided it was not meant for the raspberry.. I see it now.. Is there a jar file plugin for this provider or do I need to build it myself?On Feb 21, 2024, at 6:52 AM, Robert von Burg ***@***.***> ***@***.*** your error message contains pigpio, which means it is not using the linux-fs provider. Can you please try the linux-fs provider? Here is the documentation: https://pi4j.com/documentation/providers/linuxfs/—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
…---------------------------------Ronald T. ***@***.*** NH
|
Beta Was this translation helpful? Give feedback.
-
I’ve downloaded pi4j-plugin-linuxfs-2.1.1.jar and pi4j-library-linuxfs-2.1.1.jar and added them to my NetBeans project.
These still are not found writeRegister readRegister newConfigBuilder and device
If they were Netbeans would add import statements for them
Also I am currently using pi4j2.5 SNAPSHOT… for other devices… I need to figure out how to make sure these don’t collide in I2C….
… On Feb 21, 2024, at 2:44 PM, Ronald Herman ***@***.***> wrote:
I apologize for my impertanance. I saw linux and decided it was not meant for the raspberry.. I see it now.. Is there a jar file plugin for this provider or do I need to build it myself?
> On Feb 21, 2024, at 6:52 AM, Robert von Burg ***@***.***> wrote:
>
>
> @RonaldTHerman <https://github.com/RonaldTHerman> your error message contains pigpio, which means it is not using the linux-fs provider. Can you please try the linux-fs provider? Here is the documentation: https://pi4j.com/documentation/providers/linuxfs/
>
> —
> Reply to this email directly, view it on GitHub <#327 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR7NUEWAWG32LUCK5AKA3DYUXNYFAVCNFSM6AAAAABDP7D626VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKNBSGU3DO>.
> You are receiving this because you were mentioned.
>
---------------------------------
Ronald T. Herman
***@***.***
Canterbury NH
---------------------------------
Ronald T. Herman
***@***.***
Canterbury NH
|
Beta Was this translation helpful? Give feedback.
-
Please don't load two different pi4j versions together, this will cause other issues. To use the linux-fs I2C driver, initialize the I2C IO as follows: I2CProvider i2CProvider = pi4j.provider("linuxfs-i2c");
I2CConfig i2cConfig = I2C.newConfigBuilder(pi4j).id("my-i2c").bus(1).device(0x36).build();
I2C i2c = i2CProvider.create(i2cConfig));
i2c.readRegister(...); |
Beta Was this translation helpful? Give feedback.
-
I’m not finding newConfigBuilder or readRegister. What jar file am I missing? I’ve already created an I2c using Pigpio for other devices. Will there be a conflict or will Linux’s-I2c satisfy them?---------------------------------Ronald T. ***@***.*** NHOn Feb 22, 2024, at 4:25 AM, Robert von Burg ***@***.***> wrote:
Please don't load two different pi4j versions together, this will cause other issues. To use the linux-fs I2C driver, initialize the I2C IO as follows:
I2CProvider i2CProvider = pi4j.provider("linuxfs-i2c");
I2CConfig i2cConfig = I2C.newConfigBuilder(pi4j).id("my-i2c").bus(1).device(0x36).build();
I2C i2c = i2CProvider.create(i2cConfig));
i2c.readRegister(...);
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
These problems solved |
Beta Was this translation helpful? Give feedback.
-
---------------------------------Ronald T. ***@***.*** NHI’m afraid not. I never got it to work. You need the linuxfs I2c driver that can handle 16 bit register addresses which I could never get to work. Maybe a newer version is out there that might be better. I finally got the spark fun knob. Their code was easier to convert. On Aug 22, 2024, at 11:42 AM, mores ***@***.***> wrote:
@RonaldTHerman - can you provide complete java code that you have working with this encoder ?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to do I/O on an Adafruit rotary encoder.. If I read their cpp code correctly, they require a register address that selects the module and the register in that module. This results in a register address of 0x1000100110000= 4400 decimal.. pi4j says the limit is 255.. what do I do?
Beta Was this translation helpful? Give feedback.
All reactions