I received my TonidoPlug after a 6 week wait post placing order. Tonidoplug is a low cost : 100$ + 30$ shipping to India + 560INR in duties, low power: of the order of 5W computer that runs Ubuntu. The first thing I set up on the plug was a static dhcp server. I wanted each device to have a fixed IP address that was centrally managed. The Tonido software that comes built-in with the plug computer sadly lacks a DHCP server module.
Not to be undone, I installed dhcp server via apt-get (this is ubuntu, after all) and set it up with a dhcpd.conf that looks like this:
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
}host desktop {
hardware ethernet 00:XX:XX:XX:XX:XX;
fixed-address 192.168.XX.XX;
}
host laptop {
hardware ethernet 00:XX:XX:XX:XX:XX;
fixed-address 192.168.XX.XX;
}host phone {
hardware ethernet 00:XX:XX:XX:XX:XX;
fixed-address 192.168.XX.XX;
}
My BSNL model has a propensity to lose the PPP connection to the DSL server, which requires its reboot. I wrote a small script to check the connection by pinging Google and rebooting the modem if ping fails.
#!/usr/bin/python
# To do important stuff
import os# To log all my actions
import logging
import logging.config# Init the logger
LOG_FILENAME = ‘/path/to/modemlog’# Set up a specific logger with our desired output level
logger = logging.getLogger(‘ModemLogger’)
logger.setLevel(logging.DEBUG)# Add the log message handler to the logger
handler = logging.handlers.RotatingFileHandler(
LOG_FILENAME, maxBytes=2048, backupCount=3)# This is the format of the log
formatter = logging.Formatter(“%(asctime)s – %(name)s – %(levelname)s – %(message)s”)# Set the formatter
handler.setFormatter(formatter)# Set the handler
logger.addHandler(handler)# Actual operation! Ping and see!
result = os.system(“ping -c 4 www.google.co.in”)if result != 0:
#Ping not working, reset the router
os.system(“/usr/bin/curl -u admin:password 192.168.1.1/rebootinfo.cgi”)
logger.error(“Ping not working, router reset”)
else:
logger.info(“Ping check passed.”)
Of course, this meant I had to install curl, which I installed with apt-get. I then proceeded to add this script to the crontab so that the router connection would be checked every 15 minutes.
# m h dom mon dow command
0,15,30,45 * * * * /path/to/scripts/check_connection.py
The TonidoPlug provides a very nice redirection service via tonidoid.com. I am therefore able to access the plug from anywhere as long as the Internet connection to the plug is functioning. However, I thought the ability to ssh into the plug from elsewhere would be nice. Therefore I poked holes in my router’s NAT. I didn’t want to get another dynamic DNS service, so I wrote another small script that would ping a specific location on this site, which would then record the IP address of the place it was pinged from. I added this script to the plug’s crontab.
# m h dom mon dow command
0,15,30,45 * * * * /path/to/scripts/update_ip.py
Now I had a way to get the Plug’s external IP from my personal, albeit lame, dynamic dns service 🙂
The next problem I had was with the hard disk shutting down due to inactivity after 10 minutes. So I wrote another small script to append to a dummy file on the hard disk every 9 minutes (except once an hour at 6 minutes).
# m h dom mon dow command
0,9,18,27,36,45,54 * * * * /path/to/scripts/keephddalive.py
Now I’ve been running the plug computer and the disk for a couple of days. Using the built in torrent client to boost my share ratio in some sites where I need it!
The plug, being a device with no moving parts, is totally soundless. This is ideal when you plan to leave it on all the time. It also gets merely warm to touch after a few days of continuous operation. The transcend external hard disk is pretty quiet too.
I haven’t gone into the main feature of the product, that is the Tonido Software. This is what allows you to manage the device from anywhere with an internet connection. I’ll try and write about my use of it some other time. For now you’ll have to be satisfied with a few screenshots 🙂
Neat li’l write-up.
Some Qs I have,
1. The BSNL router/modem hang – It’s a workaround what ou have done right? Why not solve the real problem?
2. HDD inactivity shut-off: Again, there should be a way to shut it off right? or, power-on-wake or something should exist right?
Short answer to both 1 & 2 is that I’m too lazy to figure out how to solve the real problem. The kludge works.. 🙂
Pingback: RajeshGoli.com» A rails iPhone webapp
hey I was wondering whether I could use the project “Banna” by Mr. Rajasheker? Its available on ur website.