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.

The Whitebox needs data to determine when it is "clear to send".

If the Whitebox measures while there is other internet traffic at the same time this produces flawed measurements.

So the two data sources it considers are 1. routed packets that flow through its own ports and 2. packet count of the strongest 2.4GHz wireless network in the vicinity. If either of the two rises above a hardcoded threshold the Whitebox suspends measurements until 5 minutes later. Now if these data are not valid, as in my case due to my network setup, or because you wipe them out, then you are submitting wrong measurements that indicate ISP problems where there might be none. This introduces noise in the aggregate data and is not fair play.

Anyhow, can you install an SNMP daemon on your internet router?

Hm, the OIDs might differ slightly, but those could be changed in the SNMP traffic detection script.

Ok, I guess I would compile a clean image for you with the Samknows ispmon package, but there's a copyright issue here because this stuff is not redistributable. If I can get green light from samcrawford above or anyone I'd do it.

Do you have the 1043nd or the 741nd?

741, I wish I would have 1043. I tried to get one, but only got a promise from SamKnows.

Ok. I wrote to a person I was in contact with at SamKnows. Let's see.

So, SamKnows have no objections to redistributing anything found in the GPL tarballs and they are actually working on opening the sources by the end of the year.

lepa, what do you need? A vanilla firmware for 741nd with the Samknows ispmon package compiled in and my SNMP script to free up the wireless device for other purposes?

(Last edited by towolf on 12 Aug 2012, 15:19)

Yes, and yes. I primarily want to use it as wireless bridge to my DLink 615E3.

Ok then. Here’s a vanilla trunk firmware for 741NDv1 with the Samknows ispmon package discussed above compiled in: openwrt-ar71xx-generic-tl-wr741nd-v1-squashfs-sysupgrade.bin.

If you want to use the radio for something else and still report traffic, you have to run an SNMP server on your internet router. Edit the variables at the top of the /usr/bin/snmpcap.sh script to point to your router and enter the proper OID variables. I couldn’t include the MIB files because there’s only 4M of space on the box. It’s just a simple script that snmpget’s the up- and downstream traffic and determines if the threshold for measurements is exceeded.

Now that I think about it you could have installed trunk on your own and added the samknows package later.

Be aware that the uboot on this box has no reachable tftp failsafe, so if the flash goes wrong you have to break out the soldering iron.

No Warranty implied. I hope you can work it out.

(Last edited by towolf on 15 Aug 2012, 00:57)

Greetings.

I have a samknows wr741nd and went ahead to flash openwrt, hoping to get the samknows package working. Had no problem compiling it or installing it, but the package doesn't seem to be working at all, although the wr741nd is working perfectly.

Firstly

/etc/init.d/pm start

was complaining about :

root@OpenWrt:~# /etc/init.d/pm start
root@OpenWrt:~# /etc/setup.sh: line 28: arithmetic syntax error

So I commented that line out

"sleep $(($RANDOM % 60))"

and then it exits with :

root@OpenWrt:~# /etc/init.d/pm start
root@OpenWrt:~# Mon Aug 27 12:13:17 UTC 2012
pm: setup.sh (Info) Time synced successfully, time is now Mon Aug 27 12:13:17 UTC 2012
pm: setup.sh (Info) Unit Activation Fail with DCS dcs.samknows.com

Can't figure out why it fails the activation.
My modem is connected to the WAN port of the wr741nd and has dhcp server on a different subnet. So it's 10.0.0.X on the router side and 192.168.1.X on the wr741nd.

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:43
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19833 errors:0 dropped:256 overruns:0 frame:0
          TX packets:16942 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1820735 (1.7 MiB)  TX bytes:17078072 (16.2 MiB)

eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:43
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19917 errors:0 dropped:6 overruns:0 frame:0
          TX packets:16947 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2105209 (2.0 MiB)  TX bytes:17078302 (16.2 MiB)
          Interrupt:5

eth1      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:45
          inet addr:10.0.0.201  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17592 errors:0 dropped:155 overruns:0 frame:0
          TX packets:17694 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:18434605 (17.5 MiB)  TX bytes:1794606 (1.7 MiB)
          Interrupt:4

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:126 errors:0 dropped:0 overruns:0 frame:0
          TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10400 (10.1 KiB)  TX bytes:10400 (10.1 KiB)

WR741nd can connect to the internet and also pushes out correct dhcp leases on the 192.168.1.X subnet.
The pc connected to one of the lan ports of wr741nd connects to the internet as well. So the bridge seems to be working.

root@OpenWrt:~# ping www.google.com
PING www.google.com (173.194.78.106): 56 data bytes
64 bytes from 173.194.78.106: seq=0 ttl=46 time=72.676 ms
root@OpenWrt:~# cat /tmp/dhcp.leases
1346111943 XX:XX:XX:XX:XX:XX 192.168.1.208 mypc  XX:XX:XX:XX:XX:XX

At first I thought I had problems because maybe I had borked the configuration, but flashed again, did not change any settings and I still have the same problem.

The image I flashed was the "openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-sysupgrade.bin" . Was this the correct image or do I need to flash a v1 instead (since the samknows wr741nd is a v2.4) ?
Used a -sysupgrade.bin, since I already had a gargoyle build installed before and all the wikis urged for a -sysupgrade.bin instead of the -factory.bin for the upgrade.

Any clues ?
Thanks in advance.

Edit: One other thing. In reporting.samknows.com website it shows that my hwaddr is XX:XX:XX:XX:XX:44 while the script gets the mac address of the br-lan interface which is  XX:XX:XX:XX:XX:45.
The XX:44 mac address is the wlan0, which I have currently off.
Changed the script, and put manually that mac addr in but still it fails to activate.
I also turned on the wifi, changed setup.sh instead of br-lan put in wlan0, it probes the "correct" mac address but still fails to activate.

Going to try to flash the original samknows firmware, and install openwrt fresh again and report back.

(Last edited by lazarost on 27 Aug 2012, 14:15)

I had the Activation Fail problem one time and it turned out that I had copied the wrong binary dcsclient program to my 741nd.

If you use the 1043nd dcsclient it will fail on 741nd. Can you rule that out?

As for the MAC address, you can force the correct MAC to be used by addind one line in /etc/config network.

Here’s mine

  8 config interface 'lan'                                                                                                                  
  9   option ifname 'eth0'                                                                                                                  
 10   option type 'bridge'                                                                                                                  
 11   option proto 'static'                                                                                                                 
 12   option netmask '255.255.255.0'                                                                                                        
 13   option ipaddr '10.0.0.4'                                                                                                              
 14   option gateway '10.0.0.1'                                                                                                             
 15   option dns '10.0.0.1'                                                                                                                 
 16   option macaddr 'F4:xx:xx:xx:xx:80'

Also, you have to build with BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT on. I added this in my slightly updated package build script. If you want to compare:

