Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LED address order may be different for other people. Needs documentation . #32

Closed
dcjona opened this issue Feb 10, 2020 · 27 comments
Closed
Assignees
Labels
addressed documentation Improvements or additions to documentation

Comments

@dcjona
Copy link

dcjona commented Feb 10, 2020

Hi,
i have something strange, order of led is completly différent from original project?

@lancewilhelm
Copy link
Owner

Hi @dcjona,
Are you using a 30 LEDs/m strip and are all of your strips the same? Some configuring might need to be done in the Utils.py file to make sure that the neopixel library works with your LEDs.

Also if you have separate strips then you may need to check your power and data connections between the them.

Happy to help you work it out. Feel free to attach pictures and other things to help show your problem.

@lancewilhelm lancewilhelm self-assigned this Feb 10, 2020
@lancewilhelm lancewilhelm added the question Further information is requested label Feb 10, 2020
@dcjona
Copy link
Author

dcjona commented Feb 10, 2020

hi, thanks for answer, it's a long 5m led that i cut .. 30led/m yes
here is my problem : https://www.youtube.com/watch?v=Via3W5A_QxM

@lancewilhelm
Copy link
Owner

lancewilhelm commented Feb 10, 2020

Thanks for the video. That seems to highlight what is going on. I think that we wired our LED strips in a different order. Therefore the LED address locations for each ball is different for you and me. Luckily I think we can solve this problem by modifying the code on your clock instead of having to rewire completely.

If you look at the first image on the readme file or the img folder you can see how I ordered my LED strips and how the balls are ordered. (Keep in mind that when this is actually put in to the code, each number is one less than the ones in the image). You can see how this is implemented in the Utils.py file, specifically in the ledAddresses list.

What you can do is create an image for your clock to map out how it is laid out and then change the numbers to match the order of your LEDs. Row 0 is the bottom of the clock and Row 6 is the top of the clock. I will update the image when I get home to make this more clear. The 999 addresses are necessary so do not change them.

Give this a shot. It shouldn't take too much to get it to work on your clock. I can update my images and readme when I get home to make this clear to people trying this in the future.

@lancewilhelm lancewilhelm added the documentation Improvements or additions to documentation label Feb 10, 2020
@dcjona
Copy link
Author

dcjona commented Feb 10, 2020

yes when i saw the number of the leds it's is totally different.
i just follow the order like on the original topic...i will create an image of the clock to make modification thanks

@dcjona
Copy link
Author

dcjona commented Feb 10, 2020

1581359360845
Here is my number

@dcjona
Copy link
Author

dcjona commented Feb 10, 2020

totally opposite of yours :)
but i don't understand very well the nulmerotation on the utils.py :
[999,999,999,3,16,17,30,31,44,45,58,59,72,73,86,87,100,101,114,115], #0 row
[999,999,4,15,18,29,32,43,46,57,60,71,74,85,88,99,102,113,116,126], #1 row
[999,2,5,14,19,28,33,42,47,56,61,70,75,84,89,98,103,112,117,125], #2 row
[1,6,13,20,27,34,41,48,55,62,69,76,83,90,97,104,111,118,124,127], #3 row
[0,7,12,21,26,35,40,49,54,63,68,77,82,91,96,105,110,119,123,999], #4 row
[8,11,22,25,36,39,50,53,64,67,78,81,92,95,106,109,120,122,999,999], #5 row
[9,10,23,24,37,38,51,52,65,66,79,80,93,94,107,108,121,999,999,999] #6 row

@lancewilhelm
Copy link
Owner

It looks like you found the difference! Great! Let me know if the new ordering works out for you. If some balls don't light up just go back and check your numbers. When making a larger version (xl branch) I had to go in and double check my numbers due to me making errors when typing them in.

Also glad to see you have 0-127 and not 1-128. Perfect! Would love to see a video of it in works once you get it.

