Squeezing NMON on the LCD; magnifying glass anyone?

Moderators: mdrjr, odroid

Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Sun Feb 11, 2018 6:01 am

So I was thinking of other ways of using the LCD outside of the looping shell script; which actually utilizes more CPU than probably needed for the task.

But NMON does fit... lol; barely. (making it this small you need to change the console font)

Once I get a bit more time I'll compile my own version of NMON which includes the XU4 CPU speeds and core temperature.


My camera phone leaves a lot to be desired so I captured the raw frame buffer and attached it as well.
screen2.png
RAW frame buffer
screen2.png (2.9 KiB) Viewed 1362 times



Bad phone picture... actually not hard to read in person. Just really fricken small. lol
20180210_145444_s.jpg
Cruddy phone picture
20180210_145444_s.jpg (863.06 KiB) Viewed 1362 times


Anyway, whenever I compile my mod'd NMON to add in CPU temps and Core speeds I'll attach it here if anyone wants it.


Download Package
https://github.com/DaveBurkhardt/clouds ... s/tag/v1.0
Last edited by David.B on Sat Feb 24, 2018 1:51 am, edited 4 times in total.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Sun Feb 11, 2018 9:00 am

You will have to get up and put the CloudShell to your face to see it :)

I like it.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby odroid » Sun Feb 11, 2018 10:24 am

I love the high-density screen even though my old eyes can't read it. :D
User avatar
odroid
Site Admin
 
Posts: 28739
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Sun Feb 11, 2018 3:37 pm

Thanks, ya I just wanted to see if it could be done. I only sit 1' away from it at my desk.

I modified the code a bit and added some checks for XU4 CPU for Temperature/Clock speeds (XU4 section in cyan). Temp color changes once it's gets hot enough. Nice thing is it takes next to no CPU. I mostly started looking into this when I noticed the cloudshell-lcd shell script was taking 18% of one core when it cycled.

screen3.png
screen3.png (3.27 KiB) Viewed 1321 times
Last edited by David.B on Mon Feb 12, 2018 10:16 pm, edited 1 time in total.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby odroid » Mon Feb 12, 2018 10:17 am

It is quite amazing how the tiny LCD can show a lot of system stats.
Please share your NMON source code for other users if you don't mind.
User avatar
odroid
Site Admin
 
Posts: 28739
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Mon Feb 12, 2018 10:18 pm

Sure NP. Is there a public git repo where I can commit the source and associated files (C code, makefile, fonts, startup scripts)?

I also add in another tab which shows memory like the command "free" does (stats pulled from /proc of course)
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Mon Feb 12, 2018 10:40 pm

You can just link your clone.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Tue Feb 13, 2018 12:08 am

rooted wrote:You can just link your clone.


Ok, sure. I'll push my changes and add it in here when I get time this week.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Wed Feb 14, 2018 6:35 am

Look forward to it, my CloudShell display is just sitting there turned off since I quit running DietPi.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Thu Feb 15, 2018 1:26 pm

Github Link

https://github.com/DaveBurkhardt/clouds ... s/tag/v1.0


I put all of the files (source/binary/scripts/debian package) on there. I have a few more changes to make like colorizing the 'f' free output. But it's mostly done.
Last edited by David.B on Sat Feb 24, 2018 1:50 am, edited 2 times in total.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby odroid » Thu Feb 15, 2018 2:41 pm

Really appreciate sharing the files. :D
User avatar
odroid
Site Admin
 
Posts: 28739
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Thu Feb 15, 2018 11:05 pm

NP.

Someone will have to let me know if they try the .deb package. Works OK on my Cloudshell2 with the skeleton debian release you recommended on your wiki.

I included manual instructions for anyone who wants to take that approach.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Fri Feb 16, 2018 3:27 am

David.B wrote:NP.

Someone will have to let me know if they try the .deb package. Works OK on my Cloudshell2 with the skeleton debian release you recommended on your wiki.

