Monday, January 20, 2014

BotQueue for Windows

A long standing issue is that BotQueue's client bumblebee doesn't work on Windows. I'm going to try to fix that with this blog post.

I started by looking at Portable Python version 2.7. Note, that I'm installing this all on an 8GB flash drive. There's two reasons for this. The first is that I want to test this with multiple computers, and the second is that I don't have admin privileges on any of them. Go ahead and run the installer, it takes a while.

Next thing to download is easy_install so I downloaded onto my flash drive and ran it using the python I had just installed:
It might tell you to run a different command. I ended up having to run:
python.exe -U setuptools 
Next, add the "Scripts" directory under your App folder to your PATH variable.  For me, this was at "E:\Portable Python\App\Scripts". You should also add the App directory so python can be found anywhere. You know it worked if you can run "easy_install" in the prompt and it not completely fail.

Next, install pip and virtualenv:
easy_install pip
Now that pip is installed, open up a command prompt. Run this:
pip install Pygments pyserial requests requests-oauth
pip install pyserial --upgrade
Next, we need to install curses for windows. Go here, and download the win32 2.7 one. I ran this to install curses:
easy_install curses-2.2.win32-py2.7.exe
Now run botqueue's bumblebee client! You'll have to run my version here, instead of the official botqueue (until that branch is merged, so if the branch doesn't exist, it's probably merged in). Any bugs you find, feel free to report them on github on the official issues page, or in the google groups.

There are some issues when you move from one computer to another, so I put the curses exe, and an egg (for pycharm debugging) in the root of the flash drive. Then, I created a batch file that was just these contents:
"%~dp0\Portable Python\App\python.exe" -U setuptools
"%~dp0\Portable Python\App\Scripts\easy_install.exe" pip
"%~dp0\Portable Python\App\Scripts\pip.exe" install virtualenv Pygments pyserial requests requests-oauth --upgrade
"%~dp0\Portable Python\App\Scripts\easy_install.exe" curses-2.2.win32-py2.7.exe
"%~dp0\Portable Python\App\Scripts\easy_install.exe" pycharm-debug.egg

That fixed any issues I had when moving to another computer. The last line is optional and only needed if you're using pycharm's debugging like I am. I will probably do another blog post on how to set up that, because it was definitely interesting to do.

EDIT: Also, not all bugs have been fixed and pushed to the 0.5X-dev branch. I'll update this again when it's ready.

Tuesday, January 7, 2014

A day with Google Chromecast

Today I decided to buy a Google Chromecast. This nice little device plugs into the HDMI port of your TV, and gets its power from either the USB port of your TV (Warning, plugging it into the service port might be dangerous for reasons unknown to me) or from a little wall adapter.


Setup was a little difficult at first, but most things are difficult when you swap two digits in your password. When you first load the device up, it will tell you to go to a URL. I went there on my Galaxy S3, and was greeted with an app link. Once I downloaded the app, it discovered a device was on the network I was on. How did it do this? I'm not actually sure. It didn't know any of the networks authentication at this point, so I'm guessing there's something low level with mac addresses that allows that to work.

After clicking on the device, it puts a code on the TV and one on your device just to make sure you're talking to the right device. It will then ask you what network you want to connect to, and it's credentials. After entering those, you're all set up to go. It was actually fairly easy.

My favorite part of setup was that the android app switched my wifi network from my home wifi to the chromecast acting as an access point for setup until it itself could connect to the home network.


Operating the device could hardly be more intuitive. Clicking the icon on any supported app allows you to transfer the content to that device. I watched a few netflix shows, and it worked well. My only complaint, which is probably more or less unavoidable, is that there is a good lag between doing something like changing volume, or pressing pause and the chromecast actually responding to your request.

Something else that I disliked was how content wouldn't always save its position. If I want to pause a youtube video, switch to streaming a tab, and then go back to the youtube video, the video had to start over. Obviously that's just an issue with the youtube app not saving the position.

How It Works

So how does this magical device work? Well, there's two parts to this: a sender and receiver. The receiver is literally just a webpage with some javascript to handle the API. The sender is the app that handles the content for the receiver. So, if your receiver has a place for a video, your sender tells it what video to play. Fairly easy and intuitive to actually run with. The sender just tells the device its app id, and the chromecast loads your receiver.


Currently, development is very limited. They are in the beta stages of development, and you can't develop for a device unless it's been whitelisted. I'm still waiting on my device to be whitelisted for development.


One security concern I have is that any device on the network can access your chromecast if they want to. I would love it if the chromecast had a password to be able to access it, but would then whitelist those devices' mac address or some uuid for the device. Either way, I'd like it to be a little more secure on public networks.


Overall, I like the device. Should you go out right now and buy one? Probably. I feel like this technology should be worth more than $35, and the price might go up once people get their hands on the official SDK.