OpenWrt Forum Archive

Topic: SamKnows package

The content of this topic has been archived between 20 Apr 2018 and 24 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

I installed Gargoyle to my SamKnows WhiteBox, but I'd like to install the Measurer package back. Does somebody know where I can download this package from? The source and the binaries are available here. Is the package included in the binaries?

When you agreed to play a role in this measurements, didn't you have to agree
a) to not tamper with the software, as long as the measurement is taking place? Ye know, to not fudge the data.
b) to do use the obtained software, ye know, to allow the people to make their measurements and to not just get hardware for free?

You see, if too many IDIOTS do not take this seriously, maybe in future people will avoid using unobfuscated FOSS software for such things.

It's not that hard to fuck up the bootloader in a way, that the user cannot reflash without JTAG.

Contrary to the firmware change, I'd like to do speed measurement (24 hours a day and 7 days a week for 2 years) that's why asked for the measurer package.

(Last edited by labu01wx on 5 Nov 2011, 16:03)

Hi labu01wx,

The software is not currently available as an OpenWrt package, but it is something we're looking at doing in the future.

Some of the main hurdles are:

1) We effectively take over the wireless interface for the purpose of passively scanning the strongest network for wireless traffic. This means the user cannot use the wireless network on the device itself. We could of course overcome this by running the device as a router and allowing users to configure it as they wish. This would suit more advanced users, but the vast majority of our users benefit from a simple installation process.
2) Having information on the user's ISP and product is critical to us when working on these regulator projects (how can you reasonably compare services if you don't have this?). Right now we can reasonably achieve this by checking details provided by users. But if we open up a package to everyone to install then we lose some certainty over the results we collect.
3) We make a few other system-wide changes (TCP stack, crontab, etc) that may cause some users issues.

We do ask users not to reflash these devices in the terms and conditions (as once they're reflashed, they won't be gathering statistics for us). I realise you'd like to get this going again on Gargoyle, but that's not something we can support right now.

Thanks,

Sam

Hi Sam,

[ I don’t really want to comment on the "project" of OP or its merits, other than: OP, check dscclient and the various startup scripts in the gpl sources. No idea if that is all that’s needed. Look in the /files directory at the top of the tarball, this appears to contain most of the customizations.]


you sent me a 2.4GHz router with 100MBit fast ethernet.

1st, my local net is Gigabit, and I’m quite fond of that. Now plugging the box in as it is recommended in the leaflet would mean I have a 100MBit bottleneck. I rsync my laptop backups across the LAN, so this is not optimal. If or when you make better boxes, please send me one, I’ll send the weak one back. A guy on #openwrt mentioned he has a TP-Link with GBps Ethernet.

2nd, all my wireless is 5GHz for good reason. The box can’t monitor my channels since it has a 2.4 radio. And anyhow, how do you suppose you can detect wireless traffic belonging to the local LAN you are on anyway? There’s nothing that tells you what is noise, what is inteference and what is the actual channel you need to listen on. Or do you somehow multicast stuff on the local LAN and correlate that with wireless traffic? Again, if you make a better box, please send it to me, I’ll send the crappy one back to England.

3rd, why don’t you just trap SNMP on the router to see if any other traffic is going on? That would be the cleanest solution without requiring the box to be patched in as a bridge.

(Last edited by towolf on 7 Nov 2011, 02:16)

