Monthly Archives: March, 2016

Apple iPad Pro After Three Months

Now that I’ve had the iPad Pro for about three months, a friend pointed out it’s time for an update to my initial impressions blog post from back in November.

Spoiler: It is great, happy with my purchase!

I still really appreciate the larger screen. For things like PDF documents, technical books, and graphic novels it is dramatically better than the normal full-sized iPad.

And multi-tasking with two apps open on the screen has been a nice productivity advantage in some cases. I use my iPad more for leisure and travel than actual productive work so my expectation would be that for actual work that feature would be a huge factor.

The accessories (Smart Cover and Pencil) are both quite nice In my opinion, and I discuss them a bit more later in this post.

It is certainly true for some people (those who care not about the pencil and the keyboard) that the iPad Pro is just a normal iPad with a larger screen and better speakers. But I don’t see that as a failing of the Pro – most of my use has been without those accessories, and the large screen has made a huge difference in my enjoyment of the iPad.

While I haven’t done any actual benchmarking, the Pro seems to be quite fast, especially compared to my generations-old iPad. This has made using it a pleasure as well.

Watching video has also been, as expected, better with the larger screen. When we travel, we use the iPad as our “TV” in the hotel – great to unwind by watching a show via iTunes or Netflix. So the bigger screen plus the better speakers make it wonderful for that purpose. Nice having no external wired or bluetooth speaker to mess with. And of course, it is our inflight entertainment system when we fly. 

Apple Smart Keyboard (Cover)

If you are the type of typist who can live with the minimal-travel keys on the Smart Keyboard, that is quite a nice accessory! It’s basically full-sized to allow touch-typing. Using that keyboard cover I’ve entered much more text that I would have wanted to dow with the onscreen keyboard. And that’s even taking into account the much nicer size of the onscreen keyboard that the iPad pro allows.

I was not an external keyboard guy with my previous iPads, so can’t really compare to earlier offerings. What I do like is that since it is a cover, it can be “always there” if I want it, albeit at the cost of a noticeably thicker cover. Noticeably, but not annoyingly. Still seems almost like just a cover, but with a thicker section than the normal no-keyboard cover that Apple sells.

Apple Pencil

For artists and anyone who likes doing even fairly simple drawings, the Apple Pencil is quite amazing. I have zero artistic ability, but the Apple Pencil actually tempts me to look into some classes or something that can allow me to take advantage of its capabilities. The way it replicates doing things like shading with the side of a pencil point is really amazing. If you have a shred of artistic talent, you should really spend a little time at an Apple Store playing with the Pencil.

Advertisements

Lego Mindstorms EV3 and ev3dev

So recently my Lego infatuation led, as it inevitably would, to Lego Mindstorms.

This post discusses a lot of the setup I’ve done to get the EV3 controller brick set up for development using a “normal” programming language instead of the visual one provided by Lego. That does look to be a nice way for a lot of people, especially kids, to learn to program robots. However, as a guy who has spent a very large number of years programming, visual languages like that are a bit confining. So imagine how happy I was to see that the ev3dev project has stepped in! (More about that later in this post)

So now I have a pretty functional development environment set up – time to work on some actual robotics!

Topics covered:

  1. Remote Editing
  2. RSA Key for SSH
  3. FTP Server
  4. Python 3

While some of these such as remote editing are Mac-specific, a lot of the content here is the same regardless of your host computer.

About Ev3dev

Ev3dev is an awesome replacement OS for the EV3 brick, available here: ev3edev.

I won’t duplicate a lot of detail that’s on their website, but in general, it provides an alternate OS that lets you write Mindstorms programs in a variety of languages. The one I’m using is Python. The entire project is really slick, and an impressive accomplishment.

The ev3dev build I’m using is Jessie 2015-12-30.

All of the steps here assume that it is installed and running, and a network connection has been established along with being SSHed into the brick. (All of that is covered on the ev3dev website.)

Disclaimer: I have not gone back to a clean install of ev3dev and run though the steps in this post, so while I believe I captured everything, it is certainly possible I missed something.


Enable remote editing with TextMate

This obviously assumes that you have the latest TextMate running on your Mac. Did I mention that this post is going to be Mac-centric in places?

On EV3:

$ sudo gem install rmate

On Mac:

Add this to your  ~/.ssh/config file:

Host *
RemoteForward 52698 localhost:52698

Or, when starting SSH, you can do this and not muck with the SSH config file:

$ ssh -R 52698:localhost:52698 robot@ev3dev.local


 Setup RSA key for SSH

By setting up the RSA key for my host computer, I can skip needing to enter a password every time I log in via SSH.

On the Mac:

$ scp ~/.ssh/id_rsa.pub robot@ev3dev.local:/tmp

This assumes that an RSA key has been previously generated! You can generate a key using the ssh-keygen command, which will create the private and public keys in (typically) the ~/.ssh directory. The file without the extension is the private key, and the one with the .pub extension is the public key.

This public key is the one transfered to the system you want to access, and append to its authorized_keys file.

On the EV3:

$ mkdir ~/.ssh
$ cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys

 


FTP Server

Even though I can edit files via rmate and sip them back and forth from the remote shell, it’s nice to be able to move batches of files etc. via FTP. And with something like the Transmit application as an FTP client it’s trivial to do a sync and essentially back up my EV3 home directory to my Mac.

I spent a stupid amount of time trying to get vsftpd installed and running (installation went smoothly, but running always failed with an error no matter what I tried. And I tried  a lot of things!)

So, since my goal is just to have simple FTP access,  on to plan B – use Python! I grabbed a very nice FTP package for Python here: https://pypi.python.org/pypi/pyftpdlib/

The following shows the steps I went through (you may want to update the wget line based on the current version of pyftplib). In a long-ago effort to install this library on a Beaglebone, the installer failed, so the steps below include just manually moving the library into place – didn’t want to invest a lot of time debugging that issue since manually moving it seemed to work just fine.

Install the FTP package

$ wget https://pypi.python.org/packages/source/p/pyftpdlib/pyftpdlib-1.5.0.tar.gz
$ gunzip pyftp*
$ tar -xf pyftp*.tar
$ sudo mv pyftpdlib /usr/lib/python2.7

Create the FTP Server Python program

I added a super-simple FTP server program to my home directory ~/robot.

#!/usr/bin/env python
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer

authorizer = UnixAuthorizer(rejected_users=["root"], require_valid_shell=True)

handler = FTPHandler
handler.authorizer = authorizer

handler.abstracted_fs = UnixFilesystem

address = ('', 21)
ftpd = FTPServer(address, handler)

ftpd.serve_forever()

This will allow you to log in using any account other than root. By default, the username of robot and the password maker.

Set up to start the FTP server at bootup

Add this script as /etc/init.d/ftpserver

#!/bin/sh
python /home/robot/ftpserver.py

Then make it executable and let the init system know to run it at boot up:

$ sudo chmod +x /etc/init.d/ftpserver
$ sudo update-rc.d ftpserver defaults

Python 3

Set up to use Python3 (this may not be needed with a future release of ev3dev?)

Note that Python 3 is pre-installed on the ev3dev distribution but some of the supporting libraries are not, which is what makes these steps necessary.

On EV3:

$ sudo apt-get update
$ sudo apt-get install python3-pil
$ sudo python3 -m easy_install python-ev3dev

Note that “apt-get update” may take a while…