<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>asuswrt on irq5 test</title><link>https://irq5-7854a1fdb9f4.pages.dev/tag/asuswrt/</link><description>Recent content in asuswrt on irq5 test</description><language>en-us</language><lastBuildDate>Thu, 01 Aug 2019 11:59:00 +0000</lastBuildDate><atom:link href="https://irq5-7854a1fdb9f4.pages.dev/tag/asuswrt/feed/" rel="self" type="application/rss+xml"/><item><title>Detailed Wireless Client Stats with collectd</title><link>https://irq5-7854a1fdb9f4.pages.dev/2019/08/detailed-wireless-client-stats-with-collectd/</link><pubDate>Thu, 01 Aug 2019 11:59:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2019/08/detailed-wireless-client-stats-with-collectd/</guid><description>&lt;p>collectd has always been able to grab interface traffic statistics from Linux.
But what if we want to collect data about individual WiFi clients that connect to it?
How much bandwidth is each of the clients using?&lt;/p>&lt;p>That information is already being recorded by the wireless driver; all we need to do is to query it.
Turns out you can do that with the &lt;code>wl&lt;/code> utility.
This is Broadcom&amp;rsquo;s proprietary tool to control and query the wireless interfaces.&lt;/p>&lt;p>To do this, first use &lt;code>wl&lt;/code> to get associated stations:&lt;/p>&lt;pre>&lt;code>wl -i eth2 assoclist
&lt;/code>&lt;/pre>&lt;p>Given a particular MAC address that is associated to the AP, query its info using &lt;code>sta_info&lt;/code>:&lt;/p>&lt;div class=highlight role=region aria-label="code block" translate=no>&lt;pre tabindex=0 class=chroma>&lt;code class=language-fallback data-lang=fallback>&lt;span class=line>&lt;span class=cl># wl -i eth2 sta_info d4:a3:00:aa:bb:cc
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>STA d4:a3:00:aa:bb:cc:
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> aid:2
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rateset [ 6 9 12 18 24 36 48 54 ]
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> idle 0 seconds
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> in network 16 seconds
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> state: AUTHENTICATED ASSOCIATED AUTHORIZED
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> flags 0x11e03b: BRCM WME N_CAP VHT_CAP AMPDU AMSDU
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> HT caps 0x6f: LDPC 40MHz SGI20 SGI40
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> VHT caps 0x43: LDPC SGI80 SU-BFE
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx data pkts: 663916
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx data bytes: 68730715
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx ucast pkts: 155
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx ucast bytes: 42699
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx mcast/bcast pkts: 663761
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx mcast/bcast bytes: 68688016
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx failures: 0
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx data pkts: 234
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx data bytes: 73557
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx ucast pkts: 192
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx ucast bytes: 62971
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx mcast/bcast pkts: 42
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx mcast/bcast bytes: 10586
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rate of last tx pkt: 866667 kbps
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rate of last rx pkt: 780000 kbps
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx decrypt succeeds: 195
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> rx decrypt failures: 1
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx data pkts retried: 19
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> tx data pkts retry exhausted: 0
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> per antenna rssi of last rx data frame: -61 -56 -59 0
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> per antenna average rssi of rx data frames: -61 -56 -57 0
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> per antenna noise floor: -104 -98 -98 0&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &amp;ldquo;easy way&amp;rdquo; is probably to write a shell script, invoked via the &lt;a href=https://collectd.org/wiki/index.php/Plugin:Exec rel=noopener target=_blank class=external>Exec plugin&lt;/a> that calls &lt;code>wl&lt;/code> multiple times (once per interface, and once for each WiFi client) and uses &lt;code>grep&lt;/code> or &lt;code>awk&lt;/code> to get the information we need.
This won&amp;rsquo;t be performant, of course.&lt;/p>&lt;p>&lt;code>wl&lt;/code> itself does have quite a fair bit of overhead. It does some verification of the provided interface name.
It checks for the Broadcom driver magic to ensure that the interface is a Broadcom device.
It then needs to convert the MAC address from the argument string to binary, and vice-versa.
Sure, that&amp;rsquo;s not really much &amp;ldquo;these days&amp;rdquo;, but we can definitely do better.&lt;/p>&lt;p>Instead, let&amp;rsquo;s short-circuit the process and write a plugin that directly collects the data,
without going through &lt;code>wl&lt;/code>.
This way, we avoid creating several new processes for every query.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2019/08/detailed-wireless-client-stats-with-collectd/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Extending ASUSWRT Functionality, Part 2</title><link>https://irq5-7854a1fdb9f4.pages.dev/2018/12/extending-asuswrt-functionality-part-2/</link><pubDate>Fri, 28 Dec 2018 00:11:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2018/12/extending-asuswrt-functionality-part-2/</guid><description>&lt;p>Following up from &lt;a href=https://irq5-7854a1fdb9f4.pages.dev/2012/12/hacking-functionality-into-asuswrt-routers/ rel=noopener>my earlier post&lt;/a>, Asus has released faster and beefier routers.
But perhaps the more important change here is that they have moved from MIPS in the RT-N56U to ARM in newer routers.
I have also upgraded to the &lt;strong>RT-AC68U&lt;/strong> for better reception and hopefully to fix the poor battery life experienced by my Android tablet.&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2018/img/asus-routers.jpg.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2018/img/asus-routers.jpg alt="the Asus N56U and AC68U routers, side by side" width=1023 height=682>&lt;/picture>&lt;/p>&lt;p>After upgrading, I noticed that the method I described back then no longer works.
Someone also noticed this, as they
&lt;a href=http://koolshare.cn/thread-105955-1-1.html rel=noopener target=_blank class=external>translated key portions of my post&lt;/a> into Chinese,
while pointing out some of the steps that didn’t work.&lt;/p>&lt;p>In this post, I&amp;rsquo;ll summarize the key changes required to get it working again.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2018/12/extending-asuswrt-functionality-part-2/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Hacking Functionality into ASUSWRT Routers</title><link>https://irq5-7854a1fdb9f4.pages.dev/2012/12/hacking-functionality-into-asuswrt-routers/</link><pubDate>Mon, 10 Dec 2012 00:10:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2012/12/hacking-functionality-into-asuswrt-routers/</guid><description>&lt;p>This weekend, I spent some time to replace my aged Linksys WRT54G wireless router, which is running DD-WRT. The WRT54G is slow by today&amp;rsquo;s wireless standards and since I sync my iOS devices wirelessly, the speed was getting quite unbearable. When I bought my Macbook Pro in 2007, it already has draft 802.11n support and fast-forward to 2012, my iPad (1st generation) and iPhone 5 both support the 5GHz band.&lt;/p>&lt;p>The &lt;strong>ASUS RT-N56U&lt;/strong> wireless router ranks up there on wireless performance, and the &amp;ldquo;feature&amp;rdquo; I was really after was a router that can run an alternative firmware such as Tomato or DD-WRT. The really good news is, I figured out how to get the functionality I wanted while still using the official ASUS firmware.&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2012/img/asus-top.jpg.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2012/img/asus-top.jpg alt="ASUS router photo" width=1024 height=683>&lt;/picture>&lt;/p>&lt;p>For proper reviews and better photos, you might want to check out these other reviews:&lt;/p>&lt;ul>&lt;li>SmallNetBuilder: &lt;a href=http://www.smallnetbuilder.com/wireless/wireless-reviews/31436-asus-rt-n56u-black-diamond-dual-band-gigabit-wireless-n-router-reviewed rel=noopener target=_blank class=external>ASUS RT-N56U Black Diamond Dual-Band Gigabit Wireless-N Router Reviewed&lt;/a>&lt;/li>&lt;li>FoxNetwork: &lt;a href=http://www.foxnetwork.ru/index.php/en/component/content/article/82-asus-rt-n56u.html rel=noopener target=_blank class=external>ASUS RT-N56U or hardware NAT acceleration&lt;/a>&lt;br>(I quite like their professionally taken product photos and their reverse-engineering work)&lt;/li>&lt;/ul>&lt;p>Read on to find my short review, as well as how you can run your own programs on the router without using a third-party firmware.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2012/12/hacking-functionality-into-asuswrt-routers/#more">Continue reading…&lt;/a>&lt;/p></description></item></channel></rss>