Raspberry Pi 3 Terminal Server

Every now & then, I find myself working on my network gear at home.  And like many of you, I occasionally upgrade firmware or occasionally yes, even manage to make a mistake and lock myself out now and then..  Like that time I accidentally obliterated my EX2200’s configuration with PyEZ (note – don’t use overwrite config unless you really mean it!).  Hurray for Junos features like “rollback 1”.🙂

Of course, fixing such things, or doing such upgrades is typically done via the console.  I could string a big long USB extension cable across my office that I’d have to limbo under to leave the room, or figure out something better.  Then, the Raspberry Pi 3 came out, and my lightbulb sparked.  I’d played with an old original Rpi Model B to do this a long time ago, but only wired (which makes it slightly useless when upgrading the switch it’s connected to!). Shouts out to Duane Grant for the tips on how to make it all happen back then.

The Rpi3, with its 4 USB ports, and built-in WLAN chip?  I was sold immediately, and ready to level this thing up so it would be way more useful.  Off to Amazon, where I grabbed the Canakit Rpi3 starter kit and the official Rpi3 case (neither of these are affiliate links). I had a 32GB MicroSD card laying around, so I used that.

What’s it doing now?  Well, it’s Ethernet connected, so I can reach it over the LAN in my house.  It’s also now got a WLAN it’s broadcasting, courtesy of hostapd.  It’s got 2 USB serial dongles, and can accommodate 2 more for console connections.  It’s bridging those serial connections to the network, courtesy of ser2net.  It’s also running Linux ipmasq (think SRC NAT using the outside interface to hide behind), so if you connect to the Pi’s WLAN, you can still talk to the outside world.  Then, I found tty.js, a node app.  This thing gives you a fully functional terminal on the host you’re running it from.  You see where this is heading, right?

We begin with a vanilla Raspbian install. I used the latest image, via NOOBS, based on Debian Jessie (i.e. Debian 8).  I undid all the “helpful” things that the NOOBS-Raspbian image does, like autologin to an X desktop (in the raspi-config utility), and dumped the “pi” user, adding one for me in its place.  Vanilla Linux bits so far though.

I started by setting up the WLAN AP side of things.  This was super simple.  Here’s the really nice guide I followed to get it done.  It’s also worth noting that if you use the ISC dhcp server instead of dnsmasq, you’ll want to configure the static IP for the WLAN in /etc/network/interfaces rather than the /etc/dhcpcd.conf file.  It’s all about what tools you want to employ here..

Got your WLAN on?  Great, next up – serial ports.  There’s a whole pile of USB to RS232 out there.  If you’ve got some laying around, they probably already work.  If you’re buying new ones like I did, go for something based on the Prolific PL2303 chipset.  It’s far and away the most common chipset used for this purpose.  I went with a couple of these, from Amazon (not an affiliate link). When you plug those in, they’ll self-register as /dev/ttyUSB0, /dev/ttyUSB1, and so on.  The remaining piece to bridge the serial ports to the network is ser2net, which is in the Raspbian apt repositories (apt-get install ser2net is all it takes).

Configuring ser2net is simple.  I added 2 lines to the bottom of its config and restarted the process.  Here’s the entire /etc/ser2net.conf:

BANNER:banner:\r\nser2net port \p device \d [\s] (Debian GNU/Linux)\r\n\r\n
7000:telnet:600:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT banner
7001:telnet:600:/dev/ttyUSB1:9600 8DATABITS NONE 1STOPBIT banner

So now, you can telnet to the Pi on port 7000 and get to /dev/ttyUSB0 or go to port 7001 to hit /dev/ttyUSB1.  If you’d like to further restrict this, you could change to localhost,7000 in the above to restrict connections to come from the Pi itself (i.e. so you’d have to ssh to the pi, then telnet localhost 7000).

