Snippets – JavaScript, Node, Git, HTTP2 and Regexps

snippets07In this Snippets, 6to5 becomes Babel, Node.js 0.12 on Pi, Git 2.3, HTTP2 explained and regular expressions from chained methods.

6to5 becomes Babel – As ES6, the next generation JavaScript, starts arriving in browsers the 6to5 transpiler, which converts ES6 code into current ES5 code so you can run your JavaScript apps on old and new browsers, has been looking to its future and changed its name to Babel to reflect its future plans. In a blog post the project explains that the transpiler’s codebase is not just useful for ES6 to ES5 conversion but to a whole range of IDEs and tools to come, so they’ve changed name and will begin opening up the API to let other projects plug into it. Smooth move.

Node.js 0.12 on a Pi – If you’re trying to build Node.js on your older Raspberry Pi, you may have problems. Not now – Thanks to Conor O’Neill who has built Node.js getting around a problem with identifying the version of ARM processor by… applying some patches from io.js. You can download the built version from his blog… which will save you many hours of build time. Comments suggest not rushing as it seems slower and you can already get a nightly release for ARM v6 for io.js.

Git 2.3 is out – The latest version of Git adds a push-to-deploy option so rather than log in to your server and git pull the latest version down, you can automatically have the server download new versions. Handy, but potential for huge blowback, use after considering the probable issues. There’s also a new trick where cloning can borrow assets from another local clone.

HTTP2 Explained – In HTTP2 Explained Daniel Stenberg is pulling together everything you need to know about HTTP2 in one living document. HTTP2 is going to be a big part of everyone’s web future, so it’s a good time to get reading.

Regexps from chains – The interesting idea from RegExpBuilder is why not use chained JavaScript functions to create regular expressions. Pro, wordier syntax explains more. Con, wordier syntax vs Regexp’s confusing compactness. Interesting idea though.

Raspberry Pi B+ gets its Grove on

grovepi2Raspberry Pi’s are great little Linux devices but they have plenty of limitations when it comes to comes to wiring up to the analog world or just behaving like a micro-controller. There’s been various attempts to weld Pi and Arduino together (I have some) like the Dexter Industries’ BrickPi that plugs you into the Lego bricosystem or their Arduberry which brings Arduino shield connectors out the top of the board.

The idea is simple in that it’s actually an Arduino-compatible micro-controller on the board with firmware which talks serial to the Raspberry Pi to take instructions on how to control the various I/O ports belonging to the controller. It’s also quite compelling, especially when you realise that later on you can put your own firmware on the micro-controller.

But wiring stuff up is a chore, especially when you are learning or teaching how to control things. Thats where I’ve found the Grove kit really handy. It’s prebuilt sensors and displays and controls and… well there’s lots… and they all connect using identical four wire cables and connectors to a standard 4 pin port. There’s shields for Arduino devices which give a load of these ports and there’s Arduino compatibles with these ports on them and you’ll even find them on Intel IoT hardware. The folks at Seeed Studio took to uniting these ideas and created the GrovePi, a board for the Pi which was based on the BrickPi concept but then put all the IO on Grove ports.

And now they are about to ship the GrovePi+ and a Grove Pi+ Starter Kit which comes with 12 Grove sensors or outputs. The GrovePi+ wiki gives more detail. The refresh works with the B, B+ and A+ models and has mounting holes to match each of them. The serial connection is more reliable and faster, there’s a hole for the camera cable to pass through and there’s better voltage level handling.

So if you’re looking for a way to make teaching internet of things things with the Raspberry Pi, the Grove Pi+ might be right up your street. Me? I already have the sensors so I’ll just be grabbing the board and hacking away.

Developer Catchup – Easier docker on Mac, versioning made hard, old school Unix on the Pi and new school packaging for Meteor

developercatchupLet’s go fly a Kitematic: There’s plenty of command line tools for Docker and command line driven ways to run it on Mac OS X. The latter’s harder because you need to run a VM and load it with an image and… well there’s boot2docker to help but… Enter Kitematic which takes the previous tools and rolls them with a neat UI and some extra neat tricks to make it a lot easier to start playing with the idea. Among those tricks are things like automatically creating an [appname].dev DNS entry so you can quickly connect to your new apps when they are up and running. If you like to run GUI tools alongside terminal sessions on your Mac, you might want to give Kitematic a go.

Versioning wars: Yes, people are arguing on the Internet and this time its over versioning. Some years back, Semantic Versioning appeared and set out some rules for when to bump the major, minor and patch numbers in a version number to embue it with some meaning. While this works for libraries where the consumer is often another program, it works less well with code to be consumed by people. The argument starts on Underscore’s Github where breaking changes as fixes were causing friction over what the version should actually be. This spilled out onto Hacker News which lead to the suggestion that “Semantic Versioning Isn’t” and back to HN where people continued to disagree. But it did get Fear-Driver Versioning (ferver) and the idea of romantic versioning a moment in the sun. From what I see, SemVer works but it does require discipline and transparency from the developers and the consumers of that code. Still… Developers eh?… because those bike sheds won’t pick what colour they are going to be by themselves.

Old School on a Pi: Want to run old school stylee? We’re talking Unix V5 here. Matt Hoskins has updated his 2005 presentation on how to do this (think PDP emulation and similar) so you can now do it all on a Raspberry Pi. Read on to learn the true old ways of Unix.

Meteor updates packaging: Meteor’s a supercool Node.js framework for building apps and its steadily approaching version 1.0. Version 0.9.0 has just been released and along side various additions, there’s now a new Isobuild packaging system because in the Twenty-Tens, no framework or language is complete without it’s own packaging system. IsoBuild does not make ISO images, by the way. The Iso is short for “isomorphic”. The devs explain that Isomorphic JavaScript is, in their model, JavaScript that runs on client or server and that there wasn’t a build system that worked with both. Isobuild lets you do that with Isopacks that deliver the right code for client or server automatically. They’ve already got 1800 Isopacks and have their eye on mobile apps too in their planning with something going on for Cordova. Watch out for it. 1.0 is not far away.

Making Catchup: The ODROID W and VU, BBB GPIO and tutorials

makingcatchupODROID-W: Hardkernel are more known for their Exynos based single board computers which pack quite a punch in a small space – enough that a meaty heatsink is needed. But their latest product eschews the Exynos chippery for a Broadcom chip, the same chip as the Raspberry Pi. The ODROID-W is apparently the result of a wearable research project which saw Hardkernel minimise the Pi design down to a wearable module. This module loses Ethernet, switches to a MicroSD slot and micro-HDMI then adds an eMMC socket, real time clock and battery booster and packs it into a tiny board. It’s rather neat and if you want more ports, there’s docking modules with or without touch TFT LCD screens. It’s one of the more interesting additions to the Pi ecosystem and I’ll have more to say about it when they arrive at Codescaling.

ODROID-VU: While looking at the Odroid-W, I noticed the Odroid-VU. This is a 1280×800 9″ multitouch display with USB and HDMI connections which seems to be joining the race for who can make the all-purpose hacker-maker portable screen.

BeagleBone Black GPIO: BeagleBone Black’s have a lot of IO capabilities and it can be a bit daunting taking it all in. So Kilobaser’s BBB GPIO tutorial is a great place to get a handle on all these pins and how to control them from Linux.

BeagleBone Black Tutorials: Another useful resource is Logicsupply’s Inspire blog where various handy articles have been appearing like this one on how to drive OLED displays fromC/C++ or making Xbee work or this one on web controlling LEDs using a smartphone.

Catchup: New Pi?, MeArm & JavaScript, Docker goes big, harder Dart, Breach

CodescalingCatchup
Hot Pi: First up, a hot rumour via Hackaday is that there’s a Raspberry B+ with 4 USB ports, no composite, a 40 pin GPIO port and other changes… is this real? We shall see, but the Pi has been aching for an update and even if this isn’t it, there’s a gap to be filled.

MeARM by JavaScript: Two of my favourite projects, the low cost MeARM robot ARM and the JavaScript running Espruino board have been brought together for a fun little remote control project for the ARM.

Big Docks: Google’s Kubernates project has drawn in a whole load of contributors. Kubernates is a cluster manager for containers. Now, [according to the announcement], IBM, Red Hat, Microsoft, Docker (and CoreOS, Mesosphere and SaltStack) have all signed up to develop various aspects of the platform. Could be interesting… it’s already interesting that Docker has at once become the centre of and just a component of bigger effort all at the same time.

Dart hardens: Dart, Google’s replacement for JavaScript and poor relative of Go in terms of adoption, is now ECMA-408. Whether getting the ECMA badge will push Dart forward or will the cross-browser-centic JavaScript community continue not bothering to look… we shall see, though Dart seems to lack the features that engender excitement and adoption so…

HTML Breached: Ever wanted an all JavaScript browser? The Breach developers did and are creating just such a thing.Node.js eventloop and wrapping the Chromium App API so that the top side of the browser is all HTML/JS. There might be some interesting code to come from it but its still early days.

Bigger BeagleBone Blacks and Thoughts on Raspberry Pi’s Module

The Embest BeagleBone Black looks like it'll be appearing outside China now
The Embest BeagleBone Black looks like it’ll be appearing outside China now

Bigger BeagleBone Blacks

It’s been hard to get the BeagleBone Black(BBB); limited production capabilities have fought with some big adoption stories. If you are unfamiliar with the BBB, its a small board computer in the same size factor as the Raspberry Pi, but with eMMC storage, micro-SD slot and lots of I/O pins – what it lacks in media player cores, it makes up for in clock speed.
Thats “hard to get” nature is about to change though according to a blog post. Production is being ramped up at CircuitCo where they are also upping the storage from 2GB to 4GB which will give more breathing space to the new Debian distribution being shipped on the eMMC of BeagleBones, replacing the previous default Angstrom Linux. The upgraded boards will be referred to as Rev C BBBs. The price will likely be going up to cover the extra memory and production ramp-up but with a back-orders for 150,000 units, CircuitCo are going to be busy.

There’s also a new logo program for the BeagleBone line with Farnell/Element14 being the exclusive licensee. They don’t need to work out how to make BBBs though, for the last year their subsidiary Embest has been selling their own version but only in China. The logo program means they’ll be able to sell globally and it should see even more BeagleBone Blacks out there.

Thoughts on Raspberry Pi’s Module

You’ll have most likely seen the announcement of Raspberry Pi’s SO-DIMM sized module which incorporates the Pi’s SoC with 4GB of eMMC storage on a stick for popping into custom designed boards to provide compute power. That eMMC storage is more than just standing in for an SD card; its fast and having used devices with eMMC storage its a great upgrade.

Right now, the Foundation is pushing this as a way to bring the Pi ecosystem to the world of embedded devices. But are they missing a trick? Alongside the Compute Module is a Generic I/O board(pdf) which brings out most of the pins in a more accessible fashion. That means you can plug in HDMI, USB, two camera ports and two display connectors – not on the I/O board is the Ethernet port, implemented on the Pi as a USB device, and SD card slot.

It got me wondering though… what about a Pi Board for the module which made up for that gap, maybe even put WiFi on board. Packaged right, the Compute Module could be used with it to give an upgradable “Pi Pro”. But would you want a Pi Pro? What more would it need to make it distinctly better from the Pi.

Over in China, there’s companies who’ve already decided what they want in their own improved “Pi” – take the Banana Pi with a dual core AllWinner A20 CPU, gigabit Ethernet, SATA interface, IR reciever, three programmable buttons on board and all in a package the same size and layout of the Pi, including having the IO pins in the same location. Sounds super, all it lacks is one killer feature – anywhere to buy it from.

Linux 3.14, Etherpad 1.4, Pass and an RGB/LED/Pi tutorial – Snippets

snippets07
Linux 3.14 lands: And another ten week dev cycle of Linux ends with the release of Linux 3.14. There’s a new realtime scheduler (deadline), event triggers for tracing, graphics driver updates (stablised Broadwell support, NVIDIA GK110 support, dynamic power management for newer AMD hardware), new TCP autocorking for better small packet handling and the usual gamut of driver improvements, patches and enhancements. For a good list, check LWN.net‘s three part listing (1, 2, 3) (and if you are interested in Linux and don’t subscribe to LWN.net, why not?). As of writing, Kernel Newbies has yet to catch up with its pages, while German speakers can read Thorsten Leemhuis’s Die Neuerungen von Linux 3.14 which is packed full of details.

Etherpad 1.4 arrives: For Etherpad, it’s mostly lots of bugfixes and security patches, but it’s worth noting the arrival of Etherpad 1.4. The Node.js-based collaborative editor’s changelog has the details.

Pass, you may: Pass is an interesting idea – password management using a simple text file (encrypted of course) with a simple (and configurable) file storage heirachy, with simple commands to manipulate them and use them from the keyboard. Now to see if I can get the password manager I use elsewhere to export its contents in Pass format – there’s already scripts for lots of other passwords managers.

Your name in lights: A nice little tutorial from the folks at Adafruit ahows how to use a 16×32 RGB LED matrix panel, which happens to be available over at Phenoptix, with a Raspberry Pi. The matrix usually comes with instructions to use it with an Arduino due to the bit bangy nature of getting stuff onto the display so the Pi instructions offer a whole new set of opportunities for hacking. The next edition of CodeScaling might be in 16×32 format real soon now.