Slow Internet? Try annoying your ISP!

So my roommate and I were annoyed about our internet beeing slow.

I thought about speedtesting my connection every so often and save the results to send them to my ISP when the internet is slow again.

I quickly binged my way to through some tutorials and the simplest way was to use speedtest-cli, cron, scp and a windows shortcut in the startup folder.

You could follow this tutorial for the basics:

https://pythonprogramming.org/monitor-your-internet-with-python/

but I extended the idea with a cronjob and an scp command under windows to backup the file to my pc.


Lets go:

Im assuming you have a device with linux at home.

First:

Install speedtest-cli on the pi with python-pip.
Second:

create a cronjob with “crontab -e” and enter something along these lines:

30 00 * * * date >> /var/tmp/speedlog.txt
30 00 * * * /usr/local/bin/speedtest-cli >> /var/tmp/speedlog.txt

This saves the current date in the speedlog file and adds the speedtest output.

I did not consider log-file rollover here – because this file will eventually be huge otherwise.

Third:

sync your file via scp or rsync to your desktop pc. Have ssh enabled and sync your file. I did it with another cronjob inside my WSL (Windows Subsystem for Linux) and copy the file from my pi to my HDD with:

00 22 * * * scp pi@110.10.10.10:/var/tmp/speedlog.txt ../../mnt/d/speedlog.txt

Then it dawned on me, that the WSL has to be kept open, so i found this:

https://blog.snowme34.com/post/schedule-tasks-using-crontab-on-windows-10-with-wsl/index.html#Make-the-Daemon-start-at-Windows-Boot

Especially this part:

Open sudo config file:

sudo visudo

Add the following line:

%sudo ALL=NOPASSWD: /etc/init.d/cron start

Fourth:

win+r, enter shell:startup , create a shortcut for wsl.exe (see below) and paste something along this in the destination field:

C:\Windows\System32\wsl.exe sudo /etc/init.d/cron start

Then a linux terminal should start on pc boot. If you picked your time for the file backup at a reasonable time thats inside the window of you using your pc, that should run one time and you should see your updated file at your chosen location.


UPDATE:

Meanwhile I did not want to send the files manually to my ISP. So I added a twitter bot and a python script to automatically notify my ISP about my network being slow.

It didn´t take them a week to ban the bot from posting to them.

UPDATE 2:

As it turns out, my ISP was just partly the problem.

A friend of mine had the idea to just disable my freifunk router to see if that helps.

SPOILER: it did.

Now why does it help?

Vodafone Germany fucked up their ipv6 routing and therefore my freifunk router took over the ipv6 handling,which slowed down my internet speed significantly ( predictably to 16Mbit/s ).

As of now, vodafone still hasn´t fixed that. I´ll have to try and disable ipv6 routing in my freifunk router and see if that helps – because i still want to use the router as my guest wifi.

So, if you run into the same problem, and you are sure its not on their part (by checking your ISP´s speedtest, which sometimes shows the speed to your router and the network internal speed seperately) – try disabling some of your equipment, especially routers and see if that helps.

Selfmade NAS with TrueNAS Core

This post is about:

  • building your own NAS with TrueNAS Core
  • Problems i ran into while setting it up
  • Plugins I used (Plex and Nextcloud)
  • and how many times i had to reinstall shit on it

Just to show:

what not to do! 😉

Introduction:

My roommate and I thought about buying a NAS System – noticed, that they were pretty expensive and we would need to buy hard drives seperately anyway – so I came up with the idea to just reuse the old living room PC to build our own NAS System.

A search later, I found out about TrueNAS (Core) – which is an open source, linux based and most importantly FREE OS/Software package to create your own NAS with plugins for (almost) anything in a VM on your encrypted drives.

I wont go into detail on how to set this up but basically:

  • USB drive
  • flash .ISO
  • click ok a few times
  • voilá

Main Part:

For me, it wasnt intuitive at first, but after some tutorials, i had a grasp on how Id go about further steps of using it. I had a 1.5tb HDD laying around, I just connected it, used it for my own cloud plugins (nextcloud + plexmediaserver) and was ready for the hard part:

Setting up the plugins the right way.

Just make sure you have enough free space on your server (got this “no error” – error really fast). While I had to upgrade on space, I also ordered a backup drive for my 2nd drive – a drive i had used for encrypted backups for some time, encrypted with Bitlocker (Win10 encryption). TrueNAS doesnt recognize those, so i had to decrypt it “real quick” – took 2,5 DAYS – so keep that in mind, while picking your device for doing so. I had to keep my PC running for that, basically at idle, but it still drew power from the wall …

Also: make sure you dont use spaces ” “ in your pool names, as this will fuck you sideways while installing plugins – this is linux after all – dots “.” for example are okay though.

This brought me to my first reinstall of my HDD, luckily not everything, so I could keep my settings made in TrueNAS.

Quick Tipp:

Pools->Datasets->Shares (ie. SMB)->Users / Plugins (which then create their own vaults)

Also: dont update your plugins while they run, or anything while it runs!

As Im writing this, Im not really finished setting everything up, i just wanted to take a break from reinstalling plugins and setting things up again…

Keep in mind, that you will have to upgrade your system on a regular basis, if you plan to open it to the WWW, therefore i wont do that 🙂

Future plans:

Setting up Wake On LAN (WOL) so that the old PC wont suck my wallet dry. Sadly, TrueNAS isnt supporting that feature, even though my PC does. I therefore opted for setting my HDDs to sleep after 180sec and power mode 1 (spindown). This reduces the power pulled, but isnt really what i wanted and HDDs dont really like to be spun up and down repeatedly.

I´ll keep you posted on what im going to do about this in the future 🙂