Cannot resolve symbol 'SpiChipSelect' #375
Replies: 7 comments 4 replies
-
I altered my devices project to use SNAPSHOT 2.6.1 and the import com.pi4j.io.spi.SpiChipSelect worked and the chip select usage in my program compiled. If you build using something other than maven, state what you use and maybe some user has a suggestion. |
Beta Was this translation helpful? Give feedback.
-
SNAPSHOT version, my words were confusing, I modified the POM to use 2.6.1-SNAPSHOT If the imports are still failing, for information in the file enter the line: There something simple missing but what it is hasn't hit me, thus the Invalidate steps. |
Beta Was this translation helpful? Give feedback.
-
Earlier you mentioned provider [digital-input] and [i2c] not found I believe you need to fix the provider names, examples it is not i2c but rather pigpio-i2c Others pigpio-spi pigpio-digital-output pigpio-digital-input Starting in 2.5.0 the new providers like Gpiod linuxfs are loaded. If you want to stay with the pigpio provider change your code to the following when creating the context var piGpio = PiGpio.newNativeInstance();
var pi4j = Pi4J.newContextBuilder().
noAutoDetect().
add(PiGpioSpiProvider.newInstance(piGpio)).
add(PiGpioI2CProvider.newInstance(piGpio)).
add(PiGpioDigitalOutputProvider.newInstance(piGpio)).
add(PiGpioDigitalInputProvider.newInstance(piGpio)).
build();
System.out.println("-------------------------------------------------");
System.out.println("PI4J PROVIDERS");
System.out.println("-------------------------------------------------");
pi4j.providers().describe().print(System.out);
System.out.println("-------------------------------------------------"); Not sure what you are describing by a snapshot conflict. I will paste the dependencies from my pom. I have more than you will use.
And still interested what is listed when you: |
Beta Was this translation helpful? Give feedback.
-
Thanks so much. for your continued support! I've been able to get everything loaded with maven thanks to you example pom. in my SPI code I still can not resolve com.pi4j.io.spi.SpiChipSelect When I enter the line import com.pi4j. and wait I see the following: I've been using the example here: https://www.pi4j.com/documentation/io-examples/i2c/ for my i2c code. And have the following:
but get the following error: Thanks so much for all you help! |
Beta Was this translation helpful? Give feedback.
-
I bet the import problem and gpiod link error are somehow related, but so far I sure don't know how. |
Beta Was this translation helpful? Give feedback.
-
Great thanks so very much for the fantastic support
4: |
Beta Was this translation helpful? Give feedback.
-
Did u run the pgm from intellij ? If yes. Copy the very long command from the first line in the intellij console. Paste it into a terminal and put sudo at the very start. Pigpio must run with sudo. If u use the linuxfs provider the sudo https://www.pi4j.com/documentation/providers/ Also. Can u do step 2 and 4. Assuming step 2 provides the added BoardInfo details |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm upgrading a project from v1 to v2. Using pi4j-core 2.6.1
I have the following code:
.....
import com.pi4j.Pi4J;
import com.pi4j.context.Context;
import com.pi4j.io.spi.Spi;
import com.pi4j.io.spi.SpiConfig;
import com.pi4j.io.spi.SpiProvider;
import com.pi4j.io.spi.SpiChipSelect;
but tin import of import com.pi4j.io.spi.SpiChipSelect; wont resolve.
Any advice?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions