OpenWrt Forum Archive

Topic: Bandwidthd and Chaos Calmer: not there!

The content of this topic has been archived on 6 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

In the previous version of openWRT (Barrier Breaker) the package Bandwidthd was available.  I know that Bandwidthd can take a lot of resources on a router and maybe not ideal if the CPU is not fast enough and the memory is limited.

I acquired a WRT1900AC, to eventually replace some hardware that I have, and one thing that I wanted to use was to put Bandwidthd on it to replace a managed switch and a laptop that is currently monitoring my network with Bandwidthd.  Currently that does not seem to be an option with Chaos Calmer as the package is not present anymore!

Can somebody tell me if there is a reason the package is not built anymore in Chaos Calmer (technical reason, incompatibility, people are not using it, etc.).

I do not mind looking around to built it myself if I have too (although I would have a little learning curve to install all I need to do that), but first I would like to know if it would be worth the time: if Bandwidthd cannot be built for Chaos Calmer, then I will not invest the time to do it!

To solve the problem of using too much resource on the openWRT router, Bandwidthd on a Linux system can use a postgresql database to store the data and a web server with PHP can actually use the data in the database and built the graphs that can be accessed with a web browser: the openWRT router just has to collect the data and save it to the server and does not need to analyze the data.  I wonder it this was possible with the package on Barrier Breaker.  The rouiter probably needs to have a postgresql client package, which seems to exists on Chaos Calmer, unless I am wrong.

If somebody has some knowledge about this, I would appreciate the input.

Hello jmlacroix,

have a look at this.
Bandwidth is in the oldpackage feed, since it is not maintained any further.
The oldpackage feed isn't build for CC so you have to build your own one for CC, or stay on BB (and enable the oldpackage in opkg.conf, can't remember if it is).

Napsi-GER-

Napsi-GER- wrote:

Hello jmlacroix,

have a look at this.
Bandwidth is in the oldpackage feed, since it is not maintained any further.
The oldpackage feed isn't build for CC so you have to build your own one for CC, or stay on BB (and enable the oldpackage in opkg.conf, can't remember if it is).

Napsi-GER-

Thank you very much for the information: I will look at this carefully and see what I can do!  The info in the link is very usefull, and I will learn a lot!

Thanks again!

Hello again jmlacroix,

as i didn't state any alternatives for bandwidth in my previous post, i will do now:
An alternative for bandwidth can be either "vnstat" (small), or "collectd" with the appropriate sub-modules as "collectd-mod-interface" and "collectd-mod-iwinfo" (depending on installed sub-modules, a lot bigger).
I use both on an TL-WR1043ND and Archer C7 and am happy with them, especially that they are supported by LuCI.
But i would prefer collectd, since it is more powerful and can be extended by installing said sub-modules.

Napsi-GER-

Napsi-GER- wrote:

Hello again jmlacroix,

as i didn't state any alternatives for bandwidth in my previous post, i will do now:
An alternative for bandwidth can be either "vnstat" (small), or "collectd" with the appropriate sub-modules as "collectd-mod-interface" and "collectd-mod-iwinfo" (depending on installed sub-modules, a lot bigger).
I use both on an TL-WR1043ND and Archer C7 and am happy with them, especially that they are supported by LuCI.
But i would prefer collectd, since it is more powerful and can be extended by installing said sub-modules.

Napsi-GER-

Yes: I will look at these alternative before going to get Bandwidthd on my router with CC, as this is not a minor task!

I like Bandwidthd in my current settup on my network,as it does the job that I asking for, but there is nothing that says that something else would not work as well, if not better.

OK: I was able to compile and install the Bandwidthd package for Chaos Calmer on a TL-WDR3600 (ar71xx).  I took the Bandwidthd package in the oldpackages, setup a proper environment on a CentOS 6.4 system, set it up according to the various wiki available, compiled Bandwidthd with the proper dependency, installed it on a TL-WDR3600 router that runs Chaos Calmer and it is working fine!  It is not using too much CPU (4 % or less), but this router is just setup as a testing unit and very little traffic goes through it: if a lot of traffic was going through it, the CPU usage may be quite different!  With a lot of data, the graph generation maybe be quite demanding on the CPU.

But, I cannot linked it to a postgresql database, as the elements required in the bandwidthd package in oldpackages are excluded from the compilation and therefore cannot work.  A different makefile will have to be built in order to compile the required element in bandwidthd.  As the package is not maintained anymore, I guess that this will be my job to figure out what to do and do it!

