Sending Serial Data from… Excel?

When you think about serial communications, Microsoft Excel isn’t typically the first program that springs to mind. But this spreadsheet has a rather powerful scripting language hidden away inside it, which can, with a little coding, be used to send and receive data over your serial port. The scripting language is called Visual Basic for Applications (VBA), and it has been a part of Microsoft’s Office suite since 1993. Since then, it has evolved into a powerful (if sometimes frustrating) language that offers a subset of the features from Visual Basic.

It can be a useful tool. Imagine, for instance, that you are logging data from an instrument that has a serial port (or even an emulated one over USB). With a bit of VBA, you could create a spreadsheet that talks to the instrument directly, grabbing the data and processing it as required straight into the spreadsheet. It’s a handy trick that I have used myself several times, and [Maurizio] does a nice job of explaining how the code works, and how to integrate this code into Excel.

If you’re looking for other ways to leverage this Excel feature, consider watching movies at work or building a virtual machine inside of your sheets.

Hack an Editor: Fonts for Programming

We’ve recently noticed two different fonts aimed at programmers, each with a different approach to editor customization. The first, Fira Code, transparently converts common programming digraphs into single characters. For example, <- becomes an arrow and != (or <>) becomes a proper not equal sign. The other font, Hack (can’t argue with the name), aims to make commonly confused characters distinct. For example, the zero glyph has a very distinct appearance from the letter O.

It is pretty easy to understand how Hack works, but Fira seems a mystery at first. Your C++ compiler expects <- not an arrow, right? Fonts support ligatures–sequences of two symbols that run together (like æ). Clever use of these ligatures means that the compiler still sees -> but the screen displays an arrow.

Continue reading “Hack an Editor: Fonts for Programming”

Hackaday Prize Entry: Twitter Goes To The Dogs With Raspberry Pi Hack

Dogs are remarkable creatures. Anybody who has lived with one will know that they are very vocal beasts, with barks that range from noting the presence of a squirrel in the yard to the warning whine that says “I am about to pee on your shoes if you don’t take me outside.” [Henry Conklin] decided to computerize the analysis of these noises, putting his dog [Oliver Twitch] on Twitter so he could hear what he was saying while he was at work. [Henry] that is: [Oliver] stays at home.

He did this using a Raspberry Pi, which is set to record sound above a certain volume. With the system sitting by [Oliver’s] favorite window, this records his barks. The recordings are then analyzed using PyAudioAnalysis, a library that analyzes sounds, compares them to reference ones and classifies them.  The Raspberry Pi then posts the results onto twitter using Python-twitter.

The setup used by [Oliver] to capture the barks: a USB microphone, Raspberry Pi and WiFi USB dongle.
The setup used by [Oliver] to capture the barks: a USB microphone, Raspberry Pi and WiFi USB dongle.
Or rather, it will when [Henry] fixes a few bugs: right now it just posts a random string that is based on the length of the bark, not the type. [Henry] says he is working on the dog translation at the moment. It’s still a neat project that shows you how simple it is to use a few small bits of code to gather info from your environment and share these over the Internet. [Henry] also says that the next step is creating a weekly podcast for [Oliver]. I, for one, will be subscribing to hear his thoughts on how annoying the postman is, and how vexing it is to see a squirrel and not be able to chase them.

The 2015 Hackaday Prize is sponsored by:

DEF CON: Abusing Scripts in Multiplayer Games

Everyone has at least a few games on their computer, and I would assume most of the Hackaday readership would be among the enlightened PC gamer bretheren. At this year’s DEF CON, [Tamas Szakaly] gave a talk about the data these games leak to the Internet, the data they accept from the Internet, and what you can do with that data.

[Tamas]’ talk was entirely about scripting games, like the many games that are scriptable in Lua, or Valve’s Squirrel. Developers have thought about this before and have implemented sandboxes and many anti-cheat mechanisms. However, because these sandboxes are poorly implemented, it’s easy to get outside the game and do some real damage.

[Tamas]’ first target was Crysis 2 and the CryEngine3. This game uses a Lua scripting engine and has no sandbox whatsoever. That means [Tamas] can call os.execute, and from there the entire game is over. Or it’s just begun. Either way you look at it, it’s pretty bad.

CryTek notwithstanding, [Tamas] can also use games with Lua scripting that have a real sandbox. DOTA2 has a leaky sandbox and can be used to call OS I/O routines and execute base 64 encoded executables right over the main executable.

The most impressive example of script abuse in various multiplayer games is from Garry’s Mod. This game has custom implementation of dangerous functions, restricted file IO, and a proper Lua sandbox. This was a wise decision from the developers, but the library is huge. If you create a map or mode used on a server, you can have a full HTTP proxy to the gamer’s home network. During the talk, [Tamas] used this exploit to display an image from a webcam on a Garry’s Mod server. It was on the podium right next him, but this could have been done on a server on the other side of the planet.

Continue reading “DEF CON: Abusing Scripts in Multiplayer Games”

‘The Martian’: A Landmark Change in How Sci-Fi is Written

Unless you’ve been living under a rock on Mars for the last few hundred “Sols”, you most likely have heard about the book “The Martian” by [Andy Weir]. It’s not often that we here at HAD will give a book recommendation, but there are so many cool little things going on here, that we just had to share it with you fine folks. We’re not going to give anyway any spoilers here. But be warned that the videos at the bottom do, and we would like to encourage the comments to be spoiler-free.

So why did this book catch our attention? Well, first off, it was self-published online, one chapter at a time by a really great writer. And as the people following his work grew, the author started to get more and more feedback about the story and technical details. He would then go back and make revisions to the work based on his audience suggestions/corrections. Does that remind you of something? Maybe a bit like the Open Source movement? Of course writers have worked with their audiences to help maintain continuity from one novel through each of its sequels. But this is fundamentally different, the audience becomes a creative force that can time-travel to rewrite the unfinished story’s… story.

The Second thing that grabbed our attention is that this is a book written by a fellow geek. See, [Andy] is a programmer by trade and in writing this book, rather than just making up dates and flight paths of spaceships, and he actually wrote software to do real orbital mechanics, so that the book is as accurate as possible. If you love reading technical details, while being very entertained by a great story (what Hackaday reader doesn’t?), this is the book for you.

If your hands are too busy with a soldering iron, we can also wholeheartedly suggest the audio book, as the performer does an amazing job. Or if you want, you can just wait until the movie comes out in October. We can’t guarantee Hollywood won’t screw this up, so you’d better hedge and read the book beforehand.

Thar’ be spoilers below. We’re including the movie trailer after the break, as well as a talk [Andy Weir] gave at Google where he shows the software he used while writing the book and several other spoilers and details.

Continue reading “‘The Martian’: A Landmark Change in How Sci-Fi is Written”

Amazon Echo Orders the Roku About

You can add the Roku media player to the list of devices that can be bossed about by the Amazon Echo and its built-in AI: Alexa. [Julian Hartline] has figured out how to use Amazon’s voice-controlled Echo device with a Roku media player. He did this by using the Alexa Skills Kit, the SDK that provides a programmer’s interface into the functions of the device. That allows you to add functions to the Alexa and the AWS Lambda cloud service that processes the voice commands (Amazon calls this an Alexa Skill).

Rather than have the cloud service talk directly to the Roku, though, he decided to have a local node.js server act as an intermediary. The Alexa sends the voice command to the AWS Lambda service, which processes it, sends the command to the node.js service, which finally sends the command to the Roku. It works, but it seems a little slow to respond: see the video after the break. In the example shown, Alexa actually causes the Roku to launch Netflix and input a search string for the requested show. Pretty slick!

Continue reading “Amazon Echo Orders the Roku About”

Talking, Foot-Pedal-Controlled Bench Probes for VirtualBench

Developing new products can be challenging during the debug and test phases, often you have your head down trying to probe the lead of some SOT23 transistor, and just when you get it, you scan your eyes up and find that your multimeter is measuring resistance and not voltage.

[Charles] had this issue compounded on his NI Virtual Instrument. It has an interface totally driven from a PC, which may or may not be in a convenient location to mouse around. Luckily NI just released an API for the 5 in one lab test station and [Charles] quickly whipped up a python wrapper which gives him ultimate control over the instrument.

Tying the script to a USB footpedal and adding some text-to-speech capabilities using google’s API [Charles] is easily able to switch from continuity to voltage to resistance and anything else he pleases with just the tap of a foot and listening to the measurements, making sure he never takes his eyes off the work which is risking a short.

Join us after the break for a quick video demonstration.

Continue reading “Talking, Foot-Pedal-Controlled Bench Probes for VirtualBench”