awawa-dev / HyperSPI

HyperHDR bridge using SPI bus. Connects Raspberry Pi with a generic Raspberry Pi Pico (rp2040)/ESP32/ESP8266 to control a LED strip. Fasted possible cable solution for external Pico/ESP LED driver. Data integration check included.

Home Page:https://hyperhdr.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to Control more than one LED Stripe over HyperSPI?

Lasermax3000 opened this issue · comments

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...

commented

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.

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!

commented

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.

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

commented

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.

commented

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

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 😅.

commented

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

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?

commented

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.

commented

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.

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

commented

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

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

commented

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

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

commented

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.