RGB Led Matrix WebApp - runtext.py not working

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

Hi there. Looking for some advice. I know the guides listed below are out of date but I'm desperate to get this working for a personal project of mine (it's actually so my family can send me live messages to my desktop as I suffer from depression and also have a habit of ignoring my phone). As the title suggests I am unable to get the scrolling text function working on the web app in the guide here:

https://learn.adafruit.com/raspberry-pi ... p/overview

Now as this guide suggests (and as this post on these forums confirms: viewtopic.php?f=47&p=579301 - And yes I did follow through on everything suggested in this thread but still got nowhere) you need to run the fork of the code by onebeartoe - memberlist.php?mode=viewprofile&u=212212. When I do this I get absolutely no output on the matrix and the test examples do not run either.

However (and this is where it get's interesting, stay with me) when I run the code (which I think is now deprecated) listed in step six here - https://learn.adafruit.com/adafruit-rgb ... g-matrices - The test examples run, the still images show when added from the web app (I tested with a .png of a Pi 4) BUT I cannot get the scrolling text to display, despite the web app saying 'The scrolling text was updated'.

Can anyone assist here? It would be so lovely to get this working. And after two nights troubleshooting this I am at the end of of my knowledge on this.

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by onebeartoe »

phikl, I have been meaning to revisit this project, in preparation for a Matrix Portal project.

There is no timeframe, but I plan to follow the guide (https://learn.adafruit.com/raspberry-pi ... p/overview) and see if I can reproduce the scrolling text issue you mentioned.

Can you confirm that everything in that guide works, except scrolling text? Or did you mean none of the Web application features work?

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

Hey hey... The image upload works (I tested with an image of a raspberry pi hehe).. But despite the scrolling text page returning as "Scrolling text updated" I cannot get an output on the display. No worries on not having a time frame, I just appreciate your attention on this. Thank you man! Hope things are not too chaotic over the pond right now, eagerly awaiting a positive result here in the UK!

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by onebeartoe »

No problem, man.

But can you confirm that only scrolling text is not working?

And/Or confirm that still and animated images properly dislpay on the LED matrix, using the Web app?

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

Sorry.. Scrolling text is not working, animated images do not show, yet still images do show - all of this is done on the web app.

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by onebeartoe »

Okay, thanks for the info.

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

OK I've been doing some testing on this this afternoon and I can now run the spinning square demo successfully (I'm even able to mess with the rows and columns to make it bigger/smaller) from the CLI as detailed in your guide. However when I try and run the /python/samples/runtext.py (which I think the web app uses to produce the scrolling text - correct me if I'm wrong) I get the below error:
Traceback (most recent call last):
File "./runtext.py", line 3, in <module>
from samplebase import SampleBase
File "/home/pi/rpi-rgb-led-matrix/python/samples/samplebase.py", line 7, in <module>
from rgbmatrix import RGBMatrix, RGBMatrixOptions
ImportError: cannot import name RGBMatrixOptions

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

Further to the above, when I deploy the web app using:
sudo java -jar payara-micro-5.2020.5.jar --deploy rpi-rgb-led-matrix-webapp-0.0.1-SNAPSHOT.war
and then test the scrolling text via the web app, I get the following output (indicating no errors):
[2020-11-14T18:00:57.388+0000] [] [INFO] [] [org.onebeartoe.rpi.rgb.led.matrix.RaspberryPiRgbLedMatrix] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(2)] [timeMillis: 1605376857388] [levelValue: 800] command list: >/home/pi/rpi-rgb-led-matrix/python/samples/runtext.py --led-no-hardware-pulse --led-gpio-mapping=adafruit-hat --led-slowdown-gpio=4 --led-rows=16 --led-cols=32 --text Hello World! <

[2020-11-14T18:00:57.389+0000] [] [INFO] [] [org.onebeartoe.rpi.rgb.led.matrix.RaspberryPiRgbLedMatrix] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(2)] [timeMillis: 1605376857389] [levelValue: 800] starting scrolling text process...

[2020-11-14T18:00:57.428+0000] [] [INFO] [] [org.onebeartoe.rpi.rgb.led.matrix.RaspberryPiRgbLedMatrix] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(2)] [timeMillis: 1605376857428] [levelValue: 800] after process start, builder directory is: /home/pi/rpi-rgb-led-matrix/python/samples

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by onebeartoe »

I am still not sure when I can try reproducing the issue you are facing.

But thanks, this information helps.

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

