Tuesday
Mar172015

Coach Wayne Hoy

I have been fortunate enough to have met some truly great and influential people in my life.  People such as Oliver North, Chuck Robb, Richard and Kyle Petty, Ward Burton and Wayne Hoy.  If you are into politics, you know the first two. I had the honor to see Mr. North up close and shake his hand. Mr. Robb I met during a meeting of a handicapped persons advocate group.  Richard and Kyle Petty, of NASCAR fame, I met at a visit to Victory Junction Gang Camp and Mr. Burton, another NASCAR driver, I met at a race.

And, then, there is Coach Hoy.

This is a man who not only rose above those five gentlemen, he was, truly, a very special person who touched many lives. Now, you may not have heard of him, and that’s OK. Coach Hoy was a teacher at Douglas S. Freeman High School in Henrico County, Virginia.

Mr. Hoy, who was a coach at that High School as well as a physics teacher, was one of those rare people who, no matter what was thrown at him, manage to smile, tell a joke and make you feel good.  And, he was thrown many curve balls. 

He had diabetes that pretty much took over his body and slowly killed him. It cost him, at first, a foot and then part of a leg, much of his sight, his kidneys and put him on dialysis. Ultimately, coach paid the ultimate price.

Before all of that, however, he was a very active man.  A Mason-a clown, to be specific, he was one of the most honorable people I have ever met. He rarely, if ever, said an unkind word about anybody and whenever I needed advice, I knew exactly who to go to.  As did most people.

Because he taught, he touched many lives and people never forgot him.  I’m telling you, the man could anywhere on the planet and meet someone he taught or worked with or just knew.  ANYWHERE.  And, those people treated him with the utmost respect.  His son is very much like him in this and many other respects.

As we come up on the eighth anniversary of his death, I have thought, quite a bit, about what we lost.  The coach was my father in law but I always considered him my second dad.  I miss our talks, his jokes (and, yes, those dreadful cornball jokes too) and his advice. I could always count on him giving me sound advice.

Most of all, however, I just miss him. 

Sunday
Mar152015

PROGMEM issues with Arduino 1.6.x and how to fix them

WP_20140826_22_20_46_ProThere is a new version of the Arduino IDE out, version 1.6.1. If you do not have, you can go to the Arduino web site and grab yourself a copy.  It is much faster than the older versions.  Overall, it seems to be better in most aspects. Except for one…the new compiler breaks some of your code.

I installed it and then tried to compile Half-Byte Tiny Basic.  Expecting a clean compile, I was surprised by the errors it generated.  Upon investigation, I found that the references to PROGMEM was the cuprit. Further research revealed a fairly easy remedy, but one that was difficult to find, so I thought I’d make it easier.

Error:  variable 'message' must be const in order to be put into read-only section by means of '__attribute__((progmem))

So, this was the first error, which led to a second error that isn’t really an error (it goes away when you fix this) so I’m not going to talk about it, it is one that is safe to ignore.  Now, simply changing ‘Static’ to ‘Const’ does not actually fix the problem. No, like the error says, you need to specify the SECTION to put it in.  Look at the old way below, then check out the new way.

OLD WAY:
/***********************************************************/
// Keyword table and constants - the last character has 0x80 added to it
static unsigned char keywords[] PROGMEM = {
'L','I','S','T'+0x80,
'L','O','A','D'+0x80,
'N','E','W'+0x80,
'R','U','N'+0x80,
'S','A','V','E'+0x80,
....
'S','C','R','O','L','L'+0x80,
0
};
NEW WAY:
/***********************************************************/
// Keyword table and constants - the last character has 0x80 added to it
static unsigned char __attribute((section(".progmem.data"))) keywords[] = {
'L', 'I', 'S', 'T' + 0x80,
'L', 'O', 'A', 'D' + 0x80,
'N', 'E', 'W' + 0x80,
'R', 'U', 'N' + 0x80,
'S', 'A', 'V', 'E' + 0x80,
...
'S','C','R','O','L','L'+0x80,
0
};

