Problem with Blinky
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Problem with Blinky
I've started this thread so hacking Blinky can be coordinated.
Anyone who wants to fix the problem can let the rest of us know, so we don't get 3 or 4 people simultaneously working on the same problem.
(well, I hope we do get one volunteer!)
The problem is described in the Developer News page for Jan. 3:
http://www.puppylinux.com/news.htm
Anyone who wants to fix the problem can let the rest of us know, so we don't get 3 or 4 people simultaneously working on the same problem.
(well, I hope we do get one volunteer!)
The problem is described in the Developer News page for Jan. 3:
http://www.puppylinux.com/news.htm
I use adsl, and your blinky-binary works.
It blinks blue and green.
I run it from a xterm in Fluxbox.
Mark
It blinks blue and green.
I run it from a xterm in Fluxbox.
Code: Select all
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:EB:0B:95:AD
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33952 errors:0 dropped:0 overruns:0 frame:0
TX packets:35465 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:18134355 (17.2 MiB) TX bytes:5764284 (5.4 MiB)
Interrupt:11 Base address:0xcc00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:208229 errors:0 dropped:0 overruns:0 frame:0
TX packets:208229 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:85177618 (81.2 MiB) TX bytes:85177618 (81.2 MiB)
ppp0 Link encap:Point-Point Protocol
inet addr:213.39.230.56 P-t-P:213.191.84.196 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:32299 errors:0 dropped:0 overruns:0 frame:0
TX packets:33812 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:17324510 (16.5 MiB) TX bytes:4970757 (4.7 MiB)
# dmesg |grep eth
eth0: Realtek RTL8201 PHY transceiver found at address 1.
eth0: Using transceiver found at address 1 as default
eth0: SiS 900 PCI Fast Ethernet at 0xcc00, IRQ 11, 00:50:eb:0b:95:ad.
eth0: Media Link On 100mbps full-duplex
#
Got it to work! :)
It didn't really use the /proc/net/dev file, it had some issues inserting new interfaces...
I'm attaching both files I've changed, let me know if it works for you!
http://lior.f2o.org/puppy/usage-proc.c
http://lior.f2o.org/puppy/ifa.c
I'm attaching both files I've changed, let me know if it works for you!
http://lior.f2o.org/puppy/usage-proc.c
http://lior.f2o.org/puppy/ifa.c
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
lior2b,
No, with my eth0 interface up, blinky displays blue LEDs, meaning that it has
found the interface, but they don't flash green. Hovering the mouse pointer over displays 0 bytes sent, 0 bytes received.
I only briefly looked at your mods. I saw the comment that it quits if no interface.
Blinky will run in the taskbar, and must not quit. If there are no active interfaces,
Blinky is supposed to display dark-red LEDs, then if an interface becomes active,
the LEDs become blue. This is great for dialup people as they can see at a glance
if their line has dropped out... I think maybe that's the idea? -- it depends how /proc/net/dev really works. I guess -- can't ppp0 be up even after the line has dropped out/disconnected?
No, with my eth0 interface up, blinky displays blue LEDs, meaning that it has
found the interface, but they don't flash green. Hovering the mouse pointer over displays 0 bytes sent, 0 bytes received.
I only briefly looked at your mods. I saw the comment that it quits if no interface.
Blinky will run in the taskbar, and must not quit. If there are no active interfaces,
Blinky is supposed to display dark-red LEDs, then if an interface becomes active,
the LEDs become blue. This is great for dialup people as they can see at a glance
if their line has dropped out... I think maybe that's the idea? -- it depends how /proc/net/dev really works. I guess -- can't ppp0 be up even after the line has dropped out/disconnected?
Barry, it doesn't quit blinky, it skips the specific line in the /proc/net/dev file,
that's the terminology the original authour used
I'll research about /proc/net/dev to see how i can figure out if the interface is disconnected. Now blinky displays all interfaces listed in /proc/net/dev, and blinks upon activity. If an interface isn't listed anymore, blinky hides it.
Anyways, I'll work on it!
that's the terminology the original authour used
I'll research about /proc/net/dev to see how i can figure out if the interface is disconnected. Now blinky displays all interfaces listed in /proc/net/dev, and blinks upon activity. If an interface isn't listed anymore, blinky hides it.
Anyways, I'll work on it!
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
I wonder why mine isn't blinking.
I have an active eth0, but just have two blue LEDs.
I just looked at /proc/net/dev, the eth0 line is definitely functioning.
Here's a snapshot:
I have an active eth0, but just have two blue LEDs.
I just looked at /proc/net/dev, the eth0 line is definitely functioning.
Here's a snapshot:
Code: Select all
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth0: 1669215 2616 0 0 0 0 0 0 248945 2205 0 0 0 0 0 0
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Ha ha, now I know!
As I have two interfaces active, eth0 and lo, running blinky from the commandline displays two rows of LEDs.
However running blinky in the taskbar I only see the top row, which is the lo interface.
So, we need to get it to ignore the lo interface.
But that still leaves a problem, as the taskbar can only display the one row of
LEDs. If someone has both eth0 and ppp0 active, there's a problem.
Unless both interfaces are combined into the one row of LEDs?
-- that is, blinky only displays two adjacent LEDs regardless how many
interfaces, the Tx and Rx figures are just summed together.
However, a per interface breakdown could be displayed when the mouse is
hovered over the LEDs.
Note, we need to increase the timeout on the info display -- when mouse
pointed moves over the LEDs the info window pops up but disappears
too quickly.
As I have two interfaces active, eth0 and lo, running blinky from the commandline displays two rows of LEDs.
However running blinky in the taskbar I only see the top row, which is the lo interface.
So, we need to get it to ignore the lo interface.
But that still leaves a problem, as the taskbar can only display the one row of
LEDs. If someone has both eth0 and ppp0 active, there's a problem.
Unless both interfaces are combined into the one row of LEDs?
-- that is, blinky only displays two adjacent LEDs regardless how many
interfaces, the Tx and Rx figures are just summed together.
However, a per interface breakdown could be displayed when the mouse is
hovered over the LEDs.
Note, we need to increase the timeout on the info display -- when mouse
pointed moves over the LEDs the info window pops up but disappears
too quickly.
I made it ignore the lo interface, and i have some ideas:
(*) If no bytes ever recieved mark the interface as inactive (red)
(*) Show all intrefaces (except lo) that exist in /proc/net/dev, if anything disappears from /proc/net/dev mark it as inactive
(*) List all interfaces horizontally, not vertically
What do you say?
(*) If no bytes ever recieved mark the interface as inactive (red)
(*) Show all intrefaces (except lo) that exist in /proc/net/dev, if anything disappears from /proc/net/dev mark it as inactive
(*) List all interfaces horizontally, not vertically
What do you say?
Got some updates!
The "lo" interface is now omitted, the interfaces are now shown in a row, only active interfaces are shown, no red color...
Tell me what you think
Edit: I forgot to mention that right click now displays the information shown in the tooltip, hence the tooltip problem is solved...
http://lior.f2o.org/puppy/blinky_rev2/usage-proc.c
http://lior.f2o.org/puppy/blinky_rev2/blinky.c
http://lior.f2o.org/puppy/blinky_rev2/ifa.c
The "lo" interface is now omitted, the interfaces are now shown in a row, only active interfaces are shown, no red color...
Tell me what you think
Edit: I forgot to mention that right click now displays the information shown in the tooltip, hence the tooltip problem is solved...
http://lior.f2o.org/puppy/blinky_rev2/usage-proc.c
http://lior.f2o.org/puppy/blinky_rev2/blinky.c
http://lior.f2o.org/puppy/blinky_rev2/ifa.c
Blinky
I'm lookiing at the C code in the usage.proc. c source file . Look at this:
get_usage_all (void)
{
int fd;
static char buf[2048];
char *pos;
if ((fd = open("/proc/net/dev", O_RDONLY)) == -1) {
perror ("opening /proc/net/dev");
exit(1);
}
memset (buf, 0, sizeof(buf));
if (read (fd, buf, sizeof(buf)) == -1) {
perror ("reading /proc/net/dev");
exit(1);
}
close (fd);
pos = buf;
// what is this? Can this store the second line in the /proc/net/dev file so that it can be parsed? I doubt it unless I'm missing something here!
while (*(pos++) != '\n' ) ;
while (*(pos++) != '\n' ) ;
/* parse each line */
while (pos != NULL)
pos = parse_line (pos);
return;
}
I doubt if the 2 successive while loops can ever store the second string line in the /proc/net/dev file so that it can be parsed. This is the line that accesses the eth0 interface. I'll try to hack this later. Would explain why a live eth0 is not recognised?
How do I install Blinky so that it starts up by default at boot time?
get_usage_all (void)
{
int fd;
static char buf[2048];
char *pos;
if ((fd = open("/proc/net/dev", O_RDONLY)) == -1) {
perror ("opening /proc/net/dev");
exit(1);
}
memset (buf, 0, sizeof(buf));
if (read (fd, buf, sizeof(buf)) == -1) {
perror ("reading /proc/net/dev");
exit(1);
}
close (fd);
pos = buf;
// what is this? Can this store the second line in the /proc/net/dev file so that it can be parsed? I doubt it unless I'm missing something here!
while (*(pos++) != '\n' ) ;
while (*(pos++) != '\n' ) ;
/* parse each line */
while (pos != NULL)
pos = parse_line (pos);
return;
}
I doubt if the 2 successive while loops can ever store the second string line in the /proc/net/dev file so that it can be parsed. This is the line that accesses the eth0 interface. I'll try to hack this later. Would explain why a live eth0 is not recognised?
How do I install Blinky so that it starts up by default at boot time?
Life is too short to spend it in front of a computer
I'm not sure what you are asking... The two while loops skip the two first lines in the /proc/net/dev file, because they are not important...
Have you complied blinky with my mods? It works great for me!
Code: Select all
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth0: 1669215 2616 0 0 0 0 0 0 248945 2205 0 0 0 0 0 0
Blinky
Yeah that seems to work now OK on this system i.e Puppy 1.07. Well done! lior2b
Life is too short to spend it in front of a computer