I included manual instructions for anyone who wants to take that approach.
I tried it but I can't get my display to power up for some reason.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Fri Feb 16, 2018 3:51 am

rooted wrote:
David.B wrote:NP.

Someone will have to let me know if they try the .deb package. Works OK on my Cloudshell2 with the skeleton debian release you recommended on your wiki.

I included manual instructions for anyone who wants to take that approach.
I tried it but I can't get my display to power up for some reason.


ya, my package really only works with the FB drivers for the LCD; it doesn't drive the LCD itself. Those drivers need to exist already.

These were the questions that popped into my head...


1) Do you have the fb_ili9340 and associated modules loaded?
2) Anything plugged into the HDMI connector? I know it won't come up if something is plugged into the HDMI.
3) Does the LCD backlight illuminate?
4) re-seat the ribbon cable on both ends?

5)What do the following commands return for you? (can you paste the output here)

dmesg | grep fb_

Code: Select all
$dmesg | grep fb_
...
[   10.273015] spi spi1.0: fb_ili9340 spi1.0 35000kHz 8 bits mode=0x00
[   11.076348] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[   11.565422] graphics fb0: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=20, spi1.0 at 35 MHz


lsmod

Code: Select all
$lsmod
...
fb_ili9340             16384  1
fbtft_device           40960  0
fbtft                  36864  2 fbtft_device,fb_ili9340
spidev                 20480  0
spi_s3c64xx            20480  0
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Fri Feb 16, 2018 4:22 am

I know that mate, I just never tried to get the screen up and running on Armbian after switching from DietPi.

Module's are loaded, dev entry is not there, screen works as I can boot DietPi and it works fine.

*edit*
It's 'fbtft_device', what parameters do I need to load with it? I can't simply modprobe it I get "invalid argument".

*edit2*
When in doubt, check the wiki.

It's "options fbtft_device name=hktft9340 busnum=1 rotate=270"

Wiki:
https://wiki.odroid.com/accessory/add-o ... lcd_config

And your deb is working but it is spinning up the fan which means it's using too much CPU.

*edit3*
It's not your package causing the fan to spinup, it's something to do with the display. I removed your package, rebooted and I was still having high CPU usage but nothing in htop was using the CPU. Removed the modules and CPU usage went back to normal. Without digging into it further it must be interrupts causing the spike, which must be a bug in the kernel I'm running. It didn't behave this way on DietPi.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Fri Feb 16, 2018 5:02 am

rooted wrote:I know that mate, I just never tried to get the screen up and running on Armbian after switching from DietPi.

Module's are loaded, dev entry is not there, screen works as I can boot DietPi and it works fine.

*edit*
It's 'fbtft_device', what parameters do I need to load with it? I can't simply modprobe it I get "invalid argument".

*edit2*
When in doubt, check the wiki.

It's "options fbtft_device name=hktft9340 busnum=1 rotate=270"

Wiki:
https://wiki.odroid.com/accessory/add-o ... lcd_config

And your deb is working but it is spinning up the fan which means it's using too much CPU.



You didn't provide any answers to my questions; so I can't be of much help. if you wan to provide them I'll continue helping.



I *highly* doubt my DEB is taking any CPU that's noticeable. Best to prove your theory before making assumptions right?

There is only two executables with my deb, cloudshell-nmon and nmon-xu4

paste the output of "ps aux | grep nmon"


Or run top or htop and see whats taking up CPU.

As you can see nmon-xu4 doesn't even show up in top... because it takes so little cpu.