No worries at all. Like you said no timescale and I really appreciate your help. Just thought I would have another crack at it this afternoon.

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

OK so I spent a bunch of time on this this weekend and I have now managed to get the scrolling text from the web app working! As detailed here:

viewtopic.php?f=47&p=579301

and specifically your comment
So when you execute this:

sudo HARDWARE_DESC=adafruit-hat make install-python

as mentioned in the guide at https://learn.adafruit.com/raspberry-pi ... requisites

you don't have to specify the flags anymore.
You DON'T have to specify the flags in the settings on the web app (If only I had read all of the words).

Clearing those settings out still made the text glitchy however so I defined the rows (and the brightness) using the below:

-r 16 -b 10

And boom! Scrolling text web app!! Thank you for your help on this man I really appreciate it

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by onebeartoe »

phikl wrote: And boom! Scrolling text web app!! Thank you for your help on this man I really appreciate it
Hey phikl, sir! I am really glad to hear you got it working!

If possible can you forward any tips on what in the learn guide could be more clear to get first time setups going with any gochas?

Also, your persistence is admirable.

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

Yeah I'm working on a guide for myself to put on my personal wiki to make note of exactly what I have done. Will post tips etc once I am done. My persistence is mostly down to stubbornness to be honest. I knew I could get this working!!

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by onebeartoe »

Sounds good. I'd like to see what all is needed to get going with that Web app that is not mentioned in the learn guide.

User avatar
phikl
 
Posts: 9
Joined: Wed Oct 28, 2020 7:48 pm

Re: RGB Led Matrix WebApp - runtext.py not working

Post by phikl »

Hey man sorry for the delay. I rebuilt my scroller box this weekend so I could track everything I had done. I've added and edited various bits on the original guide including the install of openjdk and git as well as including some detail on the launcher script I put together to launch the whole thing on boot:

sudo apt-get update

sudo apt install libgraphicsmagick++-dev libwebp-dev -y

sudo apt install libwebp-dev

sudo apt install python2.7-dev python-pillow -y

sudo apt install openjdk-11-jre git

// download the C++ project that drives the GPIO
git clone https://github.com/onebeartoe/rpi-rgb-led-matrix.git

// build the project, specifing the Adafruit HAT as the hardware profile
cd rpi-rgb-led-matrix
sudo HARDWARE_DESC=adafruit-hat make install-python

cd utils/
sudo make led-image-viewer

cd ../examples-api-use
sudo make

cd home/**user**
sudo mkdir scroller
sudo chown **user** home/**user**/scroller
transfer the 'payara-micro-5.2020.6.jar' and 'rpi-rgb-led-matrix-webapp-0.0.1-SNAPSHOT.war' files to the scroller folder

//decrease GPU memory
run 'raspi-config' and decrease GPU memory to 16 via '4 Performance Options/P2 GPU Memory'. This will speed up the java webapp deployment below

//test the java webapp deployment
sudo java -jar payara-micro-5.2020.6.jar --deploy rpi-rgb-led-matrix-webapp-0

Once the web app is running (give about 5 minutes to start depending on the Pi model) navigate to the settings page and clear out the 'Command Line Flags' box replacing it with '-r 16'. This defines the rows for the matrix as the code is originally for a 32x32 matrix (I have a 16x32 matrix). I have not tested this on a 32x32 matrix, so you may want to play and experiment here until you get a result.

Navigate back to the scrolling text page and enter some text to test.

At this point I still couldn't get the scrolling text to work and knew after double-checking my steps I had done everything correctly. I took a chance and ran the original adafruit script below and tested again. This resulted in the scrolling text appearing on my matrix and one very happy geek!

curl https://raw.githubusercontent.com/adafr ... -matrix.sh >rgb-matrix.sh
sudo bash rgb-matrix.sh

//Launch on boot
sudo mkdir scripts

cd scripts

sudo nano launcher.sh

Paste the below into the new 'launcher.sh' file:

cd /
cd home/pi/scroller
sudo java -jar payara-micro-5.2020.6.jar --deploy rpi-rgb-led-matrix-webapp-0.0.1-SNAPSHOT.war
cd /

Make the launcher file executable:
sudo chmod 755 launcher.sh

And test with:
sh launcher.sh

If the webapp deploys successfully ie no errors appear the launcher script is working. Press control + C on your keyboard.

Create log directory to log any failures;
sudo mkdir logs

Open crontab:
sudo crontab -e

and enter the below:
@reboot sh /home/pi/scripts/launcher.sh >/home/pi/logs/cronlog 2>&1

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”