Interfaces that talk across multiple computers, how?
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
my test
my test.
Open demo_2pwr.sh 2 seconds.
press key responds almost immediately.
maybe using the nice command improve it.
Is too late here I must go to the bed .
make mistake with one computer in my work, the computer I test it is:
See you tomorrow.
Open demo_2pwr.sh 2 seconds.
press key responds almost immediately.
maybe using the nice command improve it.
Is too late here I must go to the bed .
make mistake with one computer in my work, the computer I test it is:
See you tomorrow.
- Attachments
-
- cpu.png
- (34.68 KiB) Downloaded 190 times
starhawk,
With the latest demo_2pwr.sh edit lines 38 and 39 and change to tim=1
From cli run:
or
Open a new terminal and run:
That will tell you roughly the cpu and memory usage of the program.
Realistically, gtkdiaolog is too slow to go below a 1 s time refresh interval. I have tried 0.5 and it barely works on a smaller program, so for stability 1 s is the limitation here.
Caching the gui has brought down the cpu usage dramatically so I don't see why it wont run ok on a PIII (which is what via cpu's are more or less equivalent to).
With the latest demo_2pwr.sh edit lines 38 and 39 and change to tim=1
From cli run:
Code: Select all
./demo_2pwr.sh tm
Code: Select all
./demo_2pwr.sh hm
Code: Select all
top -p `pidof demo_2pwr.sh`
Realistically, gtkdiaolog is too slow to go below a 1 s time refresh interval. I have tried 0.5 and it barely works on a smaller program, so for stability 1 s is the limitation here.
Caching the gui has brought down the cpu usage dramatically so I don't see why it wont run ok on a PIII (which is what via cpu's are more or less equivalent to).
Puppy Linux Blog - contact me for access
Try this
A number should be output that is the process ID (PID) of the program.
run:
obviously with the number from the first command.
If pidof fails, try busybox pidof instead.
Code: Select all
pidof demo_2pwr.sh
run:
Code: Select all
top -p 1234
If pidof fails, try busybox pidof instead.
Puppy Linux Blog - contact me for access
*sigh*
Code: Select all
# pidof demo_2pwr.sh
9454
# top -p 9454
top: invalid option -- 'p'
BusyBox v1.19.3 (2011-11-09 07:34:50 WST) multi-call binary.
Usage: top [-b] [-nCOUNT] [-dSECONDS] [-m]
Provide a view of process activity in real time.
Read the status of all processes from /proc each SECONDS
and display a screenful of them.
Keys:
N/M/P/T: show CPU usage, sort by pid/mem/cpu/time
S: show memory
R: reverse sort
H: toggle threads, 1: toggle SMP
Q,^C: exit
Options:
-b Batch mode
-n N Exit after N iterations
-d N Delay between updates
-m Same as 's' key
# top 9454
top: invalid option -- '9'
BusyBox v1.19.3 (2011-11-09 07:34:50 WST) multi-call binary.
Usage: top [-b] [-nCOUNT] [-dSECONDS] [-m]
Provide a view of process activity in real time.
Read the status of all processes from /proc each SECONDS
and display a screenful of them.
Keys:
N/M/P/T: show CPU usage, sort by pid/mem/cpu/time
S: show memory
R: reverse sort
H: toggle threads, 1: toggle SMP
Q,^C: exit
Options:
-b Batch mode
-n N Exit after N iterations
-d N Delay between updates
-m Same as 's' key
#
sorry about that, I'm using real 'top'. Have you got htop? Try the previous command with that instead.
Puppy Linux Blog - contact me for access
Code: Select all
# htop
bash: htop: command not found
#
.. you are just plain outa luck!
...or are you?
Save this as "pm_top" (pm="poor man's)
It will work best if you call it with demo_2pwr.sh and gtkdialog (as long as no other gtkdialog process is running)
eg:
This actually overcomes a limitation of top, htop as we can show just those 2 processes at once, since they are all we are interested in.
EDITED0: to show PID
EDITED1: to ignore non-running processes
...or are you?
Save this as "pm_top" (pm="poor man's)
Code: Select all
#!/bin/sh
# pm_top
# a poor man's top
v=0.1
args=$#
usage() {
echo "${0##*/}-$v"
echo
echo -e "\t${0##*/} [array of programs]\n"
echo "eg:"
echo -e "\t${0##*/} foo bar baz\n"
echo ".. assuming foo, bar and baz are processes on your system."
echo "quit with CTRL+C"
exit
}
clear
#echo "$args args"
[ -z "$1" ] && usage
while [ 1 ];do
z=1
d=1
for i in "$@";do
pid=$(pidof $i)
if [ -z "$pid" ];then
echo "$i not running"
[ $args = $d ] && echo "exiting" && exit #everything is empty
d=$(($d + 1))
continue
else
args=$((args + 1))
pid=${pid%% *}
echo -en "$i\tpid: $pid"
echo
ps -p $pid -o %cpu,%mem,cmd 2>/dev/null
z=$(($z + 1))
fi
done
sleep 2
clear
done
eg:
Code: Select all
./pm_top gtkdialog demo_2pwr.sh
EDITED0: to show PID
EDITED1: to ignore non-running processes
- Attachments
-
- pm_top.png
- pm_top in action
- (32.78 KiB) Downloaded 149 times
Last edited by 01micko on Thu 14 May 2015, 04:31, edited 2 times in total.
Puppy Linux Blog - contact me for access
well if ps is the busybox version then there is a bad bug in your puppy
What version?
BTW, edited script to show PID.
Here's how to tell:
What version?
BTW, edited script to show PID.
Here's how to tell:
Code: Select all
which ps-FULL
Puppy Linux Blog - contact me for access
Code: Select all
# which ps-FULL
/bin/ps-FULL
#
Ok, so it will work. Perhaps I didn't explain that demo_2pwr.sh must be running.
Puppy Linux Blog - contact me for access
... and .. loving it!
Edited a second time to ignore mistakes/non-running-progs on the cli. If all of them are non running, the prog just dies peacefully.
Edited a second time to ignore mistakes/non-running-progs on the cli. If all of them are non running, the prog just dies peacefully.
Puppy Linux Blog - contact me for access
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Question?
The question is there any way to make the process faster than the timer gtkdialog program.
01micko said
or only to appear at the top of htop.
If I do:
What is burning my head is how do that gtkdialog refresh the pictures SVG faster.
It occurred to me this script to calculate the time it takes to open the gtkdialog demo_2pwr.sh program not very accurate
time = first date - last date
01micko said
Does this make the program go faster?Try this
pidof demo_2pwr.sh
run:
top -p 1234
or only to appear at the top of htop.
If I do:
I see that all programs have the same priority maximum 20 PRI as you can see in the picture below.ps al
What is burning my head is how do that gtkdialog refresh the pictures SVG faster.
It occurred to me this script to calculate the time it takes to open the gtkdialog demo_2pwr.sh program not very accurate
Code: Select all
#!/bin/sh
date
./demo_2pwr.sh &
while !( ps aux | grep -v 'grep' | grep -q 'gtkdialog'); do date ; done
time = first date - last date
- Attachments
-
- ps.png
- (68.63 KiB) Downloaded 388 times
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Hi starhawk
In this program so far no problem because only one or two images cools SVG, but when you have to refresh multiple images SVG problems begin.
Try this test program will not finish the up button - down and RST.
it have to refresh a number of images each time:
4 displays x 7-segment + 4 points = 32 SVG images.
This makes the program slow gtkdialog
I can make all the big part of the program in C, would gain in speed but still refresh process images would be slow.
Try this test program will not finish the up button - down and RST.
it have to refresh a number of images each time:
4 displays x 7-segment + 4 points = 32 SVG images.
This makes the program slow gtkdialog
I can make all the big part of the program in C, would gain in speed but still refresh process images would be slow.
- Attachments
-
- panel.png
- (20.07 KiB) Downloaded 338 times
-
- PANEL.tar.gz
- (6.01 KiB) Downloaded 156 times
Re: Hi starhawk
Yes I am afraid that the limitation in this program and my program is definitely refreshing of the images in gtkdialog. It is too slow and nothing can be done about that.mister_electronico wrote:In this program so far no problem because only one or two images cools SVG, but when you have to refresh multiple images SVG problems begin.
Try this test program will not finish the up button - down and RST.
it have to refresh a number of images each time:
4 displays x 7-segment + 4 points = 32 SVG images.
This makes the program slow gtkdialog
I can make all the big part of the program in C, would gain in speed but still refresh process images would be slow.
In C, instead of SVG you can use Cairo which is still a vector library but with completely different syntax. The 'images' can be held in memory, instead of writing to disk (essentially /tmp is mounted on RAM, but we still consider this 'writing to disk'). It's easy to make a structure for each type of image to make them an object.
This would significantly speed up the process. To make it even faster, you can forget GTK and just use Xlib, however Xlib programming is quite 'dangerous' and very tedious! There is not much documentation apart from reading the sources. I know, I have a couple of programs which make use of Xlib only.
--------------------------------------------------------------------------
Starhawk.
Bad news I'm afraid. I have an XO-1.5 which is a via chipset using openchrome graphics driver and the program I wrote is just too slow. It takes, - er - "some" time for the gui to show but the key presses are unresponsive. This *could* be due to the XO not having a standard keyboard, I dunno, I didn't go too far into it. It is certainly a hamstrung machine, you may have better luck on your thin clients. I suggest you rig up a test machine and go for it before we waste too much time.
Aside from that, I have significantly sped up the appearance time of the gui by changing the shell call form #!/bin/sh to #!/bin/ash.
Ash is a busybox applet but it is a full featured interactive sh environment, however does have limitations. The main one is no bashisms, which kind of means that you have a reduced syntax set. Fortunately, my original code only included 1... export -f, but unfortunately this was a biggy! gtkdialog can't 'see' a non-exported function. You have to explicitly call it.
I decided a redesign was in order; didn't take much. Just moved all functions to a functions library which can be made use of from subsequent gui programs. I also threw away about 200 lines of code... actually 20k! It doesn't speed it up much though as it was only image generation stuff.
Anyway, enough waffle - program attached.
EDIT 0:
Oh, I have also significantly changed what keys do what. There are far less actions now, only 0-9 and x, y, z. I am assuming that the bottom 2 rows are 'indicators' (idiot lights) only and as such they are not assigned any key or action. I also need to know what the hell many of these things are !!! MANF, UNSP, NO FLT ??? Should they do anything.. that is, are they 'buttons' or 'indicators'?
Again, read README.md.
- Attachments
-
- starship-pwr-gui.png
- (25.62 KiB) Downloaded 356 times
-
- starship-V6.tar.gz
- bc6b70073e512104ab335b32276c71d2 starship-V6.tar.gz
- (8.03 KiB) Downloaded 125 times
Puppy Linux Blog - contact me for access
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Thanks
Thanks 01micko for your answer
01micko
How you do that you can put a small example.
It's a shame that gtkdialog works very well in Puppy.
01micko
Code: Select all
It's easy to make a structure for each type of image to make them an object.
It's a shame that gtkdialog works very well in Puppy.