Code: Select all
top - 14:01:48 up 16:16,  3 users,  load average: 0.41, 0.19, 0.12
Tasks: 169 total,   1 running, 108 sleeping,   0 stopped,   0 zombie
%Cpu0  :  0.0 us,  0.0 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.3 hi,  0.0 si,  0.0 st
%Cpu1  :  0.3 us,  0.0 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu3  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu4  :  0.3 us,  0.3 sy,  0.0 ni, 99.0 id,  0.0 wa,  0.3 hi,  0.0 si,  0.0 st
%Cpu5  :  0.0 us,  0.3 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu6  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu7  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  2042372 total,    76924 free,   281732 used,  1683716 buff/cache
KiB Swap:        0 total,        0 free,        0 used.  1629452 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
15883 root      20   0    5040   2252   1748 R   0.7  0.1   0:00.31 top
  106 root      20   0       0      0      0 I   0.3  0.0   3:28.96 kworker/1:1
 1183 plex      20   0  124572  12264  11188 S   0.3  0.6   0:14.19 Plex Tuner Serv
13884 david     20   0    3560   2296   1408 S   0.3  0.1   0:01.33 screen
    1 root      20   0   24112   4104   2640 S   0.0  0.2   0:10.95 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.02 kthreadd
    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/0:0H
    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_wq
    7 root      20   0       0      0      0 S   0.0  0.0   0:00.02 ksoftirqd/0
    8 root      20   0       0      0      0 I   0.0  0.0   0:03.10 rcu_preempt
    9 root      20   0       0      0      0 I   0.0  0.0   0:00.00 rcu_sched
   10 root      20   0       0      0      0 I   0.0  0.0   0:00.00 rcu_bh
   11 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/0
   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/0
   13 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/1
   14 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/1
   15 root      20   0       0      0      0 S   0.0  0.0   0:00.01 ksoftirqd/1
   17 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/1:0H
   18 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/2
   19 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/2
   20 root      20   0       0      0      0 S   0.0  0.0   0:00.00 ksoftirqd/2
   22 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/2:0H
   23 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/3
   24 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/3
   25 root      20   0       0      0      0 S   0.0  0.0   0:00.00 ksoftirqd/3
   26 root      20   0       0      0      0 I   0.0  0.0   0:00.00 kworker/3:0
   27 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/3:0H
   28 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/4
   29 root      rt   0       0      0      0 S   0.0  0.0   0:00.77 migration/4
   30 root      20   0       0      0      0 S   0.0  0.0   0:00.06 ksoftirqd/4



The process hasn't even used 60 seconds of CPU time in 24 hours. It used 58/86400's of a single CPU in 24 hours. In other words it's using .06% of a single CPU. (huge improvement over the cloudshell-lcd)

Code: Select all
# ps aux | grep nmon-xu4
root      7180  0.1  0.1   6052  3684 ?        S    Feb14   0:58 nmon-xu4
Last edited by David.B on Fri Feb 16, 2018 5:17 am, edited 4 times in total.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Fri Feb 16, 2018 5:02 am

I edited my post more, I agree it isn't your package.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Fri Feb 16, 2018 5:11 am

rooted wrote:I edited my post more, I agree it isn't your package.


When you find some time paste the output of the command(s) I had in the previous post. Lets see if all of your modules are loaded and what the output of them is in dmesg.

huh, I see your edits. It sounds like it's something with the modules/kernel config.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby rooted » Sat Feb 17, 2018 6:58 pm

David.B wrote:
rooted wrote:I edited my post more, I agree it isn't your package.


When you find some time paste the output of the command(s) I had in the previous post. Lets see if all of your modules are loaded and what the output of them is in dmesg.

huh, I see your edits. It sounds like it's something with the modules/kernel config.
Turned out to be ads7846 causing insane IRQ usage, blacklisted it and no more issues.

It's a nice mod, I like having my screen back to being useful. Thanks for sharing.
User avatar
rooted
 
Posts: 5607
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Squeezing NMON on the LCD; magnifying glass anyone?

Unread postby David.B » Sun Feb 18, 2018 3:43 am

Awesome! Glad you got your screen working. Ya the condensed display is neat. Albeit very small! lol

thanks, I'll continue to update it as I have a few more changes I wanted to add.
David.B
 
Posts: 26
Joined: Tue Jul 19, 2016 10:34 am
languages_spoken: english
ODROIDs: C2, Xu4


Return to CloudShell

Who is online

Users browsing this forum: No registered users and 0 guests