Oh and 4th, the images contained in the GPL tarballs hosted your server (bin/ar71xx/*), are they what is flashed on the Whiteboxes or do you use different images? If I flash an image from the tarball (recompiled or as-is), would it work as a Whitebox?

towolf wrote:

1st, my local net is Gigabit, and I’m quite fond of that. Now plugging the box in how it’s recommended in the leaflet would mean I have a 100MBit bottleneck. I rsync my laptop backups across the LAN, so this is not optimal. If you make better boxes, please send me one, I’ll send the weak one back.

Drop us an email and we'll see what we can do for you. We are also using the TL-WR1043ND (gigabit) for this project, but typically only send these out when the user has a 100Mbps+ Internet connection.

towolf wrote:

2nd, all my wireless is 5GHz for good reason. The box can’t monitor my channels since it has a 2.4 radio. How do you suppose you can detect wireless traffic belonging to the local LAN you belong to anyway? There’s nothing that tells you what is noise, what is intereference and what is the actuall channel you need to listen on. Or do you somehow multicast stuff on the local LAN and correlate that with wireless traffic? Again, if you make a better box, please send it to me, I’ll send the crappy one back to England.

You're right, we cannot tell what's LAN and what's WAN traffic wirelessly. We take a conservative approach and avoid testing when there is any wireless activity above a low threshold. The current set of devices are 2.4GHz only.

towolf wrote:

3rd, why don’t you just trap SNMP on the router to see if any other traffic is going on? That would be the cleanest solution without requiring the box to be patched in as a bridge.

If I understand your suggestion correctly, this would rely upon the user's existing router supporting SNMP and it being enabled. Correct? For many consumer devices this is not the case.

Feel free to drop me a mail / IM directly - I'd be happy to discuss further. I don't wish to turn this into a support forum for us.

Thanks,

Sam

towolf wrote:

Oh and 4th, the images contained in the GPL tarballs hosted your server (bin/ar71xx/*), are they what is flashed on the Whiteboxes or do you use different images? If I flash an image from the tarball (recompiled or as-is), would it work as a Whitebox?

You can reflash the image from the tarball or rebuild, you should get to exactly the same result.

Thanks,

Sam

samcrawford wrote:
towolf wrote:

1st, my local net is Gigabit, and I’m quite fond of that. Now plugging the box in how it’s recommended in the leaflet would mean I have a 100MBit bottleneck. I rsync my laptop backups across the LAN, so this is not optimal. If you make better boxes, please send me one, I’ll send the weak one back.

Drop us an email and we'll see what we can do for you. We are also using the TL-WR1043ND (gigabit) for this project, but typically only send these out when the user has a 100Mbps+ Internet connection.

Ah, I see. That’s how you dimension it. Well, in the normal case that is a good heuristic I suppose.

samcrawford wrote:
towolf wrote:

2nd, all my wireless is 5GHz for good reason. The box can’t monitor my channels since it has a 2.4 radio. How do you suppose you can detect wireless traffic belonging to the local LAN you belong to anyway? There’s nothing that tells you what is noise, what is intereference and what is the actuall channel you need to listen on. Or do you somehow multicast stuff on the local LAN and correlate that with wireless traffic? Again, if you make a better box, please send it to me, I’ll send the crappy one back to England.

You're right, we cannot tell what's LAN and what's WAN traffic wirelessly. We take a conservative approach and avoid testing when there is any wireless activity above a low threshold. The current set of devices are 2.4GHz only.

The idea with the multicast to identify the right wireless network to monitor is not a bad one though. If you burst multicast at regular intervals and do a channel sweep in monitor mode, it might be possible to sort this out. After that you can just dwell on that channel. Or filter by the BSS that was source of the broadcast. I further assume that most home routers are bridged in a way that you can map from the DHCP gateway’s ARP to the wireless BSS, too.

samcrawford wrote:
towolf wrote:

3rd, why don’t you just trap SNMP on the router to see if any other traffic is going on? That would be the cleanest solution without requiring the box to be patched in as a bridge.

If I understand your suggestion correctly, this would rely upon the user's existing router supporting SNMP and it being enabled. Correct? For many consumer devices this is not the case.

True, of course barely any home router boxes do SNMP. It was just an idea how I would fix it for my own network, so I wouldn’t have that bottleneck.

samcrawford wrote:

Feel free to drop me a mail / IM directly - I'd be happy to discuss further. I don't wish to turn this into a support forum for us.

I think the technical aspects are interesting enough to discus them here and it is a good idea to discuss them publically to establish trust in your project.

So far any online discussion of Samknows EU monitoring were rife with tinfoil hattery. The combination of keywords just triggers intense paranoia.

By the way, why are the tests closed source? Is it that you regard this as intellectual property with the aim to protect your business?

samcrawford wrote:
towolf wrote:

Oh and 4th, the images contained in the GPL tarballs hosted your server (bin/ar71xx/*), are they what is flashed on the Whiteboxes or do you use different images? If I flash an image from the tarball (recompiled or as-is), would it work as a Whitebox?

You can reflash the image from the tarball or rebuild, you should get to exactly the same result.

So then I guess that any Samknows customizations are included in these files:

files/
files/usr/
files/usr/sbin/
files/usr/sbin/udhcpcrestart.sh
files/usr/sbin/wirelessconfig.sh
files/usr/sbin/dcsclient
files/etc/
files/etc/ca-bundle.crt
files/etc/passwd
files/etc/config/
files/etc/config/network
files/etc/config/dropbear
files/etc/init.d/
files/etc/init.d/wifi
files/etc/init.d/cron
files/etc/init.d/pm
files/etc/init.d/dropbear
files/etc/banner
files/etc/dropbear/
files/etc/dropbear/authorized_keys
files/etc/modules.d/
files/etc/modules.d/21-mac80211
files/etc/setup.sh

What this though?

config wifi-device  radio0
        option type     mac80211
        #option channel  11
  option channel  1-14
        option country  DE
        option macaddr  $MAC
        option hwmode   11ng
        option htmode   HT20
        list ht_capab   SHORT-GI-40
        list ht_capab   DSSS_CCK-40
        #option disabled 1

config wifi-iface
        option device   radio0
        option network  lan
        option mode     sta
        option ssid     WR741ND-OpenWrt
        option encryption none

Where do you set up monitor mode?

(Last edited by towolf on 7 Nov 2011, 03:01)

I really like the idea of multicasting (probably broadcasting, no?) recognisable bursts of packets on the LAN and then looking for correlation in the wireless traffic, it's a very practical solution. If we get time to try it out I'll be sure to let you know how we get on.

I wish all routers did support SNMP, or some other way of easily achieving the same goal. It would make everything much easier! We have no desire to run the Whitebox inline like we do - we'd love to remove this requirement (it'd also mean we could use much smaller single-port devices too).

Yes, at the moment we regard the tests as providing a competitive advantage to us. We are looking at fully open sourcing them (we already offer source access to universities we work with and we realise there are lots of benefits to making them totally open), but haven't reached a decision on that yet.

Yes, all our firmware modifications are included in the files/ overlay you noted. However, it's worth noting that the devices download an additional overlay at startup (and whenever there's a new version available) that includes the testing schedule, testing parameters, and tests themselves. We do this to allow for easy updates and also so that we can use the same firmware across many different deployments where there could be many different testing configurations. For example, in the US we test very specifically for services such as Powerboost on cable lines, but in the UK this is unnecessary (as we don't have Powerboost services).

The monitor mode / capture configuration (for determining traffic volumes) is a part of the pcap.c code, present in the gpl_tests.tar.gz file. You can find all of the Ethernet and wireless capture code in there (it's just a very simple libpcap-based program), and you can see what it outputs (a few files counting byte/packet counters).

I'm not always lurking on the OpenWrt forums (for example: I'm going to be away now for a few days in Belgium), but I will reply when I can.

Thanks,

Sam

I don't know if labu01wx continues needing the original firmware, but it can help, here are dd dumps of the original firmware of the Whitebox: http://cl.ly/18041g0V0m2x0d0Y1f31

Hi Sam,

so curiosity got the better of me and I got root on the box just to see what was going on.

These are my findings:

/tmp/wlan_pkt is always 0

When I look at what wlan0 is doing, it always dwells on channel 9. It doesn’t hop channels since then it would have changing numbers in the NL80211 SURVEY data

root@OpenWrt:/tmp# iw wlan0 survey dump | ~/iw-survey.awk
chan noise     active busy   rx   tx
2412   -95        190 0.24 0.09 0.01
2417   -95         58 0.12 0.09 0.02
2422   -95         58 0.02 0.00 0.00
2427   -95         58 0.00 0.00 0.00
2432   -92         58 0.00 0.00 0.00
2437   -92         58 0.05 0.03 0.00
2442   -91         58 0.31 0.05 0.02
2447   -90         58 0.07 0.05 0.02
2452   -92     331124 0.03 0.03 0.00
2457   -92         58 0.12 0.09 0.02
2462   -95         58 0.05 0.03 0.02
2467                    
2472                    
2484

Note, in spite of regdomain EU (iw reg get tells me DE) no channel 12-13. I used to use channel 13 a lot.

So luckily in gpl_linked_tests I find this one-line monstrosity:

sudo iwlist wlan0 scan | grep 'Address:\|Channel:\|Signal level=\|ESSID:' | sed -e 's/Cell .*Address: \(.*\)/\1/g' -e 's/Channel:\([0-9]*\)/\1/g' -e 's/Quality=.*Signal level=\([-0-9]*\) dBm/\1/g' -e 's/ESSID:"\(.*\)"/\1/g' | sed -e 's/://g'  | awk 'ORS=NR%4?" ":" \n"' | awk '{print $3 " " $2 " " $4 " " $1}' |  sort -n -r
-39 108 XxxxxxXxxxxxxxxxxx5X 000X423XX81X
-45 9 XxxxxxXxxxxxxxxxxx X43XX790X081
-47 52 XxxxxxXxxxxxxxxxxx5X X43XX790X083
-73 1 XxxxxxXxxxxxxxxxxx 0022151XX3XX
-78 1 XxxxXxxxXxxx XX0543XX458X
-82 11 XXXXXxxxXxx 001X4X97XX60
-84 1 XXXXX!Xxx 001X4XXX108X
-86 6 Xxxx-Xxxx X07X68859290
-86 1 XXXX-91X702 0012XX91X798
-89 6 Xxxxxxxxxxx 00X0X5X7XXX1
-89 2 XXXX-Xxxx.Xxxxxxx 0012XXX23XX4
-89 1 xxxx-xxxx 0227X73X2948
-90 6 XXXX-X5X836 002308X5X804
-90 6 XXXX-9XXX11 0023089XXX30
-90 6 XXXXXX 0015X90X5584
-91 6 XXXX-73XX68 0012XX73XX65
-91 6 Xxxxxxxxx 001X4XX16234
-91 1 xxxxxxxx_xxxxx 00264X1524X5
-91 13 XXXXX!Xxx 001X4X4XX2XX
-93 1 XxxxXxx-376024 7X4XX5376026

So you effectively just monitor the channel of the strongest network. This is quite a naive solution because there’s no guarantee at all that the strongest BSS is related to the network that the Whitebox is on. I assume the rationale was that since only a short Cat5 cable is included the Whitebox would be next to the belonging wireless AP and hence pick it up as the strongest BSS. But still.

In my place, I replaced a dumb switch on the far side of my apartment with the Whitebox, to at least give me some added value (and save some watts).

Right now 6 wireless stations are connected to my APs and still wlan0_pkt is always zero. When I arrange things to follow the assumptions of the Whitebox, it picks up packets, but not in my normal operation.

I further assume this command line means you don’t utilize any filtering in pcap

 959 root      3156 S    /tmp/ispmon/bin/pcap wlan0 /tmp/wlan0_pkt
fprintf(stdout,"pcap.c Version 1.10 Usage: %s dev outfile filter\n",argv[0]);

Your pcap sources include code for filtering, but is it used? Are you accounting for unrelated networks on the same channel?


What could you do?
[list]
•  Include crda and set proper regdom using CONFIG_ATH_USER_REGD=y
•  Make a mental note to get a device that understands both 2.4 and 5 GHz next time. I have a Mikrotik Atheros 92xx mini-PCI that can. So they exist. No need for two separate radios obviously. Just one dualband radio.
•   If you get DHCP, there’s strong indication that the ARP of the gateway in the DHCP lease will tell you what BSS you need to monitor, since it will probably be bridged accordingly. Determine the channel that this BSS is on and tell your pcap program to filter for traffic to and from this BSS. The downside of this approach is that you cannot be 100% certain that the lease gives you the BSS and in multi-AP situations you would be blind to any secondary devices.
•   Broadcast small packets on the LAN and try to deduce which BSSes and which channels these packets are transmitted on. This could work despite encryption based on packet size and timing. Then continue doing this to catch any channel switches and switch accordingly. You might need to hop on a subset of all channels, depending on how many BSSes are likewise indentified. My network has 4 (on 1, 9, 52, and 108).
•   Rework your code to base it on NL80211 for channel switching at runtime and similar stuff. No need to resort to iwconfig or iwlist scan.

I have a small C program that captures real survey data and hops over channels every 1 second like this:

static void switch_chan(struct unl *unl, int wdev, int freq)
{
  struct nl_msg *msg;
  int i = 0;
  unsigned int htval = NL80211_CHAN_NO_HT;

  msg = unl_genl_msg(unl, NL80211_CMD_SET_CHANNEL, false);
  NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, wdev);
  NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
  NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, htval);

  if ((i = unl_genl_request(unl, msg, NULL, NULL)) < 0) {
    fprintf(stderr, "Switching channels failed: %s\n", strerror(-i));
  }
  return;

•  Include an SNMP monitor just to see if there’s any SNMP installed on the router and trap it. If there’s one you choose simple codepaths that rely on SNMP. No pcap at all.

(Last edited by towolf on 13 Nov 2011, 01:43)

Hello,

I have the router at home, for me we can't call it router for me is a switch. I don't understand why they don't explain all better.

I'm thinking in to leave the project because when I read that they give me a router, I think into change my old router and use this new one. Now I have two routers at home using electricity.

Now I have the network more complex. The first day that my Internet operator fail this router will be the first that I will shut-down for ever.

@ luiso - you can turn it into a normal wireless openwrt router but it'll lose the measuring capabilities.
and is also against the rules you accepted to follow when you signed up for this project
if you agree all the above read here how to turn it: http://blog.nyr.be/hacking-the-whitebox/

Ty, but I'm interested into that my box send the data. I sign that.

maurer wrote:

@ luiso - you can turn it into a normal wireless openwrt router but it'll lose the measuring capabilities.
and is also against the rules you accepted to follow when you signed up for this project
if you agree all the above read here how to turn it: http://blog.nyr.be/hacking-the-whitebox/

then wait for a firmware update from SamKnows - maybe they'll let you use the router mode

Luiso wrote:

I have the router at home, for me we can't call it router for me is a switch. I don't understand why they don't explain all better.

it's neither, it's a Bridge

Did anybody accidentally noticed the hash of the root account ... and the fact it allows root access on port 2222 (dropbear) ... and the fact that the device is working like a dumb switch/ap extender (sort of).

The repercussions of all this are not really nice. At least only allow key auth (and yes you have it configured obviously for testing)

Hello, I have flashed my WR1043nd WhiteBox with OpenWrt, just to compare it's performance against my actual MR3420... It is possible to restore original firmware from here SamKnows? https://files.samknows.com/~gpl/

(Last edited by jorgemiguel4 on 17 Jan 2012, 15:46)

Yes, in the tarballs in the /bin subdirectory you find the images that were used by Samknows to flash them.

The setup of the metering is done behind the scenes after first boot. If you want to access the box afterwards you can put your SSH key in authorized_keys or set a root password.

Ok, it's working fine now. And reporting too...



--------------------------------------------------------------------------
Using username "root".
Authenticating with public key "dsa-key-20120117"

BusyBox v1.18.4 (2011-05-10 12:44:10 BST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

                     _
___  __ _ _ __ ___ | | ___ __   _____      _____
/ __|/ _` | '_ ` _ \| |/ / '_ \ / _ \ \ /\ / / __|
\__ \ (_| | | | | | |   <| | | | (_) \ V  V /\__ \
|___/\__,_|_| |_| |_|_|\_\_| |_|\___/ \_/\_/ |___/
       P E R F O R M A N C E   M O N I T O R I N G

OS: OpenWRT Bleeding edge, r26878
SW: WR1043ND Build
-------------------------------------------------
root@OpenWrt:~#
----------------------------------------------------------------------

Thank's for the SSH tip.

(Last edited by jorgemiguel4 on 17 Jan 2012, 23:23)

Hello again, I'm currently in Samknows project with a WR1043ND whitebox. My current router is a TP-Link MR3420 loaded with OpenWRT. Since flash memory and wireless capabilities are better in WR1043ND, I was wondering if is possible flash Samknows firmware in my MR3420 and turn the whitebox into a router.

I have already tried WR841n 's firmware on my MR3420 and find out that it works fine.

So I think that is possible to do what I want without any damage to SamKnows, since they only need to change whitebox's MAC Address and everything should run smooth.


What do you think?


Just to make it clear, I want to stay in SamKnows project!

I created a package for the SamKnows stuff. The GPL source is really well done, thanks SamKnows! It was too easy to extract the missing files and build a package out of it
I changed the following:
- don't mess with wireless or network config, let the user decide
- correct led path as trunk changed their names
- remove changed init.d scripts, the changes are not important
- one patch for libpcap is integrated upstream, so not needed anymore(I only found this one patch)
- I haven't figured out the dependencies yet, I just started with the config from the GPL-source.
So far everything works fine and I can use the device in my VLAN network (without VLAN it was useless)

I don't think I'm allowed to repackage the needed things, so I can only publish a way to build the package:
download GPL source for your device from https://files.samknows.com/~gpl/ and extract:

.config
files/etc/init.d/pm
files/etc/ca-bundle.crt
files/etc/setup.sh
files/usr/sbin/dcsclient
files/usr/sbin/udhcpcrestart.sh

and put them into to your openwrt trunk:

.config
feeds/packages/net/samknows/files/etc/init.d/pm
feeds/packages/net/samknows/files/etc/ca-bundle.crt
feeds/packages/net/samknows/files/etc/setup.sh
feeds/packages/net/samknows/files/usr/sbin/dcsclient
feeds/packages/net/samknows/files/usr/sbin/udhcpcrestart.sh

Patch for setup.sh to correct led path (tl-wr1043):

--- old/feeds/packages/net/samknows/files/etc/setup.sh    2011-11-03 13:45:08.000000000 +0100
+++ new/feeds/packages/net/samknows/files/etc/setup.sh    2012-02-16 21:41:59.226876071 +0100
@@ -1,24 +1,24 @@
 #!/bin/ash
 
 skledoff() {
-    echo none > /sys/class/leds/tl-wr1043nd:green:qss/trigger
-    echo 0 > /sys/class/leds/tl-wr1043nd:green:qss/brightness
+    echo none > /sys/class/leds/tp-link:green:qss/trigger
+    echo 0 > /sys/class/leds/tp-link:green:qss/brightness
 }
                 
 skledon() {
-    echo 255 > /sys/class/leds/tl-wr1043nd:green:qss/brightness
+    echo 255 > /sys/class/leds/tp-link:green:qss/brightness
 }
                         
 skledactivity() {
-    echo timer > /sys/class/leds/tl-wr1043nd:green:qss/trigger
-    echo 100 > /sys/class/leds/tl-wr1043nd:green:qss/delay_off
-    echo 100 > /sys/class/leds/tl-wr1043nd:green:qss/delay_on
+    echo timer > /sys/class/leds/tp-link:green:qss/trigger
+    echo 100 > /sys/class/leds/tp-link:green:qss/delay_off
+    echo 100 > /sys/class/leds/tp-link:green:qss/delay_on
 }
                                                 
 skleddelay() {
-    echo timer > /sys/class/leds/tl-wr1043nd:green:qss/trigger
-    echo 250 > /sys/class/leds/tl-wr1043nd:green:qss/delay_off
-    echo 250 > /sys/class/leds/tl-wr1043nd:green:qss/delay_on
+    echo timer > /sys/class/leds/tp-link:green:qss/trigger
+    echo 250 > /sys/class/leds/tp-link:green:qss/delay_off
+    echo 250 > /sys/class/leds/tp-link:green:qss/delay_on
 }
 
 # Set QSS LED flashing
@@ -49,7 +49,7 @@
     # Run the DCS client
     /usr/sbin/dcsclient https://"$DCSSERVER" -a
     RET=$?
-    echo none > /sys/class/leds/tl-wr1043nd:green:qss/trigger
+    echo none > /sys/class/leds/tp-link:green:qss/trigger
     if [ $RET -eq 0 ]; then
         logger -s -p 6 -t 'pm' "setup.sh (Info) Unit Activation Successfull with DCS ${DCSSERVER}"
         skledon
@@ -60,7 +60,7 @@
         exit 0
 else
     logger -s -p 6 -t 'pm' "setup.sh (Info) Unit doesn't know the DCSSERVER to activate with"
-    echo none > /sys/class/leds/tl-wr1043nd:green:qss/trigger
+    echo none > /sys/class/leds/tp-link:green:qss/trigger
     skleddelay
         exit 2
 fi

or patch for tl-wr741nd

--- old/feeds/packages/net/samknows/files/etc/setup.sh    2011-11-03 13:55:45.000000000 +0100
+++ new/feeds/packages/net/samknows/files/etc/setup.sh    2012-02-16 21:41:59.226876071 +0100
@@ -1,24 +1,24 @@
 #!/bin/ash
 
 skledoff() {
-    echo none > /sys/class/leds/tl-wr741nd:green:qss/trigger
-    echo 0 > /sys/class/leds/tl-wr741nd:green:qss/brightness
+    echo none > /sys/class/leds/tp-link:green:qss/trigger
+    echo 0 > /sys/class/leds/tp-link:green:qss/brightness
 }
                 
 skledon() {
-    echo 255 > /sys/class/leds/tl-wr741nd:green:qss/brightness
+    echo 255 > /sys/class/leds/tp-link:green:qss/brightness
 }
                         
 skledactivity() {
-    echo timer > /sys/class/leds/tl-wr741nd:green:qss/trigger
-    echo 100 > /sys/class/leds/tl-wr741nd:green:qss/delay_off
-    echo 100 > /sys/class/leds/tl-wr741nd:green:qss/delay_on
+    echo timer > /sys/class/leds/tp-link:green:qss/trigger
+    echo 100 > /sys/class/leds/tp-link:green:qss/delay_off
+    echo 100 > /sys/class/leds/tp-link:green:qss/delay_on
 }
                                                 
 skleddelay() {
-    echo timer > /sys/class/leds/tl-wr741nd:green:qss/trigger
-    echo 250 > /sys/class/leds/tl-wr741nd:green:qss/delay_off
-    echo 250 > /sys/class/leds/tl-wr741nd:green:qss/delay_on
+    echo timer > /sys/class/leds/tp-link:green:qss/trigger
+    echo 250 > /sys/class/leds/tp-link:green:qss/delay_off
+    echo 250 > /sys/class/leds/tp-link:green:qss/delay_on
 }
 
 # Set QSS LED flashing
@@ -49,7 +49,7 @@
     # Run the DCS client
     /usr/sbin/dcsclient https://"$DCSSERVER" -a
     RET=$?
-    echo none > /sys/class/leds/tl-wr741nd:green:qss/trigger
+    echo none > /sys/class/leds/tp-link:green:qss/trigger
     if [ $RET -eq 0 ]; then
         logger -s -p 6 -t 'pm' "setup.sh (Info) Unit Activation Successfull with DCS ${DCSSERVER}"
         skledon
@@ -60,7 +60,7 @@
         exit 0
 else
     logger -s -p 6 -t 'pm' "setup.sh (Info) Unit doesn't know the DCSSERVER to activate with"
-    echo none > /sys/class/leds/tl-wr741nd:green:qss/trigger
+    echo none > /sys/class/leds/tp-link:green:qss/trigger
     skleddelay
         exit 2
 fi

then create the package Makefile: feeds/packages/net/samknows/Makefile

#
# Copyright (C) 2011-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=samknows
PKG_VERSION:=0.0.1
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define Package/samknows
  SECTION:=net
  CATEGORY:=Network
  DEPENDS:=@TARGET_ar71xx +libc +libgcc +libpthread +librt +zlib +libcurl +libopenssl +curl
  TITLE:=SamKnows Broadband Measurement tools
  URL:=http://www.samknows.com
  MAINTAINER:=Stefan Hellermann <stefan@the2masters.de>
endef

define Package/samknows/config
  select BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
endef

define Package/samknows/description
This package contains a subset of the Broadband Measurement tools from
SamKnows, extracted from the GPL-sources (http://samknows.com/~gpl/).
This tools are only usable on a supplied router by SamKnows, because the
MAC-address is checked agains a SamKnows database. It's provided for people
who want to replace the SamKnows firmware on their measurement devices.
Beware: By flashing your own software on the measurement device you violate
the terms and conditions of SamKnows.
endef

define Build/Compile
endef

define Package/samknows/install
    $(CP) ./files/* $(1)
endef

$(eval $(call BuildPackage,samknows))

so now you should have created the following files:

.config
feeds/packages/net/samknows/Makefile
feeds/packages/net/samknows/files/etc/init.d/pm
feeds/packages/net/samknows/files/etc/ca-bundle.crt
feeds/packages/net/samknows/files/etc/setup.sh
feeds/packages/net/samknows/files/usr/sbin/dcsclient
feeds/packages/net/samknows/files/usr/sbin/udhcpcrestart.sh

then tell openwrt about the new package and configure it

scripts/feeds install -a
make oldconfig
make menuconfig

and it's done.

(Last edited by the2masters on 31 Mar 2012, 19:17)

Good idea. Is it still putting the wireless device into monitor mode? I forgot if that is done by the downloaded overlay or by the local scripts.

(Last edited by towolf on 16 Feb 2012, 23:23)

Sorry, posts 26 to 25 are missing from our archive.