Ok, it’s a terminal server now.  Let’s turn that up a notch and make it web accessible.  I installed the nodejs package from heroku (I was having trouble with the raspbian repo version), then did an “npm install –global tty.js”.  Configuring tty.js was a bit of a new experience for me, as I don’t really play with JSON files much.  Err.. ever.  I generated a key & cert, and here’s the config, which I stashed in /etc/default/webconsole/config.json, along with the cert and private key I’d generated:

 "https": {
 "key": "/etc/default/webconsole/key.pem",
 "cert": "/etc/default/webconsole/cert.pem"
 "port": 8000,
 "term": {
 "termName": "xterm",
 "geometry": [80, 40],
 "scrollback": 1000,
 "visualBell": false,
 "popOnBell": false,
 "cursorBlink": false,
 "screenKeys": false,
 "colors": [

I launch the app from /etc/rc.local as:

su -l jcostom -c '/usr/local/bin/tty.js -d --config /etc/default/webconsole/config.json'

Yes, I did some (very slight) customizations to the index.html and style.css in the static/ directory under the tty.js install.  Perfectly usable in its default state, but I just wanted some slight changes.

And now, what you’ve all been waiting for – what’s this thing look like?



Lunch – Smoked Wings

Lately, I’ve been after some wings.  This past Saturday, I picked up a pack of the super duper, organic, raised by Tibetan monks, lead a life of luxury type wings at Wegmans.  This morning, I went outside and lit a chimney full of charcoal, dumped that in the bottom of the smoker, and added a bit more on top.  In hindsight, I didn’t need the “bit more”.  Oh well, live & learn.  I really liked doing the wings because it required almost no attention whatsoever from me.  I lit the coals, adjusted the vents once, assembled, pulled, then ate.  My total time actively doing stuff, apart from eating, was maybe 10 minutes.

I ran the WSM without the water pan in place, dropped a chunk of hickory on top of the fully ashed over coals, and assembled the cooker.  The wings were rubbed with the Weber Kick’N Chicken rub and put in place.  I ran the smoker hot so the skin would be nice & crispy – 350F.  About an hour later, I went out and checked the wings.  They registered 163F, so I pulled them.

I sauced them with a mixture of 1/2c Frank’s Hot Wing Sauce and 1/3c wildflower honey.  I think next time, I might do less of the wing sauce.  Maybe a 50/50 split to tone down some of the heat.  They were fantastic.

First Brisket on the New Smoker

So, earlier this year, the best wife ever agreed to let me go out and get myself a smoker.  I ended up deciding on the Weber Smokey Mountain Cooker, 22.5″.  I probably would have been fine with the smaller 18.5″ one, but figured since I wanted to try my hand at brisket, I’d go for the bigger one.

So, last weekend, I gave it a go for a brisket. This first brisket run wasn’t a full brisket.  I just picked up a hunk of flat from the store.  It was 2.68 lb at the start.  I put it on at 10:30, hoping for a 15-16:00 sit down time.  Since it was small, and I was planning on going slightly hotter that usual, at 275F, I figured I was in pretty good shape time-wise.

I loaded up the cooker with some good old Kingsford Blue, and dropped in 4 chunks of pecan.  To that, I added about half a chimney of lit coals and assembled the cooker.  I ran the cooker with the water pan installed, foiled, but empty.  I had a bit of temp control difficulty, but I attribute that to me being new to using the WSM.  In the end, it wasn’t a big deal.

I wrapped when the meat hit 155F, and was able to push through the stall without difficulty.  I’d expect more difficulty with a full packer brisket stalling out.  At 14:15, I’d hit 203F, so I pulled the brisket, and wrapped it in a new layer of foil and a beach towel for an hour’s rest on the counter.  Then, we came, we sliced, we ate.  And it was good.  I even took advantage of my time waiting for it to cook and made a snazzy Excel template for tracking smokes like this.

Weekend Project: Weather Shield for iGrill v2

My wife, who is awesome by the way, got me an iGrill v2 for Christmas.  If you’re unfamiliar, it’s a probe thermometer that speaks to an app that runs on your iPhone, iPad or Android device using Bluetooth.  Like most electronics, it’s not fond of getting wet.

So, I decided to build a housing for it that would protect it from rain, allow the probes to get out, and could be attached to a post underneath our deck.  I picked up a Rubbermaid food storage container at Target.  I got the 14 cup version.

I then hit the Lowes down the road, where I got a stainless screw and washers, and a galvanized (not stainless!) metal strap.  Don’t buy a stainless strap, since you want the magnet in the back of the iGrill to stick to it.  I also grabbed a water-tight electric conduit fitting for the probe outlet.

I taped and then drilled a 1″ hole in the side of the container and installed the conduit fitting.  I lined up and drilled another hole in the back for the mounting screw.  The strap is being held in place by the screw and held steady by some silicone caulk.  You can see a little squeeze-out below.

New Years Dinner – Smoked Tri-Tip

Early this morning, Heather & I were talking about plans for today..  It was then that we realized we had absolutely nothing planned, including dinner.  Since we had planned nothing, we neglected to take anything out of the freezer to defrost.  So, I trotted off to Wegmans this morning to see what struck me.  As I perused the meat case, a pile of tri-tips were being freshly put out.  Hmm..  Tri-tip.  It’s been forever since I’ve had any, and I’ve never actually cooked it myself, though I’ve been interested in doing so. As an added bonus, this would afford me the opportunity to play around with the iGrill2 that Heather gave me for Christmas.  Have I mentioned how amazing my wife is?

So, I rubbed the tri-tip with a store-bought mix of kosher salt, coarse ground black pepper and garlic and stashed it in the fridge. Later, I loaded up the smoker box with hickory chips, got the grill going at about 225F and then loaded up the meat.  We did a reverse sear on this tri-tip.  For those who don’t know, searing first, then finishing over indirect heat makes for a less evenly cooked piece of meat than if you flip the process around.  Roast/indirect cook first, then sear second.  While we’re at it, let’s shoot the notion of “sealing in the juices” right between the eyes.  This has been debunked multiple times, just let it die, ok?  I set the iGrill’s alarm for 120F, at which point I’d pull and rest the meat.  This took almost 90 minutes to get from 40F up to 120F, at which time, I pulled the meat and chucked the tater tots in the oven for 20 minutes.  During the 10-minute rest, I cranked up all the burners on the grill to high to get everything nice & hot.  By the time the 10 minutes was up, the grill was up to 650F, and the roast went back on for a blast of heat that made a crust that would have made Dr. Maillard proud.

After a nice crust was laid upon the meat, I sliced it against the grain to maximize the tenderness, and served it with the tots and some warmed up olive oil & rosemary rolls I also picked up at Wegmans.  We have plenty of leftovers, which will probably end up as tacos in the next few days.  Future yum.

Cornbread Stuffing

So this year, we cooked a good bit of the Christmas dinner at Heather’s grandparents’ house..  It afforded them the opportunity to relax, and me the opportunity to experiment a little.  So, I finally got my chance to fry a turkey and make the stuffing.  The turkey was very good, having bought one of the foo-foo organic, free-range, went to the right schools, and lovingly attended to, right up until its beheading birds, then brined it myself before frying it up..  But this post isn’t about the fried turkey I made, which was delicious, by the way.  This post is about stuffing.

Yes, I called it stuffing, despite the fact that I never shoved it up inside an animal to cook it.  Don’t get all snippy & pedantic here, it’s just stuffing.  Very tasty stuffing, but still, just stuffing.  I also shamelessly lifted this from a recipe of Anne Burrell’s from the Food Network site, though I changed it up a bit to call it my own. The original recipe called for “spicy sausage”.  This spawned much debate between the people behind the meat counter at the market down the road.  We ended up settling on Andouille, since it offers a little spice, but not enough to knock you over.  It all melded really well in the end.

The recipe calls for 10 cups of stale cornbread.  I had no idea how much 10c of cornbread was, but happily, there was a video on the Food Network site, showing Anne Burrell and Ted Allen making the stuffing.  In it, they used 2 8×8 pans of cornbread.  To me, that’s a much more sensible measurement than “10 cups”.  But I digress.  Here we go.

  • 1 large onion, fine dice
  • 3 ribs celery, fine dice
  • 3 cloves garlic, crushed, then finely diced
  • 10 sage leaves, finely chopped
  • Leaves from 3 sprigs of rosemary, finely chopped
  • Kosher salt
  • 1 pound of Andouille sausage, removed from the casings
  • 2 cups dried cranberries (an 8 ounce package was just enough)
  • 2 8×8 pans of stale cornbread, cut into 1″ chunks (I used a mix from Krusteaz, and it turned out well).
  • 3-4 cups chicken stock (I used low-sodium, so I could add salt if it needed it)

Coat the bottom of a big sauté pan with olive oil (again, get the kind made with real virgins, alright?), and sauté the onions & celery over medium-high heat until they’re softening up.  Hit that veg with some salt and pepper to season it up.  Next, add the sausage, breaking it up into small bite-sized chunks and cook until the sausage starts to brown.  Add the garlic and keep going for another 1-2 minutes, then add the sage & rosemary, and keep cooking for another minute or two.

Get a big bowl, dump in the cornbread, cranberries and the contents of your sauté pan, along with 3 cups of the chicken stock.  Now get in there with your hands and mix it all up thoroughly.  The cornbread should be wet when you’re done.  Dump all that into 1 large or 2 small baking dishes and chuck it into a 350F oven for about 30-35 minutes.

This was one of the best stuffings I’ve ever had, and everyone loved it.  It even looks a little Christmas-ish with the red cranberries, and the piney-aroma of the rosemary.

Turkey & Chorizo Chili

So, last weekend, I christened our new 7.25 quart Le Creuset Dutch (French??) Oven by making some chili.  I scored a screaming deal on eBay for a new with tags pot at $100 under what the shops down the road are charging.

Anyhow, back to the chili.  I shameless ripped this off from Food Network, and (gasp) Rachel Ray.  Yeah, she’s annoying (EVOO! Yumm-o! Shoot me now!), but every now & then, she really gets one right.  This was very tasty and not hard to prepare at all.  The recipe calls for chorizo.  Make sure you’re buying the Mexican stuff, and not Spanish.  Spanish is more like salami, where Mexican is more like a sausage, similar in texture to Italian sausage, but with different flavors.

Lay hands on all of the following:

  • 1 tablespoon vegetable/canola/olive oil
  • 1 lb Mexican chorizo, out of the casings – If you can get loose sausage, even better.
  • 1 lb cooked turkey breast, cut into 1cm cubes – I went to the deli, got the store-roasted turkey breast cut into 1cm slices – took 3 or 4 slices to get a pound.
  • 4 cloves of garlic, chopped
  • 1 red bell pepper, seeded, ribs removed and chopped
  • 1 medium onion, chopped – I went for the Spanish yellow onion here for some sweetness
  • 1 tablespoon of ground coriander
  • 1 tablespoon of ground cumin
  • A 15oz can of diced tomatoes
  • 2 tablespoons pureed chipotle in adobo – I just dumped the whole can into the blender
  • 1.5-2 cups chicken stock (she called for 2-3 – I did 2 and needed to reduce for longer than she called for)
  • 2 tablespoons corn meal, quick-cooking polenta or even masa
  • 1 tablespoon honey

Heat up your dutch oven on the stovetop on medium-high heat, put the oil in.  Add the chorizo.  Break that stuff up and cook until it’s browned, and you’ve got that lovely orange grease in the bottom of the pot.  Add the onion, peppers and garlic and cook until they’re soft (about 3-5 minutes).  Add the rest of the ingredients and simmer it low for 45-60 minutes.

The original suggestion was to serve with lime wedges and top with Fritos.  I did the Fritos, and it was good, but I also put some shredded sharp cheddar cheese in before the Fritos.  This was absolutely delicious, and the leftovers kept nicely for about 7 days, when I ate the last bit of it.

I don’t usually do chili without beans, but after my recent surgery, I was on a slightly restricted diet (low fiber, low residue).  I’ve since been cleared for beans.  Were I to make this again, I’d probably add a small can of rinsed black beans to round it out.  But without the beans, it was delicious.  The recipe makes 4-6 servings, depending on how hungry you are.  For us, it was enough for the 4 of us (the kids didn’t eat much of it), and we had 2 mug/bowls left over.

Also, highly recommended for fall/winter soup/chili leftovers, are the Corningware mugs with lids (relax, it’s not an affiliate link, I promise). I just checked, and they’re even cheaper in Target ($7.59 at the time I wrote this).