netmon_wce - network tray monitor

Configuration wizards, scanners, remote desktop, etc.
Message
Author
User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#21 Post by mikeb »

Ok built and tested

needed
#include <sys/ioctl.h>
#include <sys/socket.h>

and one for close() ..not sure which...again might be system variations...

The resultant output agreed with lame wifi this time. :)

Hope thats helpful...

mike

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#22 Post by 01micko »

#include <unistd.h>

maybe my newer sys/socket.h drags the others in.

Ok, so you get same output all the time, so I wont bother adding that method but think of some other way so we don't have to alter the code.
Puppy Linux Blog - contact me for access

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#23 Post by rcrsn51 »

Be aware that not all Linux WiFi drivers report their signal strength in a consistent manner. For example, the popular rtl8188eu driver always reports its strength as zero, both in iwconfig and /proc/net/wireless.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#24 Post by 01micko »

rcrsn51 wrote:Be aware that not all Linux WiFi drivers report their signal strength in a consistent manner. For example, the popular rtl8188eu driver always reports its strength as zero, both in iwconfig and /proc/net/wireless.
yes, another reason to make non-polling the default.

Well, after a bit of a headache I found out how wireless-tools (in libiw) finds the '70' that seems to be the default for a lot of wireless chip drivers including most of the ones I own. Now that I know that I can use the previously posted routine in the code and cache that value, if it exists. This creates another dependency however it doesn't add much to the binary - <libiw.h> and a ld needs -liw on the linker line.

If it doesn't exist we assume 100 (probably Mike's case, and Patriot's original case) and if we get stupid values like zero we don't do any division. If stupid values like over 100% show up just pop a message in the tooltip like 'wireless stats don't work, revert to standard' - so yes, will be going with non-polling as default and probably enable polling as a menu entry.
Puppy Linux Blog - contact me for access

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#25 Post by mikeb »

Ah so the standard is to not have a standard...I remember similar piddling around with vattery and different machines and systems.

Well at least you have something to chew on....like your left ankle in this case...

thanks for the efforts on this one...

mike

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#26 Post by 01micko »

mikeb wrote:Ah so the standard is to not have a standard...I remember similar piddling around with vattery and different machines and systems.
Standards? Linux? :lol:
mikeb wrote:Well at least you have something to chew on....like your left ankle in this case...

thanks for the efforts on this one...

mike
Okie .. chewed thru the ankle and here is tha latest src package. I'll be away for some days so giving it a soak test on my lappy with the stats running - see if leaks much!

Notes;

- the patch is still there and _might_ apply cleanly as I haven't updated it.

- the default is non-polling mode (wireless) - change that in the right click menu. Wired mode shouldn't show any differently.

- uses the routine (roughly) posted earlier and links to libiw - you may well need shared libiw (re slax - if it uses slackware's static iw)

- don't know if headers are ok - let me know and I will put in some pre-processes

- slowed the polling slightly as in the context of the program it's not possible to change that value on the fly (which would have been nice for wireless - maybe that needs a cli option)

Have fun :wink:

attachment deleted
Last edited by 01micko on Sat 18 Jul 2015, 10:47, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#27 Post by mikeb »

Nice one...will give it a spin later hopefully.

mike

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#28 Post by mikeb »

Ok did not patch or fiddle and it built cleanly on thee slax using its static libiw.

Running as expected...if wifi polling enabled it gives the correct value.

So you are handling the wifi quality readings ok then... so would polling on as default actually be an ok option if its working as desired?

Enjoy your break

mike

edit...patch was stretched too far so made the changes manually...its evolving anyway so no worries.
By the way dhcpcd -k %s seems universal..I found some that did not use --release

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#29 Post by 01micko »

Hi Mike and those interested,

Well after the 3 days ran htop -p `pidof netmon_wce` and all was sweet. 1.3% mem usage which was the same when I left so, pretty much no leakage :D . My lappy is running 64 bit OS and is only harbouring 1 GB shared RAM.

So now I've integrated the wireless stuffs and added the ability to start it from a symlink if you want to default to wireless polling. The menu entry is still there. AND.. I found out how to change the 'interval' on the fly! A very handy feature so that we don't choke the thing when using polling. The default I'm using is 2 seconds, but I reckon 5 seconds is plenty much. See - ptomato's post http://stackoverflow.com/questions/2948 ... ts-in-glib
(BTW - replaced the deprecated gtk_timeout_add with g_timeout_add a few iterations ago).

Before I publicise though, I'm going to add back a feature that was half pie there before: monitoring of multiple interfaces. It won't be fully supported by the icon, however, it will be in the tooltip, and also in the right click menu.

For example, you may have eth0, wlan0 and usb0 all connected and active at once. It would be nice to connect and disconnect each one eh? And also have the tooltip for each one too eh? For this I'll ditch using the 'connection manager' (which could be any number of progs in puppyland) and access dhcpcd (and options) directly for each iface.

Then I'll let this out in the wild, maybe even binary packaged, for further evaluation.

Cheers!

EDIT: no - too ambitious, not enough time. I like it how it is anyway so I'm glad I removed the half pie support. If you plug something else and get an IP it updates anyway, so that's enough.
Puppy Linux Blog - contact me for access

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#30 Post by mikeb »

Nice one....

well only time I would think of multiple instances would probably involve internet sharing so readings etc would be a little pointless...ie you only want to know what the internet traffic is.

Sounds like a winner and long overdue integrated wifi monitoring.

I also think less manic polling is fine...after all you only want a general idea of signal quality unless you are jogging or something :D

Direct dchpcp handling seemed fine and made sense and as mentioned is more generic..... plus its basically a monitor rather than a full blown network control center... oh the potential power muh haw haw...


mike

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#31 Post by 01micko »

New version is out, pets included. See main post

New features as described in the past couple of posts are added (not multiple interfaces - too much trouble). I didn't go with dhcpcd directly however, the patch is updated and that does deal with dhcpcd directly.


-------


@mikeb

Here is one line for your slax installs, and may even install with installpkg, even though it doesn't produce a legit slackware package -

Code: Select all

sh patch_me.sh yes please && make && sh package non-pup
See the 'package' script for more details.

See the extras dir for hints on getting the tx and rx stats saving at shutdown. That is basically what is in puppy's rc.shutdown script and has been for several years (circa 2010).
Puppy Linux Blog - contact me for access

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#32 Post by mikeb »

Well much appreciated...

its not just a slax thing as me pups and related stuff tend to have less puppyisms to make them more generic anyway.

Plus puppyisms vary somewhat as you well know so I aim for the 'work for anything' approach when possible.

Well will be testing out if I can drag myself away from this rather nice escape we are at up a river where the world cannot find us though the mosquitoes seem to find us regardless... :)