Fixing this killed the second error that was showing up.  BUT…

ANOTHER error (third overall) reared its head:

Error: <variable> causes a section type conflict with <section>

Specifying the attribute did the trick, simply using PROGMEM causes issues. While the original error went away (along with that secondary error), the section type error appeared.  This one, though, was simple. I was stuffing two TYPES into the same section and that is a no-no in the new world.  Just adding the code below AND specifying a different section of PROGMEM did the trick. This way allows you to segment your data as well.

// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734
‪#‎ifdef‬ PROGMEM
‪#‎undef‬ PROGMEM
‪#‎define‬ PROGMEM __attribute__((section(".progmem.vars")))
‪#‎endif‬

Once I made these changes, my code compiled and uploaded just fine.  I hope this saves you some time.

Sunday
Mar152015

PS/2 Keyboard and Video Out support for Arduino UNO and compatibles (and the Half-Byte Console)

While this information is readily available on the Internet, I have, nonetheless, received requests on how to do this. The most recent was from Dave in the form of a question on a post about Tiny Basic.  So, I thought I’d write a post-with pictures-on how to connect these things to your UNO or compatible.

PS/2 Keyboard

Connecting the keyboard was a challenge for as I have dsylexia. See! Anyway, I had the hardest time figuring out how to wire up a PS/2 keyboard connector, but, I did and here’s how you can too!

WP_20150315_00_11_58_ProPINOUTS
  • Pin 1 to Pin 5 on chip (ATMEGA 328)
  • Pin 2 to GND
  • Pin 3 to Pin 4 on chip (ATMEGA 328)
  • Pin 5 to +5

Click on the image to see the PS/2 Keyboard connector from the BOTTOM. Pin 1 is on the right, pin 2 above it, pin 3 to the left, pin 4 to the left, pin 5 to the left and pin 6 to the left and down.

VIDEO

Video and mono audio can also be achieved.  Video is generated by soldering two resistors together on one end and then connecting the other ends to different pins on the chip.  Audio imagecomes directly from pin 11 on the 328 chip. Refer to the diagram.  For UNO and compatibles, you will need a 1k Ohm resistor connected to pin 9 for the sync signal and a 470 ohm resistor connected to pin 7 for the video itself. Software controls the actual generation of the signal.  The other ends of the resistors should be soldered together and form the composite video and goes to the center pin of the video connector. The other (or outer) pin of the video connector goes to ground. 

AUDIO

Audio is also generated by software and consists of Atari Pong style beeps.  Connect the center pin of the audio connector to pin 11 of the chip and the ground to the outer shell or other pin of the audio connector.

Libraries

You need the following libraries:

  • TVOUT (Google has announced that they are shutting down google code, so grab this while you can. I do not know where it will end up.)
Monday
Mar092015

Apple Watch, MacBook Air and Apple TV: a quick update

MacBook_PF_OP30_Svr-PRINTApple announced a few things at a press event held March 9, 2015.  Among the things they showed are new Macs and the Apple Watch.  They also announced a new $69 (US) Apple TV and HBO Now, which is exclusive to Apple for the time being.

The MacBook Air gets a major refresh with a super smooth shell.  One connector, USB-C, is all that adorns the shell of the laptop.  A new keyboard also comes with the machine.

Now, the single connector on this very nice looking laptop handles EVERYTHING, including video out and power.  What this means is that the device will need to be tethered to a $79 (US) port extender accessory.  Without this dongle, you cannot charge the device AND connect ANYTHING else to the computer.

Admittedly, I have the ‘I want it’ for the hardware, even with that rather arcane limitation. There’s no reason why a second connector could not have been added.

The Watch.AplWatch-HomeScreen-PR-PRINT_2