@lancewilhelm lancewilhelm added addressed and removed question Further information is requested labels Feb 10, 2020
@lancewilhelm lancewilhelm changed the title just 3 led on LED address order is different. Needs documentation . Feb 10, 2020
@lancewilhelm lancewilhelm changed the title LED address order is different. Needs documentation . LED address order may be different for other people. Needs documentation . Feb 10, 2020
@lancewilhelm
Copy link
Owner

totally opposite of yours :)
but i don't understand very well the nulmerotation on the utils.py :

I don't think I addressed this, sorry. What you should do is replace the numbers in Utils.py with your numbers that you have, except leave the 999. Those are ghost balls/LEDs that are used for the logic.

So it looks like your row 0 would go like this if I read your picture correctly...
[999,999,999,7,20,21,34,35,48,49,62,63,76,77,90,91,104,105,118,119], #0 row

do this for each of your rows, replace the rows in Utils.py with your rows.

@dcjona
Copy link
Author

dcjona commented Feb 10, 2020

Isn't it 999,999,7,20,21,34,35,48,49,62,63,76,77,90,91,104,105,118,119,999 ? Because et the end there are a Line of 3leds instead of 7. Maybee i'm wrong ?

It start at 1 on the image but you start at 0 in the Utiles.py right ? So i have to take my number minus 1 ?

@dcjona
Copy link
Author

dcjona commented Feb 10, 2020

no chance for me it doesn't work after modification :(

@lancewilhelm
Copy link
Owner

lancewilhelm commented Feb 10, 2020

I think it is not working because your diagram correctly lays out how the LEDs are oriented in the strips, however, it doesn't assign those LEDs to the actual balls. If you take a diagram and actually find the LED numbers that are associated with each ball, then we construct the row LED addresses from that diagram. If you notice from my diagram that the numbers zig-zag as you go up and down this is because a single line of LEDs splits between the two different columns of balls.

This is confusing I understand, but please take a look at the diagram is and specifically the faint red vertical lines which represent the LED strips. I will take a look at your diagram tonight and see if I can help construct the LED addresses list.

It start at 1 on the image but you start at 0 in the Utiles.py right ? So i have to take my number minus 1 ?

You are right though, we need to subtract one from your numbers that you laid out.

@lancewilhelm
Copy link
Owner

Ok, @dcjona,

I think this guide should help you and those in the future sort this issue out. I will lay it out here once and hopefully not have to do it again! :]

I imagine that I backed myself into this corner because the LED layout in the instructable or whatever guide you used told you to layout the LEDs in a certain manner. Unfortunately, I followed my own internal guidance which led us to this point.

I have attached a picture of how I believe your LEDs are oriented on your board.

layout visualizer_dcjona fix

Pay attention to the fact that you start your strip with a single LED, then a strip of 5, etc. This is different than mine so we have to adjust the LED address numbers to account for this. Using this image and drawing that I created we can see what the numbers in each ledAddresses row should be.

