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

How to Control more than one LED Stripe over HyperSPI? #4

Closed
Lasermax3000 opened this issue Aug 17, 2022 · 17 comments
Closed

How to Control more than one LED Stripe over HyperSPI? #4

Lasermax3000 opened this issue Aug 17, 2022 · 17 comments

Comments

@Lasermax3000
Copy link

Hello,

at first thank you for this awsome project and the solutions you provided so far.
I got a little project, where i want to use more than one LED Stripe with HyperSPI.
Is it possible to control more than one Strip with a single ESP 8266?
Or do i have to use an ESP for every Strip each on the same SPI-Bus?
Would be great if you could give an idea...

@awawa-dev
Copy link
Owner

Hi
That's indeed interesting question. Since Rpi has two SPI interfaces it will work for two separated esp8266. If we use SPI CS0/CS1 it should handle four devices. But for ESP8266, it seems it that its SPI implementation simply ignores SS for some reason. As you can read in the tutorial, the SS cable isn't even connected and it works, but I didn't dig further. So not sure if CS0/CS1 will work for HyperSPI using esp8266. For ESP32 SS using CS0/CS1 is mandatory and it should work.

Currently the project can handle only one segment. Theoretically it's possible to handle more than one, but it would require some rather simply project modification for specific setup. For example we need to handle 800LEDS, first 500LEDS and a second 300LEDS. We assume that they are put in order, one by one. Then in HyperSPI we need to create a second instance of neopixelbus library to handle second LED instance, and then after receiving via SPI 500th LED color we switch to put colors into the second neopixelbus instance. esp8266 has some limitation and probably esp32 would be a better choice for that task.

@Lasermax3000
Copy link
Author

Ok thank you very much, for ESP8266 CS Pin shall be GPIO15 but i don´t know if it works, when you connect it.
Maybe i can try in future when the rest of the components work.
Your idea might work, i already thought of something like this, but i am actually not incorporated in the Software and not a very good Programmer (like you ;) to implement this. Another Problem for me would be, that i can control the two Stripes only as one in HyperHDR and not with two seperate instances.
ESP32 might really be the better option.
Thank you for your Support!

@awawa-dev
Copy link
Owner

awawa-dev commented Aug 20, 2022

Thanks!
The problem with ESP8266 CS pin that it is probably ignored: the HyperSPI should not work without that wire not connected from Rpi. The device should only receive the transmission that is sent to that particular device so CS pin must be set high. Probably if you connect more than one ESP8266 to single SPI bus, they will be receiving each other transmission even if you connect these CS wires for each device. But I didn't test such scenario.

The solution with modified HyperSPI doesn't require any HyperHDR modification. It will work with single instance (800 LEDs in this case) or as independent instances using two ESP devices (500 and 300, it should work without any HyperSPI/HyperHDR modification even now). The idea of multi-segment support follows me, but I do not know yet whether I will implement it under HyperHDR or as a new project.

@Lasermax3000
Copy link
Author

I know what you meaning.
Yes that would be great!
But would it be possible to add more CS Pins from GPIOs of an RPI, connecting even more devices over SPI?
Like in this Post-> https://gist.github.com/mcbridejc/d060602e892f6879e7bc8b93aa3f85be
I actually got an Problem which i think ist more an Issue of HyperSPI, but has something to do with HyperSPI.

I´m using an Orange PI, which only has one SPI Interface (SPI1).
The issue is that i configured the settings in Hyperhdr like yours, but the SPI sends nothing to ESP, i measured that with a Logic Analyzer. It´s also possible to select SPI0, which the Board does not have.
Maybe you´ve got an idea what´s wrong.

Bildschirmfoto_2022-08-25_10-22-59
Screenshot 2022-08-25 124451

@awawa-dev
Copy link
Owner

Both MOSI and CLK are dead? Does HyperHDR show any error related to SPI driver in the logs?
HyperHDR does not filter SPI devices that are available or not in the list. The list is adapted to default RPI SPI interfaces. It's possible to extend that list: only one json file with a dictionary need to be changed so you can have /dev/spi0.4 or any other (https://github.com/awawa-dev/HyperHDR/blob/1c312054893987eab41f268c6408e6b46ebe947c/sources/leddevice/schemas/schema-awa_spi.json#L8 and their labels two line below).
Enabling SPI on Orange Pi using Armbian is not an easy task. I don't have an experience with SPI on Orange Pi board and rather bad experience with Orange Pi overall.

@awawa-dev
Copy link
Owner

Also check if HyperHDR has rights to use that SPI device. But it should give an error in HyperHDR's logs.

@Lasermax3000
Copy link
Author

Lasermax3000 commented Aug 26, 2022

Thanks for the info.
Is there an extra Log for hyperhdr available or where do i have to look at?
Could you also tell me, to which directory the Software is normally installed?
I can't find the files 😅.

@awawa-dev
Copy link
Owner

You can find current logs in hyperhdr web page. The archive is in journalctl. The app is located in /usr/share/hyperhdr

@Lasermax3000
Copy link
Author

Lasermax3000 commented Aug 26, 2022

Thank you very much!
You were right -> HyperHDR had no root rights.
Rights

I added them and in the Log where no Errors anymore and the Strip lighted up. Great!

Rights_work

To add more SPI Interfaces by extending the List, i have to compile HyperHDR from sources or is there an existing File in the directories, where i can change the settings?

@awawa-dev
Copy link
Owner

Great!
To have additional non-standard interfaces available you need to add them to these two lines in the source code and compile the project. If you change it in the HyperHDR configuration database file alone, it will be reversed at the startup.

@awawa-dev
Copy link
Owner

BTW if you fork HyperHDR you can modify that schema-awa_spi.json online, then github will compile it for you if you enable github action. Probably that's the easiest solution.

@Lasermax3000
Copy link
Author

Could you please explain to me, how to modify that file online?
I´m not sure how to do that.

@awawa-dev
Copy link
Owner

Did you forked HyperHDR and enabled Github Action in the project properties?

@Lasermax3000
Copy link
Author

Yes i did adjust the File, but i get an Error during compiling the RPI-Image.
Don´t know what i´m doing wrong, cause i don´t have much experience using GitHub.
I don´t need the RPI-Image, is there a way to compile only the 64bit Linux Version?
Thank you very much for your Support and your quick responding so far!

Build_Failed_2
Build_Failed

@awawa-dev
Copy link
Owner

awawa-dev commented Sep 1, 2022

This command is for tagged releases only and it generates SD card images from the official repo: it's useless in your case. You have already built your installers: https://github.com/Lasermax3000/HyperHDR/actions/runs/2964289682

@Lasermax3000
Copy link
Author

Ahh cool, that it worked.
Huge Thanks for you support!

@awawa-dev
Copy link
Owner

Updated HyperSPI: it's capable now of multi-segment but only for ESP32 and ESP32-S2. Esp8266 is an old design, it's SPI protocol is limited (we can only send ~30 bytes in packet, doesn't work well for large data to transfer for both segments) and as you can see on the attached fresh benchmarks on the main page it's already well behind ESP32. ESP32-S2 lolin mini is currently as cheap as Esp8266 boards so don't plan to support this feature for Esp8266.

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

No branches or pull requests

2 participants