So, back to the learning curve to learn how to do that (I have not looked seriously yet, as I achieved what is described above last evening and I did not have the time today to look at it).

I somebody wants to give me pointers where I should look to take the package in git and modify it, please do not hesitate to do so!

Good work... Now please consider adopting the package as maintainer!

Degeneratescum wrote:

Good work... Now please consider adopting the package as maintainer!

I am willing to do that if I can!  I did not have much time yesterday to read about being a maintainer for a package, but I am willing to look around!

I got the source code of bandwidthd yesterday on my CentOS system and I have the makefile patch file from the OpenWrt package: I need to look at all that, learn what all that means and play around to try to modify the makefile and patch file of OpenWrt for bandwidthd to be able to compile something that would actually make something and not crash the unit!  There is some level of learning curve for me in that!  But, with time and effort, I am sure I can reach that goal.

Is there a good OpenWrt wiki to start with?

HI JM,

http://wiki.openwrt.org/start

I as a wiki admin are interested in your feedback regarding usage of the wiki. You seem to be new to OpenWrt and the wiki, and your impressions are fresh. Please share your experience, so we can make the wiki better and more userfriendly.

There are currently two forum threads where wiki improvements are discussed:
1) Improve the Wiki Table of Hardware *
2) Initiative to improve OpenWrt documentation

Feel invited to post your experiences, positive and negative, in one of the above threads!

*) http://wiki.openwrt.org/toh/start or http://wiki.openwrt.org/toh/views/start

jmlacroix wrote:

OK: I was able to compile and install the Bandwidthd package for Chaos Calmer on a TL-WDR3600 (ar71xx).  I took the Bandwidthd package in the oldpackages, setup a proper environment on a CentOS 6.4 system, set it up according to the various wiki available, compiled Bandwidthd with the proper dependency, installed it on a TL-WDR3600 router that runs Chaos Calmer and it is working fine!  It is not using too much CPU (4 % or less), but this router is just setup as a testing unit and very little traffic goes through it: if a lot of traffic was going through it, the CPU usage may be quite different!  With a lot of data, the graph generation maybe be quite demanding on the CPU.

But, I cannot linked it to a postgresql database, as the elements required in the bandwidthd package in oldpackages are excluded from the compilation and therefore cannot work.  A different makefile will have to be built in order to compile the required element in bandwidthd.  As the package is not maintained anymore, I guess that this will be my job to figure out what to do and do it!

So, back to the learning curve to learn how to do that (I have not looked seriously yet, as I achieved what is described above last evening and I did not have the time today to look at it).

I somebody wants to give me pointers where I should look to take the package in git and modify it, please do not hesitate to do so!

Can you share the compiled package?

i.trankolov wrote:

Can you share the compiled package?

Sorry: I just saw the post: I have been pretty busy lately, and I forgot to subscribe to the topic.

It is for ar71xx on CC:

-rw-r--r--. 1 lacroix users 31958 Oct  7 15:20 bandwidthd_2.0.1-4_ar71xx.ipk

I sure can share it, but I am not sure the best way to do that!

(Last edited by jmlacroix on 13 Oct 2015, 18:55)