mike

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#33 Post by 01micko »

mikeb wrote:its not just a slax thing as me pups and related stuff tend to have less puppyisms to make them more generic anyway.
Sure. I don't like puppyisms myself, especially hard coding to /root :twisted:

BTW, I think I forgot to switch dhcpcd -k (from --release). You should be able to edit the patch ok - but no guarantees.

Thanks for your testing and suggestions - been a valuable contrib. :)
Puppy Linux Blog - contact me for access

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#34 Post by mikeb »

Been adrift for a while....

after the -k fix built cleanly and working happily... seems like a winner :)

cheers

mike

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#35 Post by 01micko »

mikeb wrote:Been adrift for a while....
Good for you :)
mikeb wrote:after the -k fix built cleanly and working happily... seems like a winner :)

cheers

mike
Good. I'll probably edit the source at some point and bring out a more or less 'final' version, pending any bug reports. I'm pretty happy with it. Been running on my lappy ever since the last mention and ram/cpu is consistent so no evidence of any leakage.
Puppy Linux Blog - contact me for access

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#36 Post by Moat »

Kicks butt, Mick! Noobish me fussing around lately, I've discovered the default network_tray in many/most (all?) Pups is one of the - if not *THE* - primary cause of Puppy's tendency towards somewhat high idle CPU use. That's always kinda' bugged me.

Quick test of your netmon_wce on this old Pentium D Optiplex GX620 running Tahrpup 6.0.2 clearly shows idle CPU use dropping from %4-6 to %1-2... flippin' great!! Finally, that issue seems fixed (here, at least). Polling enabled, too. Love the signal strength meter also.

Fantastic update! 8)

Bob

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#37 Post by 01micko »

Good to hear Bob :)

Now if we can snag a few more reports I'll ensure it becomes the default in future woof-CE based puppies.
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#38 Post by 01micko »

Minor update to version 2.6

See main post

Code: Select all

20150727 netmon_wce-2.6
-----------------------
bugfix - gettext - remove '\n' char from translations for clarity
 -@line 221
 -@line 258
 -@line 313
 -@line 330
bugfix - fix compile warning -Wformat @line 139 (seen in tahrpup)
add .pot file to 'package'
===============================================================================
NOTE: a .pot file is included in the pet.
Puppy Linux Blog - contact me for access

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#39 Post by Smithy »

The old behaviour of Barry's network monitor is to also show network input and output.
I might be barking up the wrong tree here, but should there also be:
internet_connect_input.svg and internet_connect_output.svg in addition to internet_connect_both.svg?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#40 Post by 01micko »

Smithy wrote:The old behaviour of Barry's network monitor is to also show network input and output.
I might be barking up the wrong tree here, but should there also be:
internet_connect_input.svg and internet_connect_output.svg in addition to internet_connect_both.svg?
TBH, I didn't want the icon to be too "loud" so that's why it's a bit toned down. BK's original had 5 icons, this one has 4.
Puppy Linux Blog - contact me for access

Post Reply