LED color based on bandwidth usage

Yes, after some time it doesn’t work. I don’t know why but you can “repair” it for some time again by rebooting omnia-led-colors in LuCI.

Můžeme mluvit po našem :relaxed: Restartování v LuCI funguje ale jen na určitou dobu. Uvidíme co na to autor programu. Díky za info že to není jen můj případ.

CZ// Ano můžeme, avšak je to velmi neslušné, lidi zde píšou anglicky aby jim rozuměli všichni.
EN// Yes we can, but its very misbehavior, people are writing here in english so everyone can read and understand.

1 Like

CZ: Aha netušil jsem, že to tu má taková striktní pravidla. V jiných příspěvcích si s tím hlavu tak nějak nelámou. Díky za upozornění. Omlouvám se.

EN: Oh I did not know that there is such strict rules. In other contributions worry about it somehow be optimistic. Thanks for the warning. I am sorry.

1 Like

This must mean the omnia-led-colors process is crashing or not starting up. I’ll add some logging and see if I can catch this happening.

1 Like

I ran it with the print(s) uncommented in the debug_print(s) function until it crashed - here was the last output:

12592^/v19168 (0% 0 254 0)
12592^/v19168 (0% 0 254 0)
Failed to connect to generic netlink.
ath9k interface wlan1 nil data
10k cycle 2393550716 88578391 clear 0%

31920^/v40784 (0% 0 254 0)
31920^/v40784 (0% 1 253 0)
/usr/bin/lua: /usr/sbin/omnia-led-colors:74: attempt to perform arithmetic on field 'active' (a nil value)
stack traceback:
        [C]: in function 'foreach'
        /usr/sbin/omnia-led-colors:249: in main chunk
        [C]: ?
1 Like

Ah, thank you for finding this. I think changing line 73 to check that active isn’t null should fix the crash:

if (last_data ~= nil) and (last_data.active ~= nil) and (this_data.active ~= nil) then

So - does this awesome programm still work?

yup! I’m still using it. I noticed I forgot to push the fix into git, so now that’s updated.

I can confirm that after changing the 73 line it works without problems - I have been using it since you mentioned it here with no crashes like before.

1 Like

thank you - keep up the good work :slight_smile:

2 Likes

Works great, any chance you can help me decipher the code used to pick colors so I could change colors if I wanted? Looking at it, it’s a little difficult for me to understand how each block creates each color? I know the Turris GUI uses hex code for colors, but this appears to use the RGB scale… I found a easy conversion table here: http://www.rapidtables.com/web/color/RGB_Color.htm but I don’t know how to turn your code into the RGB scale…

I’m pretty new to openWRT (got my Turris 3 days ago…) so trying to learn how things are coded before I start attempting anything on my own… :slight_smile:

My first adjustment was to try and add the code for this: “Over 80% of both UL & DL => Purple LED?”, but it appears that I didn’t do the ‘and’ statement correctly and it just stopped working at all…

Thanks for any pointers or help!

great led usage! might set this up one day if i can figure out how to lol. curious, which modem is that? your ping was great! looking to get mine that low
and which ethernet switch are you using here if you don;t mind me asking

[quote=“theworstping, post:75, topic:1262”]
curious, which modem is that? your ping was great! looking to get mine that low[/quote]

I’m using the Arris SB6183 modem. The two biggest factors in the low ping time are:

  1. I’m using my internet provider’s speedtest, and their server is physically located in the same city as me.
  2. My provider has sufficient capacity on the cable network between my house and their network.

I have a generic “ABS” brand ethernet switch. I think I got it from newegg. Ethernet switches aren’t going to make a significant difference in your ping.

some of it has to do with modem, i had a netgear cm7 something and my ping would shoot up for no reason… ive heard a lot of good things about that 6183. are you running any qos on your turris? and if so which qdisc etc

[quote=“theworstping, post:77, topic:1262, full:true”]
some of it has to do with modem, i had a netgear cm7 something and my ping would shoot up for no reason…[/quote]

This is true, I had an Arris DG1670A before this 6183, which is a combination router+modem. It added around 5ms to my average ping. I believe the DG1670A has a 10ms network coalesce (which would raise the average ping by 1/2 that amount). Other modems could do this as well.

I don’t remember doing anything special for qos. Looks like it’s using fq_codel.

also how do you know their server is located in the same city as you? how would i check if mine is close to me. i know there is an office of theirs down the street, but how might i check if their server is located close by?

Most speedtest pages show the location of the speedtest server. I’ve blurred it out in my video, but that’s how I knew where their server was.

1 Like

Hello, thanks for this mod, I like this bandwidth dependent coloring.

Could you pelase outsource the treshold and color config out of the code into the config file --> /etc/config/omnia-led-colors. I think it belongs there, and people wouldn’t wonder where to adjust colors.
So it could be look like:

config led wan
option colorfunction 'dualbandwidth’
option interface 'eth1’
option limit_in 90000000
option limit_out 15000000
option Drange 5% white # 0-5%
option Drange 30% green # 5-45%
option Drange 60% yellow #45-90%
option Drange 100% red #90%-
option Urange 50% blue
option Urange 90% purple

if upload and download happen at the same time maybe they could be blinkings, showing rapidly the upload and download colors.

3 Likes

I was trying to configure each lanX port with different combinations, looking if i am stupid or just blind… nothing worked.

Thanks for hint.

And as i understand , those two entries for wan/lan0 with “bandwith”+ “direction in/out” is now replaced with one single “wan” entry with “dual-bandwith” option.

So if this is let’s say feature of it, we can exploit it. Using lan-0-1-2-3-4 as peakmeter so you can have “download_wan” indicated by lanX leds and “upload_wan” by wan-led itself.