ledAddresses = [ [999,999,999,6,19,20,33,34,47,48,61,62,75,76,89,90,103,104,117,118], #0 row [999,999,5,7,18,21,32,35,46,49,60,63,74,77,88,91,102,105,116,119], #1 row [999,4,8,17,22,31,36,45,50,59,64,73,78,87,92,101,106,115,120,127], #2 row [0,3,9,16,23.30,37,44,51,58,65,72,79,86,93,100,107,114,121,126], #3 row [2,10,15,24,29,38,43,52,57,66,71,80,85,94,99,108,113,122,125,999], #4 row [1,11,14,25,28,39,42,53,56,67,70,81,84,95,98,109,112,123,999,999], #5 row [12,13,26,27,40,41,54,55,68,69,82,83,96,97,110,111,124,999,999,999] #6 row ]

Now, barring any errors when typing those numbers, you should be able to copy and paste that code in your Utils.py file and it should work. I suggest trying to display a solid background color with no text to test. If one does not light up check the ledAddresses list to make sure that I didn't type any number in duplicate.

For those in the future
Please take the time to create a diagram like @dcjona did to find how your LEDs are laid out. Then actually find out how they are displayed on the balls. From there you can construct your ledAddresses list.

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

hi, i check you code and that's exactly what i put yesterday but it doesn't work
your diagram is correct. your number too, i did the same.
when i try a solid color like green for example, led number 6-8-10-14-18-28-32-48-50-60-74-118-120 are on in white...
i see also one led on , one led off...like in the picture below

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

1581399352688

@lancewilhelm
Copy link
Owner

lancewilhelm commented Feb 11, 2020

Interesting. First I am wondering if you changed the setting PIXEL_DENSITY = 60 to PIXEL_DENSITY = 30 in Utils.py. That should resolve the every other pixel issue.

Then try the following text into the settings.txt file once you address this. This should paint the entire board green with no text. Let me know how this turns out.

{"fontName": "digits", "tempUnits": "f", "bgColor": ["solid", 65280], "timeFormat": "24h", "brightness": 125, "content": [], "customText": "", "animationSpeed": 0, "textSpacing": 0, "textColor": ["animation", "rainbow"], "weatherZipLocation": "80925", "weatherCityLocation": ""}

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

something strange happens :
pi@raspberrypi:~/pingPongBallClock/code $ sudo python main.py Traceback (most recent call last): File "main.py", line 5, in <module> from flaskUtils import app File "/home/pi/pingPongBallClock/code/flaskUtils.py", line 2, in <module> from LEDUtils import * File "/home/pi/pingPongBallClock/code/LEDUtils.py", line 573, in <module> PPB = PingPongBoard() File "/home/pi/pingPongBallClock/code/LEDUtils.py", line 36, in __init__ self.loadSettings() File "/home/pi/pingPongBallClock/code/LEDUtils.py", line 529, in loadSettings settings = json.load(filehandle) File "/usr/lib/python2.7/json/__init__.py", line 291, in load **kw) File "/usr/lib/python2.7/json/__init__.py", line 339, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 367, in decode raise ValueError(errmsg("Extra data", s, end, len(s))) ValueError: Extra data: line 2 column 1 - line 3 column 1 (char 313 - 593)
when i try to launch ..

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

Ok i made a fresh install abd change 60to 30. Every balls are powered up
1581404959611

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

when i change the settings.txt ; i have the error
pi@raspberrypi:~/pingPongBallClock/code $ sudo python main.py Traceback (most recent call last): File "main.py", line 5, in <module> from flaskUtils import app File "/home/pi/pingPongBallClock/code/flaskUtils.py", line 2, in <module> from LEDUtils import * File "/home/pi/pingPongBallClock/code/LEDUtils.py", line 568, in <module> PPB = PingPongBoard() File "/home/pi/pingPongBallClock/code/LEDUtils.py", line 36, in __init__ self.loadSettings() File "/home/pi/pingPongBallClock/code/LEDUtils.py", line 524, in loadSettings settings = json.load(filehandle) File "/usr/lib/python2.7/json/__init__.py", line 291, in load **kw) File "/usr/lib/python2.7/json/__init__.py", line 339, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 367, in decode raise ValueError(errmsg("Extra data", s, end, len(s))) ValueError: Extra data: line 2 column 1 - line 3 column 1 (char 290 - 572)

@lancewilhelm
Copy link
Owner

lancewilhelm commented Feb 11, 2020

Ok at least we have got all of the LEDs on now.

I may have supplied you with a bad settings file or you may not be copying in correctly. Either way, we should be able to find out what those LEDs are.

It still looks like some are white, right? Try this, if you boot up your clock and change the background to green, try changing the text color and see if those ball colors change. I’m wondering if they are text. Also, make sure you are checking and unchecking the content parts of the webpage.

Let me know what you find out.

@lancewilhelm
Copy link
Owner

when i change the settings.txt ; i have the error

I believe that this error is being cause because you did not copy the settings.txt in all as one line. Settings.txt is one line that is continuous.

line 367, in decode raise ValueError(errmsg("Extra data", s, end, len(s))) ValueError: Extra data: line 2 column 1 - line 3 column 1 (char 290 - 572)

this is why I am think that. Go over to settings.txt and you will see it all as one line. When you modify the board settings via the web app and then click save it modifies this settings.txt file for your board.

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