#
# 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:=ispmon
PKG_VERSION:=0.2
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define Package/ispmon
  SECTION:=base
  CATEGORY:=Base system
  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/ispmon/description
  This package bootstraps the Broadband Measurement tools from
  SamKnows. The binaries and scripts contained were extracted from the
  SamKnows-supplied GPL-sources (http://samknows.com/~gpl/).
endef

define Package/ispmon/config
  select BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
endef

define Build/Compile
endef

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

$(eval $(call BuildPackage,ispmon))

(Last edited by towolf on 27 Aug 2012, 15:10)

Thanks towolf for your input.

I didn't clarify that I compiled and was using the script that the2masters had given on the first page. My modem is an old thomson st536v6 for dsl over isdn, and its snmp support is really really lame.

So I went ahead and used the2masters' script. But will rebuild busybox either way.

As for dscclient, it may well be the case. Will try to copy the binary again later today. If not, the mac address is next.
I now have flashed it on the original samknows firmware, the lock icon is solid green now, so I guess it authenticated correctly and I'm waiting for a couple of hours for the results to appear on the dashboard.

I'm still unclear if I should try to flash a v1 openwrt image (and gamble with the router bricking), since my unit says v2.4. Any insights ?

(Last edited by lazarost on 27 Aug 2012, 15:52)

I flashed openwrt-ar71xx-generic-tl-wr741nd-v1-squashfs-sysupgrade.bin and it works.

Ok, I think it's solved now, since the key lock icon is locked. Flashed latest r33276 v1, no problems whatsovever. Now I'm wondering the differences between v1 & v2 (and if there are any).

The mac address option on "/etc/config/network" was the thing that made it happen. Still pretty strange that manually entering it, wouldn't let it activate.

I also had to do a

/etc/init.d/enable pm

so the script can start upon reboot.

Thanks again for the help towolf, much appreciated.

Hey guys,

I think I have just bricked my whitebox, I am quite interested in doing the SNMP mod to the whitebox so it can pull the current usage from my ASA.

I looked and couldn't find an SNMP package that you didn't have to compile manually so the snmpget command was avalable. So decided to download the fimware that tomwolf kindly uploaded here ftp://ftp.tuebingen.mpg.de/pub/kyb/towo … pgrade.bin
I then flashed my whitebox 741nd with it and now it doesn't seem to boot all of the lights flash on and off excluding the power light. have I bricked it and if so is it recoverable.

Its a version 4.x if that is any help.

thanks

Anyone?

Does anybody still have the image by towolf as it's got deleted from the link?

I deleted it after someone said he git himself into a bricked state. Since the low power boxes don’t have a serial header or a functional failsafe reviving a bricked whitebox is not trivial.

I want to know what the password for the samknows svn server is. They provide a build root tarball for the newer box but their new samknows feed links to an HTTPS svn with authentication.

I cannot build their image like that.

towolf wrote:

I deleted it after someone said he git himself into a bricked state. Since the low power boxes don’t have a serial header or a functional failsafe reviving a bricked whitebox is not trivial.

I want to know what the password for the samknows svn server is. They provide a build root tarball for the newer box but their new samknows feed links to an HTTPS svn with authentication.

I cannot build their image like that.

Sent them a mail community@samknows.com

(Last edited by gamer8martie on 26 Oct 2013, 14:32)

Hi, can someone make this package installable?! I dont want to make my own trunk.. Ty..

Hi,

Is it possible to install OpenWrt on SamKnows WDR3600 box and make a SamKnows monitoring package for it?
I can't find files mentioned in the2masters tutorial in https://files.samknows.com/~gpl/ archive for wdr3600.

So? Can someone please compile us this package as installable package?

Ty. smile.

Hello guys!
I've managed to build Barrier Breaker for the WDR3600 with SamKnows in it. Now I'd need some help for the SNMP part... that script doesn't seem to be enough. Can someone help me? I'll explain more later.

(Last edited by livingsilver94 on 4 Mar 2015, 22:41)

Hi,

I want to restore the samknows firmware. I have a Dump of the Original FW in mi PC (the router is WDR3600 with Blue Leds)

cd /tmp
dd if=/dev/mtd0 of=/tmp/u-boot.backup
dd if=/dev/mtd1 of=/tmp/kernel.backup
dd if=/dev/mtd2 of=/tmp/rootfs.backup
dd if=/dev/mtd3 of=/tmp/rootfs_data.backup
dd if=/dev/mtd4 of=/tmp/art.backup
dd if=/dev/mtd5 of=/tmp/firmware.backup

How to restore the firmware? Now its running OpenWrt Luci
i try this,

root@(none):/tmp# dd if=/tmp/u-boot.backup of=/dev/mtd0
dd: can’t open ‘/dev/mtd0′: Permission denied

But dont works.

Any idea?


Thanks!

(Last edited by Arbe on 25 Jun 2015, 05:10)

Arbe wrote:

Hi,

I want to restore the samknows firmware. I have a Dump of the Original FW in mi PC (the router is WDR3600 with Blue Leds)

cd /tmp
dd if=/dev/mtd0 of=/tmp/u-boot.backup
dd if=/dev/mtd1 of=/tmp/kernel.backup
dd if=/dev/mtd2 of=/tmp/rootfs.backup
dd if=/dev/mtd3 of=/tmp/rootfs_data.backup
dd if=/dev/mtd4 of=/tmp/art.backup
dd if=/dev/mtd5 of=/tmp/firmware.backup

How to restore the firmware? Now its running OpenWrt Luci
i try this,

root@(none):/tmp# dd if=/tmp/u-boot.backup of=/dev/mtd0
dd: can’t open ‘/dev/mtd0′: Permission denied

But dont works.

Any idea?


Thanks!

Solved mtd -r write /tmp/sysbackup.bin firmware

http://www.cuonic.com/posts/flashing-th … s-whitebox

The discussion might have continued from here.