Other | charlie on software - Part 3

Archive for the ‘ other ’ Category

TiVo Runarounds, Issues, and Problems

For the past few years, I have been a happy TiVo Premiere user. I own two of the boxes, a regular Premiere box as well as an XL4 Elite box. Until recently, everything was fine, until the XL4 took a major dive….


My XL4 started randomly missing channels, no idea why, so I call my cable company, Time Warner.

TWC sends a technician out to look at the problem. He told me everything seems alright, but since he got into a crash in his van earlier in the week, he was in a loaner van with no equipment to check anything for me. Wasted time…

It is still not working, so TWC sends out a “2nd level” technician. He replaced my cable card and tuning adapter, problem still persisted. He was able to isolate the problem to when a tuner changed channels between a switched and non-switched channel. Still no resolution.

TWC sends out their “senior technician”….he redoes some wiring, double checks that everything looks good, problem still persists….he was able to enlighten me to the fact that when a channel doesn’t come in, the TiVo will show in its diagnostics that it is trying to tune into an analog channel when in fact it should be digital. This happens with switched and non-switched channels. He told me he has seen this problem a few times around Austin, and it has only been a problem with TiVo XL4 boxes.DSC00560

So, the Time Warner is convinced everything is good on their end. By this point, I have gone through 3 cable cards and 3 tuning adapters….still no fix in sight

So, I called TiVo tech support. They think everything is fine, but ask me to RMA by XL4 for a new one. But but but, they wanted to charge me $50 to do it…..I was not so happy that TiVo wanted to charge me money to swap out a defective box that was still under warranty….so after further negotiation, I was able to get a new box free of charge.

Fast forward 3 days. New box arrives, same problem. I call TiVo, we spend an hour on the phone troubleshooting….technician admits he does not know what is wrong, but the replacement box I had received was re-manufactured, so it may be bad as well. They ship me a new XL4 off the line.

Today….new XL4 arrives….I hook it up, get it set up, problem still persists. I called TiVo Earlier today….the tech on the phone told me “My signal to the box was too high and that was the problem”. Ok, no problem…..I introduced some artificial degradation on the line by splitting it a few times. Signal went down from 100 to 88, and SNR went from 38db to 34db. Problem still persisted. I called TiVo again tonight, they finally admitted it is an issue that their engineering team is working on and there is no solution in sight.

So, 3 TWC appointments, 3 cable cards, 3 tuning adapters, 3 TiVos, and countless hours spent on the phone and my TiVo XL4 still does not work.

Update 09/04/13:

I have called TiVo tech support every 2 days for the past week. I finally found out that my problem was escalated earlier this week. I asked them what that really meant, the rep replied that “it means we have no idea what is going on, but we are going to look into it further.”….Fantastic, I’m still stuck with a broken DVR. TiVo tried to convince me it was an environmental problem in my home, but given that my regular TiVo Premiere box works perfectly in every outlet in the house and only the XL4 fails, seems to anyone with logical deduction skills that the issue lies in the software or hardware in the XL4 box. Furthermore, I asked TiVo if there was a way that I could somehow replace my XL4 with any other model comparable and pay some kind of fee to do so….the rep was quite rude and insisted it was not possible, and told me that I was stuck with my broken DVR until further notice. So much for customer service.

I know my situation may be isolated, but I cannot in good faith give any kind of recommendation to a company that not only sells a defective product, but then tries to defend its perfection in the face of overwhelming evidence, then cannot provide any kind of resolution for my issue, then refuses to provide me with any kind of other solution even when I offer financial compensation on my behalf (which shouldn’t even be required) to solve the problem.

Now in Chi-town

The server that hosts this blog has been relocated from Scranton, PA to Chicago, IL. Things might be unstable for a few days as the new configuration is finalized.

Email to SMS gateway solution for Google Voice users

I’m a loyal Sprint PCS cell phone subscriber. Not only is their price/feature ratio right, but they offer outstanding integration with Google Voice that is unmatched by any other national cell phone carrier.

With almost all cell phone carriers, they offer an email to SMS gateway solution, wherein anyone can send an email with a short message in it to a specific address and it will be converted by the carrier into a text message and sent to your phone. For Sprint, the form is:


This is all fine and dandy, except that if you opt in for the enhanced Google Voice integration, that email to SMS gateway no longer will function for your number. There is a common solution posted on the Internet for this problem:

Have Google Voice forward text messages to your GMail account. From Google Voice, send a text message to yourself and wait for it to show up in your inbox. Look at that email and use the from address there as the address to send email to to send SMS to your phone. The problem with this is that Google generates a unique from address for each email it sends out as a text, which ties that from address to a specific recipient, so that threaded conversation can be maintained in Google Voice. Aka, you can save that specific from address and use it from your local GMail account to email texts to yourself, but if you give that email address to someone else, the emails from them will not go through to your phone.

I required a more robust solution, where I could provide a single email address to multiple outside people/services that would act as a gateway into a text message sent to my phone.  Here is my solution:


  • a machine that continually is up and runs python
  • a dummy GMail account
  • a dummy Google Voice account (optional, may be hard to get if you don’t have an extra phone number to tie it to)
  • pygooglevoice installed on the server machine (either in a virtualenv or system wide), patched as shown on https://code.google.com/p/pygooglevoice/issues/detail?id=58#c24
  • python-daemon installed on the server machine (either in a virtualenv or system wide)