Yes, they showed off more of the watch. It features an 18 hour battery life, three different styles and lots of apps already to go. The base watch-you know, the one everyone will buy-will cost $350, the Apple Watch will sell for $500 and the Apple Watch Edition will START at $10,000. The Sport edition, at $350, is the most affordable. Bands for the watches range from $40 to $500. 

Now, smartwatches are worth having, they can be very useful…but, tethering them to a smartphone seems a bit silly, and I say that in regard to the Android watches as well as the Apple Watch.  What we need is one that works with ANY device, Android, IOS or other. 

AplWatch-3Up-Features-PR-PRINTApple also talked about ResearchKit, a set of API’s that will be used for medical research.  This one seems a bit forced and not overly interesting.  You can read more about it here.  I don’t care about it enough to write more.

Perhaps the most interesting thing to come out of the press event was the HBO Now and Apple TV announcements. HBO Now will be available to Apple devices for $14.95 a month, much like cable tv prices.  Apple TV gets dropped down to $69 (US), a thirty dollar reduction. You KNOW the Roku was just killing it if Apple drops it price that much.

Over all, the press event was lackluster and the products, while interesting, could have just been released without an event and they would have done just fine. These things are just tired now.

The products, though, are not.  Apple continues to show that design over function will sell and these are no different. I’m not sure they will sell many $500 or $10000 watches, but the $350 one just might hit it. And, at $69, the Apple TV is a sweet deal.  Not quite as versatile as a Roku, but still worth the money.  Don’t forget that gorgeous, lusty laptop.  Buy it, put Windows on it and you have a really nice computer.

Go to Apple.com watch the press event.

Sunday
Mar012015

That’s no Superfish, Lenovo, its stinkyfish

For years, when you bought a new PC from the likes of Dell, HP, Lenovo and other Windows PC makers, you tended to get crapware on the computer.  These companies make a few dollars by installing this crapware that you, likely, never use.  Most of the time, all it tends to do is eat up space on the storage device and, often, can slow your computer down a bit.  Now, however, it can also break something called SSL and that’s bad.

The crapware in question is called Superfish and it came pre-loaded on consumer PC’s from Lenovo.  Now, before I go on, let me say that Lenovo, a Chinese owned company, makes excellent computers.  They made the IBM Thinkpad and desktop computers for years before buying the whole line from IBM.  The consumer grade stuff is just as well designed and built and I would have recommended them in a heartbeat.

Sadly, I can’t do that now.

Superfish is a package that injects advertising into web pages.  ANY web page, even those that did not have any ads.  And, worse, it had to break SSL encryption to do so.

I uses a root certificate that is SHARED.  That is, it is packaged with the product and distributed to any computer that gets Superfish.  It takes precedence over the SSL certs that are installed.  It is called a ‘middle man’ attack and it is bad.  What it means is that when you log into a site, say your bank, that is secure and uses SSL, this product negates that and then serves up the ads.  In doing so, it opens up your connection to snooping and your computer becomes vulnerable.

Initially, Lenovo said it was a benefit, giving its users a chance to see ‘alternative’ choices in the ads it served.  As anger grew, Lenovo’s response changed, several times, and now the company is saying that they will no longer offer up crapware.  They have been cagey about this, so time will tell if they mean it or not.

Now, the company that developed Superfish claims that the piece that breaks encryption was developed by another company, Komodio, This is troubling because this company has its hooks in well over a hundred other applications and services, including several anti-virus applications, parental control apps (just stick with the Microsoft supplied solution for this, it is great and works well) and other popular applications. 

eWeek has a  much better explanation of the problem here.

Sadly, I cannot recommend Lenovo and will even go so far as to say you should probably avoid it for now.  While the Superfish crapware can be removed, Lenovo’s response and initial attitude has discredited them and, for me, it will take a long time to rebuild that trust.  Sad, really, since the hardware is great. 

And, by the way, Microsoft’s Security Essentials has been update to detect and wipe out this mess.  It thinks it is a virus.

I’d say it is right.