SolidStateGroup / rio

An open source library allowing you to create an internet connected LED wall
157 stars 22 forks source link

More Pixels #25

Open dallen98 opened 4 years ago

dallen98 commented 4 years ago

First off, great project, In the rio-server/firmware/rpi/lowlevel-server.py you currently have...

LED strip configuration:

LED_COUNT = 1020 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz) LED_DMA = 5 # DMA channel to use for generating signal (try 5) LED_BRIGHTNESS = 32 # Set to 0 for darkest and 255 for brightest LED_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_CHANNEL = 0

LED_2_COUNT = 1020 # Number of LED pixels. LED_2_PIN = 19 # GPIO pin connected to the pixels (must support PWM!). LED_2_BRIGHTNESS = 32 # Set to 0 for darkest and 255 for brightest LED_2_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_2_CHANNEL = 1

Would it be possible to double or even triple the pixels by having a further 1020 coming of pin 16 and another 1020 coming off pin 17, (or some other pin) if yes then how would that code look ? With the introduction of Raspberry pi 4 I,m imagining we can squeeze a bit more out of the project, Thanks.

lukefanning commented 4 years ago

Hi @dallen98 thanks :). It's been a long time since I looked into this but if I recall correctly there are limitations on how much data can be driven simultaneously through the GPIO pins. However with the introduction of the RPi 4 that may well no longer be the case. I can't really fully explain how you'd need to change the script but it should be fairly straight forward. I guess the most important part is making sure you are writing to the correct channel in the for data loop based on the current pixel index. You would need to consider whether the index was in the correct range i.e. index < LED_COUNT for channel 1 and then index >= LED_COUNT and index < LED_2_COUNT. If you manage to make the changes yourself, you can always paste it here if its not working and I can give it a look over for you.

dallen98 commented 4 years ago

So in the In the rio-server/firmware/rpi/lowlevel-server.py I change that to as below ?

LED_COUNT = 1020 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz) LED_DMA = 5 # DMA channel to use for generating signal (try 5) LED_BRIGHTNESS = 32 # Set to 0 for darkest and 255 for brightest LED_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_CHANNEL = 0

LED_2_COUNT = 1020 # Number of LED pixels. LED_2_PIN = 19 # GPIO pin connected to the pixels (must support PWM!). LED_2_BRIGHTNESS = 32 # Set to 0 for darkest and 255 for brightest LED_2_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_2_CHANNEL = 1

LED_3_COUNT = 1020 # Number of LED pixels. LED_3_PIN = 19 # GPIO pin connected to the pixels (must support PWM!). LED_3_BRIGHTNESS = 32 # Set to 0 for darkest and 255 for brightest LED_3_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_3_CHANNEL = 2

LED_4_COUNT = 1020 # Number of LED pixels. LED_4_PIN = 19 # GPIO pin connected to the pixels (must support PWM!). LED_4_BRIGHTNESS = 32 # Set to 0 for darkest and 255 for brightest LED_4_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_4_CHANNEL = 3

and in rio-server/config/index.js it changes from...

module.exports = { matrix: { width: 60, height: 34

to ...

module.exports = { matrix: { width: 60, height: 68 ???

and is there anywhere else in rio code that needs changing ??? Thanks Dave

dallen98 commented 4 years ago

I,m trying to understand how many pins I could use as outputs for the led strings on my raspberry pi4 2gb, we already know about pins 18 and 19 used in your code, I see that additionally pins 13 and 16 are marked up on the pinout guide as pwm so that is potentially 4 outputs ??? if we could (optimistically) drive 2040 ws2812b 16mm pitch then (4x2040=) 8160 leds could be driven ? does that sound feasible ? and can any other pins be repurposed to drive even more leds ??

Seperatley it seems that without an internet connection the display stops with these errors.. events.js:165 throw er; // Unhandled 'error' event ^

Error: getaddrinfo EAI_AGAIN pixelwall.herokuapp.com:80 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26) Emitted 'error' event at: at Socket.socketErrorListener (_http_client.js:395:9) at Socket.emit (events.js:180:13) at emitErrorNT (internal/streams/destroy.js:64:8) at process._tickCallback (internal/process/next_tick.js:178:19) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! rio-server@1.0.0 start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rio-server@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-04-18T11_57_49_871Z-debug.log root@raspberrypi:/home/pi/rio/rio-server#

perhaps this line could be altered to change the destroy behaviour ? at emitErrorNT (internal/streams/destroy.js:64:8) I have been trying to find where I could edit it, do you know which file I would need to change so the giph continues playing after the internet is lost ?? Thanks