Technicolor TG800vac - log monthly broadband usage

I'm running a:

root@mygateway:~/trafficmon# cat /rom/etc/config/env

config envvars 'var'
        option company_name 'Technicolor'
        option prod_friendly_name 'Technicolor TG800vac'
        option CONF_VERSION 'CRF779'
        option provisioning_code 'Telstra'
        option logfilter 'ALL'
        option variant_friendly_name 'TG800vac'
        option prod_name 'Technicolor TG'
        option prod_number '800vac'
        option ssid_prefix 'Telstra'
        option rtfds '1'

With this release:

# cat /etc/openwrt_release

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Chaos Calmer'
DISTRIB_REVISION='r46610'
DISTRIB_CODENAME='chaos_calmer'
DISTRIB_TARGET='brcm63xx-tch/VANTY'
DISTRIB_DESCRIPTION='OpenWrt Chaos Calmer 15.05.1'
DISTRIB_TAINTS='no-all busybox'

I want to log my broadband usage each month and I'd like some help to combine the following as a script so I can put it in the crontab file:

grep 'br-lan' /root/trafficmon/check_data | sed -e "s/^/$(date -R) /"

and

date +"%Y/%m/%d_%H:%M:%S"

After reading through Network Traffic Monitor with vnStat and understanding that the stats are lost on restart I decided not to make my own log file.

Unfortunately when I got to creating the Database I got Error: Not enough free diskspace available which is disappointing since it is the first package I tried to load.

root@mygateway:/tmp# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                   89.1M      7.0M     82.2M   8% /
/dev/root                21.5M     21.5M         0 100% /rom
/dev/mtdblock2           89.1M      7.0M     82.2M   8% /overlay
overlayfs:/overlay/bank_2
                         89.1M      7.0M     82.2M   8% /
/dev/sda1                 3.7G      2.7M      3.7G   0% /tmp/run/mountd/sda1

I want to store the database on the thumb drive.

Hi there,

first of all

is outdated. You should consider updating to 17.01.4 or even 18.06 , a lot of software got updated in the last 3 Years !

But back to your topic:

3.7G on /dev/sda1 should be more than enough for the Database.

So here some hints:
Did you reboot the OpenWRT router after installing vnStat ?

You should check if the /etc/vnstat.conf is configured right with /tmp/run/mountd/sda1 as destination.
If yes:Test if you are able to write to the Stick e.g. with

echo "test" > /tmp/run/mountd/sda1/writetest.txt

You could double check by mounting it on another machine , after the creation of "writetest.txt" and check if it is really on the stick.

If everythink seems fine try to find out what exactly produces the:

Error: Not enough free diskspace available

What exactly should be written to where from which programm started with which options ?

The modem was accessed using a vulnerability. Unfortunately there are a lot of constraints and we can't recreate the checksums - so we seem to be locked to OpenWrt Chaos Calmer 15.05.1.

Hacking the Technicolor TG799vac (and unlocking features!):

These modems use two roms (bank_1 and bank_2) which can be upgraded/used almost independently. They are digital-signature verified before boot so you can’t edit the rom image in the flash. The config is stored in the matching folder in /overlay i.e. /overlay/bank_2 (hint: you can see your modified config files in here if you want to back stuff up or see what changes you made). When a proper factory reset is done, the overlay partition is formatted (but not securely wiped).

I did reboot the modem after installing vnStat. What is really suspicious to me (given this is the first package) is 100% root usage when logged in as root.

I appreciate your suggestions - I'll work through them in about 12 hours.

The 100% percent root usage is normal OpenWRT behaviour.

at my device it states:

Important is the "overlayfs" which states more than 82MB free space on your device.
And even that should be enough for a database.

But you use a kind of "customised OEM-OpenWRT" on your device. Perhaps something got messed up from the manufacturer. Would be hard from over here to figure out if thats the case.

Time period: 01.01.2018 - 10.07.2018
New topics created: 2467
Unanswered topics: 420 -> 17%

-> 83% of the topics get answers, but it may take some time.

touché :blush:

Very useful following Network Traffic Monitor with vnStat.

Rebooted again and created database with vnstat -u -i eth4. Fairly confident it is logging:

root@mygateway:~# ls  /tmp/run/mountd/sda1/vnstat
br-lan  eth4

I'm not sure how I view the results. Still struggling with LuCI Webgui Integration, nothing in my web interface and not sure what the card would look like. Instructions written to download and I'm trying to load from tmp.

root@mygateway:~# opkg list | grep luci
luci-app-vnstat - git-18.021.57137-5fa2132-1

I don't understand instructions This same init.d script ..., the point above it, Image Generation or `Persistent stats'.

Method 1 done - anything else needed in `Persistent stats'?

So the first problem is solved :grinning:

"opkg list" will show you all avaible packages including the installed !
To view only the intstalled packages you have to enter "opkg list-installed"
see "opkg --help" for more details

if this:

... is the only output of opkg then you have to Install luci (al least in "standart OpenWRT") becuase you are using a custom Web Interface.

How to install:
https://openwrt.org/docs/guide-user/luci/luci.essentials-tomerge#minimalistic_offline_installation
But: I have no clue how to set up luci as default Web interface , sorry :slight_smile:

I don't understand instructions This same init.d script ..., the point above it

You mean this sentence?

/etc/config/vnstat is the database restore config, not the vnstatd config. vnstatd config is also located at /etc/vnstat.conf

The big exclamationmark points : you could get confused of having 2 files with very similar names. Thats all. Its kind of a reminder ! It tells you further what both files are good for:

If you wish to set up the database restore config (which seems to me to be the config for database handling) you edit this file : /etc/config/vnstat

But if you want to edit the config for vnstatd (the vnstat daemon) you have to edit this : /etc/vnstat.conf

Here you get a script which generates an Image (in the meaning of picture or eyecandy ) to have a nice view on your stats :slight_smile:

I don't think so !

One more thing: If you have a custom webinterface i am not sure if you should change to luci , in the worst case you get an unusable router !

1 Like

I mistyped the grep command:

root@mygateway:~# opkg list-installed | vnstat

                      rx      /      tx      /     total    /   estimated
 br-lan:
       Jul '18      10.31 MB  /    59.53 MB  /    69.84 MB  /   188.00 MB
     yesterday       5.10 MB  /    17.37 MB  /    22.47 MB
         today       5.21 MB  /    42.16 MB  /    47.37 MB  /      150 MB

 eth4:
       Jul '18      59.44 MB  /    10.49 MB  /    69.92 MB  /   188.00 MB
     yesterday      16.44 MB  /     4.83 MB  /    21.27 MB
         today      43.00 MB  /     5.65 MB  /    48.66 MB  /      153 MB

root@mygateway:~# opkg list-installed | grep vnstat
luci-app-vnstat - git-18.021.57137-5fa2132-1
vnstat - 1.12-1
vnstati - 1.12-1

So it looks like vnstat is installed but no LuCI Webgui Integration.