Closed BrentRector closed 4 years ago
The Windows terminal supports truecolor and the WSL subsystem on Windows as well. I've no idea of Macs. Microsoft docs mention that most Linux systems support truecolor.
I'm still waiting on my LEDs (going with a significantly different approach hardware-wise as I'm getting discrete addressable LEDs). So I did this to occupy the down time. Thought I'd submit it in case anyone was interested. And if it doesn't do anything on some systems, no harm, no foul. :)
Most linux terminals are running on 8 or 256 colors. I tried your code using Putty into the Raspberry Pi and it basically just does nothing since the default is xterm, which runs on 8 colors. Since most people are building this on a Raspberry Pi, I'm not sure if it adds much value since it's effectively unused code.
What different hardware approach are you going with? The WS8211 LEDs are individually addressable, but linked in a chain so it's simple to connect, which is the whole point of the project.
Interesting. I just use the Windows built-in SSH from a Windows Terminal into my Raspberry Pi and I get 24-bit color. Likely it’s the Windows Terminal doing the heavy lifting. I’ve not tried it from a console on the Pi itself. I am building it on a Pi but from a Windows Terminal using SSH.
I’m planning to use NeoPixel Mini 3535 RGB LEDs, which are WS8211 compatible but fixed at 800 Khz, and come as individual 3mm parts. My idea is to mount the map on a thin opaque backing surface, put in a picture frame with an acrylic, not glass cover. Then drill 3 mm holes thru the acrylic at each airport. Insert and fix 3 mm light pipes into the holes. Then mount each 3 mm LED on the rear with the light coming thru the light pipe. The trick will be wiring up such small devices. One I get it wired, hopefully, it’ll work just as your existing solution but using much smaller LEDs. [A close up of a coin Description automatically generated]
Brent
Yes that makes sense. I'll close the PR since I think it won't be useful for the majority of people.
Good luck with your project, sounds like a cool idea with those tiny LEDs.
Hi Philip, I writing with hope of getting some help with the METAR map program. Ever since trying the new bash script, things aren’t the same. I’ve since deleted the bash script file “map_toggle.sh”, and removed and replaced the crontab and refresh.sh files and set the permissions on the new files. I’m still getting double instances of metar.py showing up and causing issues with the LED’s and the mini display. The crontab file is shown here:
#
#
#
#
#
#
/5 7-21 /home/pi/refresh.sh 05 22 * /home/pi/lightsoff.sh
When I run # ./refresh.sh, I get this: @.***:~ $ ./refresh.sh pkill: pidfile not valid Try `pkill --help' for more information.
The file not valid is the /home/pi/offpid.pid file. I don’t have that file in my directory.
My files: @.:~ $ ls -al total 180 drwxr-xr-x 18 pi pi 4096 Mar 20 23:03 . drwxr-xr-x 3 root root 4096 Sep 25 2019 .. -rw-r--r-- 1 pi pi 239 May 24 2020 airports -rw------- 1 pi pi 4669 Mar 20 23:03 .bash_history -rw-r--r-- 1 pi pi 220 Sep 25 2019 .bash_logout -rw-r--r-- 1 pi pi 3523 Sep 25 2019 .bashrc drwxr-xr-x 5 pi pi 4096 Sep 25 2019 .cache drwx------ 4 pi pi 4096 May 10 2020 .config -rw-r--r-- 1 pi pi 977 Mar 20 11:09 crontab drwxr-xr-x 2 pi pi 4096 Mar 20 11:09 Desktop -rw-r--r-- 1 pi pi 104 Feb 11 19:24 displayairports -rw-r--r-- 1 pi pi 2912 Mar 15 16:11 displaymetar.py drwxr-xr-x 2 pi pi 4096 Sep 25 2019 Documents drwxr-xr-x 2 pi pi 4096 Feb 9 16:02 Downloads drwx------ 3 pi pi 4096 Sep 25 2019 .gnupg -rwxr-xr-x 1 pi pi 53 May 9 2020 lightsoff.sh drwxr-xr-x 3 pi pi 4096 Sep 25 2019 .local drwxr-xr-x 2 pi pi 4096 Mar 15 15:52 MagPi -rw-r--r-- 1 pi pi 6 Mar 21 08:25 metarpid.pid -rw-r--r-- 1 pi pi 15650 Mar 17 10:31 metar.py -rw-r--r-- 1 pi pi 16384 Dec 13 2020 .metar.py.swp drwxr-xr-x 2 pi pi 4096 Sep 25 2019 Music drwxr-xr-x 2 pi pi 4096 Sep 25 2019 Pictures -rwxr-xr-x 1 pi pi 276 Apr 15 2021 pixelsoff.py -rw-r--r-- 1 pi pi 807 Sep 25 2019 .profile drwxr-xr-x 2 pi pi 4096 May 9 2020 Public drwxr-xr-x 2 root root 4096 Mar 15 16:01 pycache -rwxr-xr-x 1 pi pi 171 Mar 20 21:43 refresh.sh -rw-r--r-- 1 pi pi 66 Apr 10 2020 .selected_editor drwx------ 2 pi pi 4096 Jun 3 2020 .ssh -rw-r--r-- 1 root root 73 Mar 20 23:03 startup.log -rwxr-xr-x 1 pi pi 107 Mar 20 23:00 startup.sh drwxr-xr-x 2 pi pi 4096 Sep 25 2019 Templates drwxr-xr-x 2 pi pi 4096 Sep 25 2019 Videos drwx------ 3 pi pi 4096 May 10 2020 .vnc -rw------- 1 pi pi 110 Mar 20 23:03 .Xauthority -rw------- 1 pi pi 2604 Mar 20 23:03 .xsession-errors -rw------- 1 pi pi 2604 Mar 20 16:41 .xsession-errors.old @.:~ $
When I run: # ps -ef gets this: root 10622 2 0 08:12 ? 00:00:00 [kworker/1:2-mm_percpu_wq] root 10623 2 0 08:13 ? 00:00:00 [kworker/2:1H] root 10679 1 0 08:15 ? 00:00:00 /usr/bin/sudo /usr/bin/python3 /home/pi/metar.py root 10695 10679 16 08:15 ? 00:01:05 /usr/bin/python3 /home/pi/metar.py root 10713 2 0 08:16 ? 00:00:00 [kworker/2:1-mm_percpu_wq] root 10726 2 0 08:16 ? 00:00:00 [kworker/3:2-events_freezable] root 10792 1 0 08:20 ? 00:00:00 /usr/bin/sudo /usr/bin/python3 /home/pi/metar.py root 10794 1 0 08:20 ? 00:00:00 /usr/bin/sudo /usr/bin/python3 /home/pi/metar.py root 10808 10794 5 08:20 ? 00:00:05 /usr/bin/python3 /home/pi/metar.py root 10809 10792 4 08:20 ? 00:00:03 /usr/bin/python3 /home/pi/metar.py root 10810 2 0 08:20 ? 00:00:00 [kworker/1:0-mm_percpu_wq] root 10811 2 0 08:20 ? 00:00:00 [kworker/0:0-mm_percpu_wq] root 10812 2 0 08:21 ? 00:00:00 [kworker/2:2-events]
So I see the refresh kick in, but it does it twice. I can’t figure out why two jobs get run each time. I’m hoping you can help guide me where to look next.
Thanks, Lynol
It's an interesting idea, the only problem is that most terminals don't run with truecolor and thus it won't actually do anything.
The print message is really more for testing than for the continuous running of the script since most people only care about the LED output and not what's printed in the console.