Here is the setup:

Run a python daemon on a machine that monitors the dummy GMail inbox periodically for new mail. When it finds on, it downloads the message, parses out the body text, logs into a Google Voice account, and texts the body of the message to your cell phone. Seem simple enough?

Here is the code for the daemon that I wrote:

Created on Dec 4, 2012

Simple Python daemon that acts as a proxy to forward
emails to a cell phone (for me, my google voice number)

@author: Charlie Meyer <charlie@charliemeyer.net>

import imaplib
import email
from googlevoice import Voice
import logging
import time
from daemon import runner

logger = logging.getLogger("SMSDaemon")
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
handler = logging.FileHandler("/var/log/SMSDaemon.log")

class EmailReceiver:

    def __init__(self):
        logger.debug("Email Init")
        self.username = "yoursmsdummyaccount@gmail.com" #edit this
        self.password = "smsdummyaccountpassword" #edit this
        self.server = "imap.gmail.com"
        self.port = 993
        self.M = None
        self.response = None

    def login(self):
        logger.debug("IMAP Login")
        self.M = imaplib.IMAP4_SSL(self.server, self.port)
        rc, self.response = self.M.login(self.username, self.password)
        logger.debug("IMAP Login complete")
        return rc

    def logout(self):
        logger.debug("IMAP logout")
        logger.debug("Logged out")

    def get_messages(self):
        logger.debug("Getting unread mail")
        logger.debug("Getting unread count")
        status, response = self.M.status('INBOX', "(UNSEEN)")
        unreadcount = int(response[0].split()[2].strip(').,]'))
        if unreadcount > 0:
            logger.info("There are "+str(unreadcount)+" unread messages")
        logger.debug("Getting unread mail")
        status, email_ids = self.M.search(None, '(UNSEEN)')
        messages = []
        for e_id in email_ids[0].split():
            logger.info("Fetching message id="+str(e_id))
            rc, data = self.M.FETCH(e_id, '(RFC822)')
            logger.debug("Fetch complete, rc="+str(rc))
            mail = email.message_from_string(data[0][1])
            for part in mail.walk():
                if part.get_content_maintype() == 'multipart':
                if part.get_content_subtype() != 'plain':
                payload = part.get_payload()
                logger.info("message: "+str(payload))
        logger.debug("Mail fetch complete")
        return messages

class SMSSender:

    def __init__(self):
        logger.debug("SMS init")
        self.username = "dummygvoice@gmail.com" #edit this to be either your gvoice account or your dummy one if you have one
        self.password = "password" #edit this
        self.to = "your10digitphonenumber" #edit this
        self.voice = None

    def login(self):
        logger.info("SMS Login")
        self.voice = Voice()
        self.voice.login(self.username, self.password)
        logger.info("SMS Login complete")

    def logout(self):
        logger.info("SMS Logout")
        logger.info("SMS Logout complete")

    def send_sms(self, message):
        logger.info("Sending message: "+str(message))
        self.voice.send_sms(self.to, message)
        logger.info("Message sent")

class SMSDaemon():

    def __init__(self):
        self.stdin_path = '/dev/null'
        self.stdout_path = '/dev/tty'
        self.stderr_path = '/dev/tty'
        self.pidfile_path =  '/var/run/smsdaemon.pid'
        self.pidfile_timeout = 5

    def run(self):
        while True:
            logger.info("Daemon looping")
            g = EmailReceiver()
            messages = g.get_messages()
            if len(messages) > 0:
                sms = SMSSender()
                for message in messages:
            logger.debug("Daemon Sleeping")

daemon = SMSDaemon()
daemon_runner = runner.DaemonRunner(daemon)

I saved that file in /root/smsdaemon/SMSDaemon.py

I then tested it using:

python SMSDaemon.py start

and sent an email to my dummy gmail account and ensured it arrived as a text message on my phone. The program will log to /var/log/SMSDaemon.log, so you can look there to ensure it is working. Once that works, time to write the init script so it loads on boot.

First, ensure the daemon is stopped:

python SMSDaemon.py stop

Then, add the following to /etc/init.d/smsdaemon

# /etc/init.d/smsdaemon
# Provides: smsdaemon
# Required-Start:
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Short-Description: SMSDaemon process
# Description:    Runs up the SMSDaemon process

# modified from http://www.gavinj.net/2012/06/building-python-daemon-process.html

# uncomment and edit the following line if needed to activate the python virtual environment
# . /path_to_virtualenv/activate

case "$1" in
    echo "Starting"
    python /root/smsdaemon/SMSDaemon.py start
    echo "Stopping"
    python /root/smsdaemon/SMSDaemon.py stop
    echo "Restarting"
    python /root/smsdaemon/SMSDaemon.py restart
    echo "Usage: /etc/init.d/smsdaemon {start|stop|restart}"
    exit 1

exit 0


sudo chmod +x /etc/init.d/smsdaemon
sudo update-rc.d smsdaemon defaults
sudo service smsdaemon start

There you go, all done!

Let me know if this works for you or if you have any comments, I might be looking to port this solution to a compute cloud like the Google App Engine or similar in the future.