Tuesday, September 06, 2016

MLB At Bat works on Chromecast

I'm one of the Comcast customers stuck between Fox and Comcast on the YES channel. Tivo officially pulled it from their line up the other day. Which really didn't matter since it's been a dead channel since the start of the year. My wife and I don't watch much sports. In fact it's pretty much just Yankees Baseball. I really don't like that I've lost the channel and I really don't care who is right. I just want to watch the Yankee's games.
One route to let me do a little of that is to stream MLB At Bat on the Tivo (although figuring out the black rules is maddening!). The long story made short, I'll just be nice and say: MLB At Bat on the Tivo is terrible! It stutters, stalls, locks up and as the game goes on it gets worse. The last 5 minutes of the game turns into a 45 minute stutter-step wait. The controls are clunky and jumping back or forward is an adventure in patience (if it doesn't lock up the Tivo). So rather than give up I decided to give the Chromecast a try. We'd already paid for the subscription to the MLB app and we weren't getting our money back dang if it didn't work.
I've been playing with the Chromecast to view online material (O'Reilly Safari books and videos). It occasionally disconnects but it works rather well otherwise. So we've started watching the game on my old Chromecast and generally it works rather well. If we jump ahead or back to do experience some stuttering and pauses to buffer but it goes away in a few minutes and we're watching the game in full, snot-rocket visible, HD. So far no crashes and no progressively worse performance. The app did seem to get stuck on a black out game (why was it blacked out, it was out of our area? grrr). I've even ordered a new Chromecast to replace the one I had been using (I don't think my wife will be giving it back to me ;-)). If there is one thing I'd really like to see, with the Chromecast, is more support for streaming from Linux.
So if next year we still experience the war between Comcast and Fox for the YES channel. We're ready. And oddly enough my Cable bill hasn't gone down any, strange that ...

Update: Well it seems that live games on the tablet and Tivo stutter badly (good grief). Archived games on the tablet don't stutter unless we jump around the game but eventually it recovers. On the Tivo, it also stutters on archived games.

Today we've run into the dreaded 'Blackout' at least on the tablet. I can see it on the PC (via Chrome and Chromecast but the video is terrible). I just checked on the Tivo and we can view it there also. This is ridiculous.

Further updates: Wow, I am unhappy! Seems that I am within the black out area for the Yankees. What this means is I can't watch any Yankee game (in realtime, anywhere in the world according to MLB.TV). The fact that it works on Tivo and the first week on the tablets and works on the Browser is the anomaly. I'm not sure if we'll get this application next year.

Sunday, September 04, 2016

Pi Zero Ethernet gadget

So I'm sitting here on Labor Day weekend (US) waiting for Hurricane Hermine to reach NJ. It's predicted to follow a similar path as Sandy. Needless to say it's making us all a little nervous in the North East. All's quiet on the Eastern Front (that's a weather joke).

While waiting I decided to give the Raspberry Pi Zero a try. I followed the directions at Andrew Mulholland's Setting up Pi Zero OTG. I loaded up Raspian Jessie lite, config'd it as a Ethernet gadget and plugged it's USB into my Debian box. Up popped USB0 with a link-local address (169.254.x.x/16). I can then ssh pi@raspberrypi.local to reach it. Cool, I have a nice Tardis USB hub that the Pi will fit perfectly into.

Now comes the fun! I want to update the software. But the link-local addresses aren't really route-able (to simplify the discussion, don't do it). So how do I get the Zero connected to the internet? Well one easy route is with several networking statements and a sub interface (USB0:1). I'd put this under the category of more advanced network setup for Linux because I'll be configuring 3 machines to handle this. I've decided not do use NAT as it's unnecessary on the inside of my network. So here is the configuration commands for the various servers:

Notes: Let me start by saying that I've got a lot of networking experience and I do a lot of experimenting on my network. I've built IP tunnels, VRRP, RIPv2, OSPF and IPv6 on my systems. I'm skipping a lot of details I don't think you'll need but hopefully I haven't ignored something important. I've arbitrarily chosen to give the Pi Zero the IP address of (USB0:1), the USB Host: (USB0:1), the USB Host Ethernet: (the eth0 or wlan0), The firewall is and it also has a DNS server on it. You may need to adjust the network addresses for your own use. Also I have Quagga with RIPv2 running (not required) so I could add static routes there and my other servers would learn the route. Finally, I've not made any of this permanent except for the firewall.

For the Pi Zero (as root):

 # On the Pi Zero
sudo bash
ifconfig usb0:1
echo -e "#\nnameserver" >/etc/resolv.conf
route add default gw usb0:1

Bonus statements for the Pi Zero, I mounted a Samba server (my NAS) to the Pi. You'll need to define the SMB_USER, SMB_PSWD and I've used the user pi and group pi in this example. On the Pi Zero (as root):

 # Make sure that cifs-utils is loaded
mkdir -p /cifs
mount.cifs //samba/{$SMB_USER}/zero /cifs \
  -o user=${SMB_USER},pass=${SMB_PSWD},\

For the USB Host (as root):

 # On the USB Host
echo 1 >/proc/sys/net/ipv4/ip_forward
# Or
sysctl -w net.ipv4.ip_forward=1
# vi /etc/sysctl.conf
# net.ipv4.ip_forward = 1
ifconfig usb0:1

On the firewall I've translated the commands to the typical Linux commands. You'll need to adjust these for your particular router. Mine is actually a Ubiquiti ERLite-3 and uses very different statements. On the firewall (as root):

 # On the router
route add -net netmask gw
# Or
ip route add via dev eth0

Now that all has been said and done I'll let you know that the Pi Zero still supports the ssh pi@raspberrypi.local. I'm working on 2 different Tardis USB Hubs. I think one will remain a USB hub with the Pi as an Ethernet Gadget while the other I will turn into a remote USB Hub (a Pi, Wireless Dongle and the remote USB code).