Just to let you know that the package bandwidthd is now in the trunk build (I am now the maintainer it seems): I saw it in built made on Oct. 16 (ex: https://downloads.openwrt.org/snapshots … ackages/).

This weekend, I will put in place the git pull request to have it in the 15.05 branch in git: I will let know when it will be there.

It is in the trunk alright, but not compilable.

make[2]: Entering directory `/opt/openwrt-git-trunk/feeds/packages/utils/bandwidthd'
rm -f /opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/stamp/.bandwidthd_installed
(cd /opt/openwrt-git-trunk/build_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/bandwidthd-2.0.1/./; if [ -x ./configure ]; then find /opt/openwrt-git-trunk/build_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/bandwidthd-2.0.1/ -name config.guess | xargs -r chmod u+w; find /opt/openwrt-git-trunk/build_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/bandwidthd-2.0.1/ -name config.guess | xargs -r -n1 cp --remove-destination /opt/openwrt-git-trunk/scripts/config.guess; find /opt/openwrt-git-trunk/build_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/bandwidthd-2.0.1/ -name config.sub | xargs -r chmod u+w; find /opt/openwrt-git-trunk/build_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/bandwidthd-2.0.1/ -name config.sub | xargs -r -n1 cp --remove-destination /opt/openwrt-git-trunk/scripts/config.sub; AR="arm-openwrt-linux-uclibcgnueabi-gcc-ar" AS="arm-openwrt-linux-uclibcgnueabi-gcc -c -O2 -pipe -march=armv6k -mtune=mpcore -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,relro" LD=arm-openwrt-linux-uclibcgnueabi-ld NM="arm-openwrt-linux-uclibcgnueabi-gcc-nm" CC="arm-openwrt-linux-uclibcgnueabi-gcc" GCC="arm-openwrt-linux-uclibcgnueabi-gcc" CXX="arm-openwrt-linux-uclibcgnueabi-g++" RANLIB="arm-openwrt-linux-uclibcgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-uclibcgnueabi-strip OBJCOPY=arm-openwrt-linux-uclibcgnueabi-objcopy OBJDUMP=arm-openwrt-linux-uclibcgnueabi-objdump SIZE=arm-openwrt-linux-uclibcgnueabi-size CFLAGS="-O2 -pipe -march=armv6k -mtune=mpcore -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,relro -I/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include -I/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/include -I/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include" CXXFLAGS="-O2 -pipe -march=armv6k -mtune=mpcore -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,relro -I/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include -I/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/include -I/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include" CPPFLAGS="-I/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include -I/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/include -I/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include " LDFLAGS="-L/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib -L/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/lib -L/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib -zrelro -L/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib -L/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/lib -L/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/opt/openwrt-git-trunk/staging_dir/toolchain-arm_mpcore_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib -zrelro -Wl,-rpath-link,/opt/openwrt-git-trunk/staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib"   ./configure --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info    ac_cv_file__sw_lib=no ac_cv_file__sw_include=no ac_cv_file__usr_pkg_lib=no ac_cv_file__usr_pkg_include=no ac_cv_file__usr_local_pgsql_lib=no ac_cv_file__usr_local_pgsql_include=no ac_cv_lib_pq_PQconnectdb=no  ; fi; )
configure: loading site script /opt/openwrt-git-trunk/include/site/arm
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-openwrt-linux-gnu
checking for bison... bison -y
checking for arm-openwrt-linux-gcc... arm-openwrt-linux-uclibcgnueabi-gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for executable suffix... 
checking for object suffix... o
checking whether we are using the GNU C compiler... yes
checking whether arm-openwrt-linux-uclibcgnueabi-gcc accepts -g... yes
checking for a BSD compatible install... /usr/bin/install -c
checking for flex... flex
checking for yywrap in -lfl... no
checking for yywrap in -ll... no
checking lex output file root... lex.yy
checking whether yytext is a pointer... no
checking how to run the C preprocessor... arm-openwrt-linux-uclibcgnueabi-gcc -E
checking for X... no
checking for /sw/lib... (cached) no
checking for /sw/include... (cached) no
checking for /usr/pkg/lib... (cached) no
checking for /usr/pkg/include... (cached) no
checking for connect in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for inet_aton in -lresolv... yes
checking for pow in -lm... yes
checking for libiconv_open in -liconv... no
checking for png_read_info in -lpng... yes
checking for gdImageCreate in -lgd... no
configure: error: Bandwidthd requires but cannot find libgd
make[2]: *** [/opt/openwrt-git-trunk/build_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/bandwidthd-2.0.1/.configured] Error 1
make[2]: Leaving directory `/opt/openwrt-git-trunk/feeds/packages/utils/bandwidthd'
make[1]: *** [package/feeds/packages/bandwidthd/compile] Error 2
make[1]: Leaving directory `/opt/openwrt-git-trunk'
make: *** [package/bandwidthd/compile] Error 2
228.586u+45.006s=5:47.91e(78.6%) TDSavg=0k+0k+0k max=385796k 100240+599808io 284pf+0sw
[debian@debian:/opt/openwrt-git-trunk 983%] ~
mazilo wrote:

It is in the trunk alright, but not compilable.

configure: error: Bandwidthd requires but cannot find libgd

This is odd: the compiler did not find the library libgd.  This is a standard package in the default feed (https://github.com/openwrt/packages): the same place where bandwidthd is (although in a different directory: libs instead of utils).  I do not really know why you got that message!

I will try on my end to see where the problem may be: it may take me a few days as I have other commitments today and tomorrow!

(Last edited by jmlacroix on 18 Oct 2015, 15:15)

I just wanted to show I do have libgd in my STAGING_DIR as shown below:

[debian@debian:/opt/openwrt-git-trunk 1449%] ~ dir staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib/{libgd.*,pkgconfig/gdlib.*} staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/{entities.h,gdcache.h,gd_color_map.h,gd_errors.h,gdfontg.h,gdfontl.h,gdfontmb.h,gdfonts.h,gdfontt.h,gdfx.h,gd.h,gd_io.h,gdpp.h}
-rw-r--r-- 1 debian users   4930 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/entities.h
-rw-r--r-- 1 debian users   2898 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdcache.h
-rw-r--r-- 1 debian users    478 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gd_color_map.h
-rw-r--r-- 1 debian users   1503 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gd_errors.h
-rw-r--r-- 1 debian users    553 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdfontg.h
-rw-r--r-- 1 debian users    551 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdfontl.h
-rw-r--r-- 1 debian users    519 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdfontmb.h
-rw-r--r-- 1 debian users    515 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdfonts.h
-rw-r--r-- 1 debian users    546 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdfontt.h
-rw-r--r-- 1 debian users   2394 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdfx.h
-rw-r--r-- 1 debian users  51205 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gd.h
-rw-r--r-- 1 debian users   3125 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gd_io.h
-rw-r--r-- 1 debian users  52162 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/include/gdpp.h
-rw-r--r-- 1 debian users 446304 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib/libgd.a
lrwxrwxrwx 1 debian users     14 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib/libgd.so -> libgd.so.3.0.
0
lrwxrwxrwx 1 debian users     14 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib/libgd.so.3 -> libgd.so.3.
0.0
-rwxr-xr-x 1 debian users 382416 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib/libgd.so.3.0.0
-rw-r--r-- 1 debian users    610 Oct 17 14:43 staging_dir/target-arm_mpcore_uClibc-0.9.33.2_eabi/usr/lib/pkgconfig/gdlib.pc
[debian@debian:/opt/openwrt-git-trunk 1450%] ~

@mazilo
I was able to compile it succesfully for:
- ar71XX (bandwidthd_2.0.1-4_ar71xx.ipk)
- arm64 (bandwidthd_2.0.1-4_arm64.ipk)

This is the trunk source.  I see that you have uClibc in your file names in the staging_dir: in my case, I have musl (ex: target-mips_34kc_musl-1.1.11).  I see the  uClibc in the 15:05 build: I am not sure about the difference, but in my case, if I want to built for the 15:05, I have a different build environment (that I made with git clone git://git.openwrt.org/15.05/packages.git), than for trunk (I used git clone git://git.openwrt.org/openwrt.git).

I do not know whether or not this makes a difference.

I also use the OpenWRT git repository. I guessed the difference is between uClibc and MUSL.

mazilo wrote:

I also use the OpenWRT git repository. I guessed the difference is between uClibc and MUSL.

Just to let you know that since I am quite new to openwrt, I have a fresh OpenWrt build system to compile my things (both in CC and trunk).  As I was learning, I installed the whole compile system a few times, but now I am properly setup and things compile fine on both the CC and trunk side.  In fact for both, I am now using installs from last Saturday: yes quite fresh!

So I have a fresh OpenWrt build system for both CC and trunk and I do no seem to have problems to compile the bandwidthd package: I did it for 3 different CPUs in trunk and 2 CPUs in 15.05 (a.k.a. CC).

I have not put bandwidthd  in the git 15.05 branch yet, and I am not sure I will.  The CC images and packages at https://downloads.openwrt.org/chaos_calmer/15.05/ do not seem to be recompiled periodically, therefore having bandwidthd in the 15.05 branch in git would not help the people that cannot compile packages.

If people wants to have bandwidthd in CC and they have a way to compile packages, they can select the oldpackages in the feeds.conf file that is in their openwrt folder on their OpenWrt build system: just uncomment the line in the feeds.conf file, then issue the ./scripts/feeds update -a command.

The bandwidthd package that I have in the trunk git is basically the same as in the oldpackages: the Makefile has only been modified to add my name as maintainer and a few other things that do not affect in any regards the compiled package.  In other work: whether you take it from oldpackages or from the trunk packages, it will compile fine and give you the same binary packages file (i.e.: the bandwidthd_2.0.1-4_XXXXXX.ipk file).  Of course if you compile for trunk, it may be different than if you compile it for CC!

But, if there are good reasons to put the package in the 15.05 git branch, I can do it!

(Last edited by jmlacroix on 19 Oct 2015, 20:59)

I guess I am the only one who has problem compiling the bandwidthd package on the trunk. This means there probably is something wrong with my setup.

The discussion might have continued from here.