Replies: 15 comments 1 reply
-
I should add that I modified the LedStrinp constructor to accept the chip type:
|
Beta Was this translation helpful? Give feedback.
-
Ok, I fiddled with stuff, and now I am getting the error during
This seems to read that the I am using a Raspberry PI 4, model B with 2GB of ram. |
Beta Was this translation helpful? Give feedback.
-
Ok, I have better error messages (copy paste from remote terminal).
Error messages:
Any help would be much appreciated |
Beta Was this translation helpful? Give feedback.
-
Could it be because I am not using JBANG? I have a Java Swing application in a .jar file which I start with It runs, and when I have debug turned on I get As far as I can tell, I am using identical code to yours. The in-data on the LED string is connected to I can see the I really do not understand why this does not work. |
Beta Was this translation helpful? Give feedback.
-
Here is the totality of the console messages:
The first four rendering message are from the ORANGE flash. My LED string has 50 LEDs. The LED string is updated about every 2 seconds, so that are the other rendering messages. What am I missing here? |
Beta Was this translation helpful? Give feedback.
-
I will ask you help us reset on your environment. You mention PWM and the
9.Describe if the LEDs make any illumination when running the
Hopefully with the answers for 1,2,3 we can see who can best help |
Beta Was this translation helpful? Give feedback.
-
My application reads information from a server, then maps the information into an LED strip. I wrote the application on my Windows machine using Eclipse as the IDE. I then exported a .jar file, copied it to the raspberry pi (running the Pi4J image). The PI user has admin privileges.
My application starts, reads the server, then displays a sample of the output to the screen. So I know that the information is being gathered. It also attempts to echo that to the LED strip. I got the .jar files from Github. The LedStrip code (and associated files) I got from Github (com.pi4j.catalog.components package). The .jar files are:
These are in the Eclipse project build path. The I reverted all the code back to your stock code, and am running it with no modifications, other than boosting the brightness to 1.0f:
I start the LedStrip:
colors[i].getLEDColour() returns
I have tested the LED strip on an arduino and it works. I have measured the voltage at the end of the strip and it is +5 volts when connected to the Raspberry PI. The data is connected initially to physical pin 32 (GPIO 12), then I tried physical pin 19 (GPIO 10), even though the LedStrip.java shows
which I understand to be I have no other devices connected, though eventually I will be using a multiplexor (not used right now, and all code for the multiplexor is commented out). I got the sample code from https://pi4j.com/examples/components/ledstrip/ The LEDs do not show ANY lights, including the ORANGE flash which is shown during LedStrip initialization. Setting the logger to FINE, I copied all the console information as per the above comment. |
Beta Was this translation helpful? Give feedback.
-
I should add that using
that op.txt has no output (0 bytes). Only the console has messages when I run it in a terminal. |
Beta Was this translation helpful? Give feedback.
-
I have tried two types of LED, |
Beta Was this translation helpful? Give feedback.
-
I cloned : I believe this is the same code base you are using. Built it and used their launcher to execute example 12, led strip. The LED strip did not illuminate. I mentioned I did a simple test program to operate a LED strip. If you look at So I modified the /boot/config.txt, rebooted and the LED strip works correctly. You listed the PINs you tested, this example uses the SPI, so MOSI pin. Note: backup this file before modification, incorrectthe edits can result in This change it for the Pi4, you reboot after completing the edit. PI4 : Add the following to /boot/config.txt |
Beta Was this translation helpful? Give feedback.
-
Ok, I modified That is the code base I am using. I downloaded the ZIP file Github generates, expanded it, then copied the I added the other The only messages I get are the ones from the console (shown above). Piping to a file I really want to thank you for this help. I am mostly running blind here as I have never worked with a PI system before, or with |
Beta Was this translation helpful? Give feedback.
-
Make certain raspi-config shows the SPI interface enabled. Read all of this if the interface was NOT enabled. Ok, you mentioned setting the default intensity, I did not see that in my source code, I did not really have the I removed the changes to /boot/config.txt and rebooted Connected the ledStrip to GPIO20 SPI_1 mosi I do not understand how SPI_1 operates I do not know why it was moved to SPI_1, you could change back to SPI_0 and test. Move the led strip connection The led patterns function as described. Suggest Remove the core_freq updates from the /boot/config.txt reboot. Still fails. Still fails, can you use the downloaded code as an application. Run it |
Beta Was this translation helpful? Give feedback.
-
I have tried various values in combination for:
And I have tried different GPIO pins. I cannot get this to work. Strangely, if I rub my finger over the data-in on the strip, I get the LEDs to light in random colours. I do not understand the relationship between the Also, from the reading I have done, only the two PMW pins (GPIO12 and GPIO13) are supposedly capable of the rapid changes in value which an LED strip requires. When I used Anyway, I still cannot get this to work. Again, this is Raspberry PI 4, MOD B, 2BG of RAM. If that makes a difference? I am writing this app to read from a server, then show LED results. I am hoping to distribute this for free for other people to use, so I need it as robust as possible, and explainable to the end user. |
Beta Was this translation helpful? Give feedback.
-
If you have later code/jar files, where can I get them from? So we are using the same code base. Thanks |
Beta Was this translation helpful? Give feedback.
-
The code is from the location we discussed earlier https://github.com/Pi4J/pi4j-example-components This is the latest code. The channel attribute is the ChipSelect (CE0 or CE1) This isn't relevant in this program as the LED strip has no concept of being selected. The bus, is whether SPI_bus0 or SPI_bus1. Looking in the classs public class LedStrip extends SpiDevice, It creates the SPI device and sets it operating frequency for a Pi4. You are not required to set any other frequency values. Near the top of this file a comment explains which GPIO is connected to the LED strip depending upon which SPI_bus is used. I still think it best you make certain the SPI interface is enabled, then use this example application to validate the LEDs operate as described in the LedStrip_App. |
Beta Was this translation helpful? Give feedback.
-
I see that there are four .so files in your library. I have added these to the classpath, but I do not explicitly load them. I get no console message about them.
I use this code to setup an LEDStrip
When I start the program I get this in the console:
Is this correct?
I am not getting ANY output to my LED strip. I have tried both PMW pins.
Beta Was this translation helpful? Give feedback.
All reactions