Monthly Archives: November, 2015

Lua Web Server

One of my large and ever-unfinished projects is a Home Automation system. This is designed as multiple processes where most of them are Lua script engines along with several C++ processes as well that handle low-level interfacing and infrastructure for the system.

This is all running on a RaspberryPi.

As part of this effort, I wrote a simple Lua web server to allow access to the system from a browser or a custom iOS app. Since this Lua web server might be useful to others, I am making it available as a separate component.

It is quite simple, but for serving JSON and HTML, and responding to requests (JSON or otherwise) in a low-demand system like personal home automation, it should be just fine.

Note that this depends on the Lua socket library being present.

https://github.com/donmeyer/lua-web-server

Apple iPad Pro Review

I was really looking forward to Apple announcing an iPad update this Fall. My iPad 3 was due for replacement, being heavy and slow due to the GPU being underpowered for the Retina display. Since the iPad Air 2 had been out for a year, I was waiting for its refresh/replacement model.

When Apple did not announce any new full-sized iPads, I was greatly disappointed.Sure, they announced a new iPad Mini, but I’d had a mini at one point, and missed the larger screen.

As time passed I started to give more and more thought to the iPad Pro that had been announced. Awesome screen. Great sound. Fast CPU and GPU. Huh.

The more I though about it and the way I tend to use my iPad, the more I thought maybe the Pro would work. So when ordering became available, I ordered one, and picked it up the next day at a local Apple store!

Here are my early impressions.

Size

Yeah, it’s not small. But the large screen is terrific. In the same way the mini screen felt to cramped to me, the Pro screen feels better than the “normal” iPad screen. The device is a little heavy, but coming from an iPad 3, which is pretty heavy itself, it’s not bad at all. Admittedly not something you want to spend a lot of time holding up in mid-air, but resting own a lap or a table is more common in my experience anyway. If you are coming from an iPad Air or a mini, your opinion about the added weight may differ from mine!

Performance

Great. Very fast and fluid. Haven’t done much that really taxes it (e.g. gaming) yet, but for my normal everyday tasks performance is great.

Features

Having an iPad with a Touch ID sensor is wonderful. I know this isn’t the first iPad to offer that, but it’s a new iPad feature for me!

The audio is impressive. Amazing sound from an iPad.

Split-screen multitasking. So so good. It took me less than a day to begin being annoyed by the apps that don’t support this feature yet. Being able to have two apps on the screen and active at the same time is a fundamental improvement in usability. Even though the pre-existing app switching functionality is pretty fast, not having to do it at all is a vast improvement in usability. Evernote in one pane for reference or not-taking with a browser or some other app in another pane is very cool. And by cool I mean “incredibly useful”.

Travel

I expect it to be transformative for travel. When we fly somewhere, the iPad becomes our major device for entertainment. TV shows and movies one the airplane, as well as in the hotel room.

Really looking forward to the larger screen for this purpose. And no more need for a Bluetooth speaker in the hotel. The audio from the iPad itself is plenty for watching video. And, I expect, for background music in the room.

Since the iPad Pro is treated like an iPad for purposes of airplane restrictions, it means that even though the screen is in the laptop size range we can use it during takeoffs and landings. And it can stay in my backpack through security.
I also expect the game of protecting a laptop screen from the suddenly reclined seat on the airplane to be eliminated by the iPad Pro as well. (I’ll admit I need to obtain the new keyboard cover and test this to be sure, but it seems like a reasonable conjecture.)

Combined with a hardware keyboard it should be able to eliminate the need for a laptop when traveling. I never got as much time to program when traveling as I thought I would anyway, and that’s about the only thing the iPad can’t do that the laptop can. And if the rumors of Xcode for the iPad Pro are true…

Accessories

The Apple Pencil. The Smart Keyboard. Two things I don’t have. When I pre-ordered my iPad Pro, I foolishly thought it would be the hard-to-get item and the accessories would be readily available and I could grab them once I decided how the device itself was going to work for me. Oops. I have both on order, but by the time I decided to place those orders, the deliver time was 4-5 weeks out. Sigh.

I’ve heard nothing but good about the Pencil. So even though I’m in no way an artist, I want to take a look. I do like to sketch diagrams and such, so I’m hopeful it will be useful even for me.

I’m a little more uncertain about the keyboard/cover combo. If Xcode for the iPad ever does actually appear, then OMG yes yes yes. But since I’m not a writer, or even a rabid blogger, I don’t find myself typing that much on an iPad. I suspect that multitasking (and the larger screen) might change that equation a bit for me, but up until now I was much more of a “consumer” on my iPad than a creator.
But the laptop-replacement aspect of the device seems to be related to having a well integrated keyboard, so in for a penny, in for a pound.

Bottom line is I’m looking forward to trying them both!
And if the keyboard isn’t useful for me, it would be for my wife. Who does not have an iPad Pro. But if it is as useful for me as I think it’s going to be, it would be even more useful for her. So I’m expecting/fearing we might have to become a two iPad Pro family at some point. 🙂

Summary

Wonderful screen real estate, fast, enough space for multitasking to be comfortable. I love it so far.

1802 Emulator

In a previous post I talked about the 1802 Assembler I was playing with when I revisited an ancient 1802-based FIG-Forth implementation.

Since it was a pain to get that code running on real hardware, I also threw together an emulator. This was done in Objective-C for the Mac.

Note that the core emulation code is written in ‘C’ however, so it should be quite portable.

It is fairly quick, although I have not tried to quantify it’s equivalent speed.

It will build under recent Xcode versions such as Xcode 6 or Xcode 7.

Listing files can be loaded and executed. There is application-specific code to treat some of the IO ports as serial input/output to a simple terminal facility.

This is in no way a polished final product, but it is made available on the off chance that someone else might find the code useful or interesting.

https://github.com/donmeyer/cosmac-emulator-mac