Well Seen it was the problem 2 lignes. One commented. I had triés with other led and your wiring diagram and it works perfectly. I had to find the correct number for me now thanks for help

@dcjona
Copy link
Author

dcjona commented Feb 11, 2020

if i want to integrated to my automation system, could you tell me how i can send text by url ? if possible?

@lancewilhelm
Copy link
Owner

if i want to integrated to my automation system, could you tell me how i can send text by url ? if possible?

If you want to try and integrate a new feature go ahead and open up a new "issue" or feature request. Then we can work on integrating it. Feel free to describe it in there. You can also branch it and work it yourself locally and then try and push the branch to the repo and I can take a look.

Closing this issue now.

@neek0la
Copy link

neek0la commented Apr 2, 2020

Ok, @dcjona,

I think this guide should help you and those in the future sort this issue out. I will lay it out here once and hopefully not have to do it again! :]

I imagine that I backed myself into this corner because the LED layout in the instructable or whatever guide you used told you to layout the LEDs in a certain manner. Unfortunately, I followed my own internal guidance which led us to this point.

I have attached a picture of how I believe your LEDs are oriented on your board.

layout visualizer_dcjona fix

Pay attention to the fact that you start your strip with a single LED, then a strip of 5, etc. This is different than mine so we have to adjust the LED address numbers to account for this. Using this image and drawing that I created we can see what the numbers in each ledAddresses row should be.

ledAddresses = [ [999,999,999,6,19,20,33,34,47,48,61,62,75,76,89,90,103,104,117,118], #0 row [999,999,5,7,18,21,32,35,46,49,60,63,74,77,88,91,102,105,116,119], #1 row [999,4,8,17,22,31,36,45,50,59,64,73,78,87,92,101,106,115,120,127], #2 row [0,3,9,16,23.30,37,44,51,58,65,72,79,86,93,100,107,114,121,126], #3 row [2,10,15,24,29,38,43,52,57,66,71,80,85,94,99,108,113,122,125,999], #4 row [1,11,14,25,28,39,42,53,56,67,70,81,84,95,98,109,112,123,999,999], #5 row [12,13,26,27,40,41,54,55,68,69,82,83,96,97,110,111,124,999,999,999] #6 row ]

Now, barring any errors when typing those numbers, you should be able to copy and paste that code in your Utils.py file and it should work. I suggest trying to display a solid background color with no text to test. If one does not light up check the ledAddresses list to make sure that I didn't type any number in duplicate.

For those in the future
Please take the time to create a diagram like @dcjona did to find how your LEDs are laid out. Then actually find out how they are displayed on the balls. From there you can construct your ledAddresses list.

Just a FYI to everyone, the code on row 3 will cause issues. Seems that there is a . instead of a , between numbers 23 & 30

@dcjona
Copy link
Author

dcjona commented Apr 2, 2020

hi, for the pingpong project for me it's ok ... now i try to find for the other project 'awtrix style' , i didn't change the order of led in row but , i think it's done for pingpong ball and not for square.. see me other PR

@sdaverede
Copy link

@dcjona , your configuration is like mine, the one from the instructable, and it should be like this:

ledAddresses = [ [999,999,999,6,19,20,33,34,47,48,61,62,75,76,89,90,103,104,117,118], #0 row [999,999,5,7,18,21,32,35,46,49,60,63,74,77,88,91,102,105,116,119], #1 row [999,4,8,17,22,31,36,45,50,59,64,73,78,87,92,101,106,115,120,127], #2 row [0,3,9,16,23,30,37,44,51,58,65,72,79,86,93,100,107,114,121,126], #3 row [2,10,15,24,29,38,43,52,57,66,71,80,85,94,99,108,113,122,125,999], #4 row [1,11,14,25,28,39,42,53,56,67,70,81,84,95,98,109,112,123,999,999], #5 row [12,13,26,27,40,41,54,55,68,69,82,83,96,97,110,111,124,999,999,999] #6 row ]

@dcjona
Copy link
Author

dcjona commented Jun 5, 2020

thanks i will try :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants