MicroPython learns a new trick – ISP for AVRs

One of the reasons why the Arduino became so popular was the ability to program it with ease. It meant the end of big parallel programmers that would cost an arm and a leg. The latest installment of CircuitPython from [Lady Ada] and the team over at Adafruit is a library for programming AVR microcontrollers without a dedicated PC.

For the uninitiated, in-system programming or ISP for AVR controllers employ the SPI bus to write the compiled binary to the flash memory of the controller. The discount on the number of pins used itself is a benefit though getting the timings right was a bit tricky in the good old days. Most dedicated ISPs handle this nicely, though they are normally slaves to a host PC where an ‘upload’ button initiates the process.

With CircuitPython (a derivative of MicroPython), programming microcontrollers does not require going through the code-compile-flash cycle. It can be run on a number of processors, however, AVRs are not among them so this neat little library offers the next best thing. Wire-up an Atmega328P or ATmega2560 to a board like the ESP8266 that does run CircuitPython, and you can write firmware on the fly.

There is a complete tutorial on the subject thanks to [Phillip Torrone] and [Lady Ada] which includes some demo files for testing out the functionality. This opens up a lot of possibilities where OTA firmware updates for an AVR co-processor. We expect to see some keychain AVR programmers in the near future taking a hint from the ESP8266 based Two-Factor Authentication featured previously.

Two Factor Authentication with the ESP8266

Google Authenticator is a particularly popular smartphone application that can be used as a token for many two factor authentication (2FA) systems by generating a time-based one time password (referred to as TOTP). With Google Authenticator, the combination of your user name and password along with the single-use code generated by the application allows you to securely authenticate yourself in a way that would be difficult for an attacker to replicate.

That sounds great, but what if you don’t have a smartphone? That’s the situation that [Lady Ada] recently found herself in, and rather than going the easy route and buying a hardware 2FA token that’s compatible with Google Authenticator, she decided to build one herself based on the ESP8266. With the hardware and source documented on her site, the makings of an open source Google Authenticator hardware token are available for anyone who’s interested.

Generated codes can also be viewed via serial.

For the hardware, all you need is the ESP8266 and a display. Naturally [Lady Ada] uses her own particular spin on both devices which you can purchase if you want to create an identical device, but the concept will work the same on the generic hardware you’ve probably already got in the parts bin. Software wise, the code is written in CircuitPython, a derivative of MicroPython, which aims to make microcontroller development easier. If you haven’t tried MicroPython before, grab an ESP and give this a roll.

Conceptually, TOTP is relatively simple. You just need to know what time it is, and run an SHA1 hash. The time part is simple enough, as the ESP8266 can connect to the network and get the current time from NTP. The calculation of the TOTP is handled by the Python code once you’ve provided it with the “secret” pulled from the Google Authenticator application. It’s worth noting here that this means your 2FA secrets will be held in clear-text on the ESP8266’s flash, so try not to use this to secure any nuclear launch systems or anything, OK? Then again, if you ever lose it the beauty of 2-factor is you can invalidate the secret and generate a new one.

We’ve covered the ins and outs of 2FA applications before here at Hackaday if you’d like to know more about the concept, in addition to previous efforts to develop a hardware token for Google Authenticator.

Hackaday Links: May 14, 2017

Maker Faire Bay Area is next weekend, and you know what that means: we’re having a meetup on Saturday night. If you’re in the area, it’s highly recommended you attend. It’s a blinky bring-a-hack with booze. You can’t beat it. I heard the OPShark is showing up. All hail the OPShark. You’re gonna want to RSVP if you’re going k thx.

It only took twelve years, but [ladyada] finally got herself on the cover of Make.

Nvidia has the Jetson, an extremely powerful single board computer + GPU meant for machine learning, imagifying, and robotics applications. If you want to do fancy ML stuff with low power devices, I’d highly recommend you check the Jetson out. Of course, the Jetson is only the brains of any Machine Learning robot; you also need some muscle. To that end, Nvidia released the Isaac robotic simulator. It’s a simulator for standard bits of hardware like quadcopters, hovercrafts (?), robotic arms, and yes, selfie drones. What does this mean? Standardized hardware means someone is going to produce 3rd party hardware, and that’s awesome.

This is just an observation, but fidget spinners are just now hitting the mainstream. We didn’t know what they were for a year ago, and we don’t know now.

A Hebocon is a shitty robot battle. DorkbotPDX just had their first Hebocon and the results were… just about as shitty as you would expect. Since this is a shitty robot battle, a MakerBot made an appearance. This robot, SpitterBot, was designed to blow extruded filament all over its opponent. Did the MakerBot win? Yes, SpitterBot won the ‘Poorest Quality’ award.

Supplyframe, Hackaday’s parent company, hosts monthly-ish electronic get-togethers in the San Fransisco office. The focus of these meetups is to find someone cool who built something awesome and get them to talk about it. The March meetup featured [Pete Bevelacqua] who built a Vector Network Analyzer from scratch. The video is worth a watch.

Friday Hack Chat: CircuitPython with Adafruit Engineers

What the heck is CircuitPython? Get that question answered along with many more during this Friday’s Hack Chat. Three engineers from Adafruit join us as [Ladyada], [Tony DiCola], and [Scott Shawcoft] lead a CircuitPython discussion at Noon PST on 1/27/17.

CircuitPython is Adafruit’s new extension on the MicroPython codebase. It adds support for SAMD21 processors in MicroPython and reworks the API for better support across platforms and better documentation. Does this still sound like jibberish? The Python programming language has been extended to microcontrollers. CircuitPython is furthering that work and this Hack Chat is the perfect opportunity to talk with the people who are doing that work. They will also be doing a giveaway of five CircuitPlayground m0 Express boards (brand new, not yet released hardware).

Don’t miss this Hack Chat! Here’s a handy web tool to help convert Friday, January 27 at noon PST to your local time.

Here’s How to Take Part:

join-project-team-message-buttons
Buttons to join the project and enter Hack Chat

Hack Chats are live community events that take place in the Hackaday.io Hack Chat group messaging. Visit that page (make sure you are logged in) and look for the “Join this Project Button” in the upper right. Once you are part of the project, that button will change to “Team Messaging” which takes you to the Hack Chat.

You don’t have to wait for Friday, join Hack Chat whenever you like and see what the community is currently talking about.

Raspberry Pi Zero Contest Grand Prize Winners!

The Raspberry Pi Zero Contest presented by Adafruit and Hackaday came to a close last week, as the clock struck 11:59 am on Sunday, March 13, 2016. Since then our team of judges has been working to pick the top three entries. It was a hard job sorting through nearly 150 amazing creations.  In the end though, the judges were able to pick three grand prize winners. Each winner will receive a $100 gift card to The Hackaday Store.  So let’s get to the winners!

[JohSchneider] and [Markus Dieterle] both won Pi Zero boards and went on to win $100 gift certificates. [shlonkin] didn’t win a Pi Zero, but persevered and continued working on the classroom music teaching aid even without a Zero board. The top winners aren’t the only ones who are doing well. Everyone who entered has a head start on a great project for The 2016 Hackaday Prize.

I’d like to thank Hackaday’s own [Dan Maloney], [Kristina Panos], [Sophi Kravitz] and [Brian Benchoff] who joined me to judge the contest. The entire Hackaday staff is indebted to [Limor Fried] and [Phil Torrone] over at  Adafruit for coming up with 10 live videos, and providing 10 hard to find Pi Zero boards for our winners. The biggest thanks go to the entrants. If I could send a prize out to each and every one of you, I would!

Candy Dispenser Riddles You This

A while ago, someone brought in a candy machine to AdaCore. Sometime after, [Fabien-Chouteau] was challenged to make it more… fun. So he decided to make it harder to receive candy — you know, to encourage knowledge growth — and discourage overeating of tasty treats.

The dispenser itself is pretty simple. It consists of a hopper containing the candies, a motor with a worm-gear for delivering said candies, and a small IR sensor that detects when you wave your hand underneath (in order to receive those sweet sweet candies).

He decided to leave the system operating as is, and only interrupt the connection to the motor feed. That way when you wave your hand underneath, you have to answer a skill testing question before you proceed…

Continue reading “Candy Dispenser Riddles You This”

Raspberry Pi Zero Round 1 Winners!

The Raspberry Pi Zero Contest presented by Adafruit and Hackaday has been going incredibly well! We currently have 132 projects entered, and there is still time for YOU to get in on the fun! The only problem entrants have had is getting their hands on these amazing $5 computers. We’ve made that easy by giving away ten Raspberry Pi Zero boards. The following projects were well documented, well thought out projects were selected by the judges. We’ve already informed the winners through Hackaday.io, and will be shipping out the Pi Zero boards to them right away.

Please join the judges and the entire Hackaday staff in congratulating the winners of the Pi Zero boards!

If you didn’t win, all is not lost! There is still time to enter the contest. The deadline is 11:59 pm PST on March 13, 2016. You’ll be in the running for one of three $100 gift certificates to The Hackaday Store!