Last year, we saw quite a bit of media attention paid to blockchain startups. They raised money from the public, then most of them vanished without a trace (or product). Ethics and legality of their fundraising model aside, a few of the ideas they presented might be worth revisiting one day.
One idea in particular that I’ve struggled with is the synthesis of IoT and blockchain technology. Usually when presented with a product or technology, I can comprehend how and/or why someone would use it – in this case I understand neither, and it’s been nagging at me from some quiet but irrepressible corner of my mind.
The typical IoT networks I’ve seen collect data using cheap and low-power devices, and transmit it to a central service without more effort spent on security than needed (and sometimes much less). On the other hand, blockchains tend to be an expensive way to store data, require a fair amount of local storage and processing power to fully interact with them, and generally involve the careful use of public-private key encryption.
I can see some edge cases where it would be useful, for example securely setting the state of some large network of state machines – sort of like a more complex version of this system that controls a single LED via Ethereum smart contract.
What I believe isn’t important though, perhaps I just lack imagination – so lets build it anyway.
Continue reading “Yes, You Can Put IoT on the Blockchain using Python and the ESP8266”
Like many hackers, we love e-ink. There’s something mesmerizing and decidedly futuristic about the way the images shift around and reconstitute themselves. Like something from Harry Potter, but that you can buy on Alibaba instead of from a shop in Diagon Alley. But as anyone who’s used the technology can tell you, the low refresh rate of an e-ink screen limits its potential applications. It works great for reading books, but beyond that its struggled to find its niche in a world of cheap LCDs.
But [Zonglin Li] has recently wrapped up a project which shows that e-ink has at least one more use case: personal calendars. You can get way with only updating the screen once a day so the refresh rate won’t matter, and the rest of the time it’s going to be static anyway so you might as well enjoy the energy savings of leaving the screen off. With a Raspberry Pi behind the scenes pulling data from the Internet, it can populate the calendar with everything from your personal schedule to when your favorite podcast drops.
In practice, [Zonglin] is actually updating the display every hour as he’s included the current weather conditions on the top left of the screen, but even still, this is a perfect application for the very unique properties of e-ink displays. The display is a 7.5 inch 640×384 model from Waveshare that retails for about $50 USD, so between the display, the Raspberry Pi, and something to put it all in (here, a picture frame) this is a pretty cheap build compared to some of the large format e-ink displays out there.
The software side is written in Python 3, and [Zonglin] has documented how others can easily plug in their own information so it can pull schedule data from Google Calendar and local conditions from Open Weather Map. The MIT licensed source code is also very well organized and commented, so this could serve as an excellent base if you’re looking to create a more comprehensive e-ink home information display.
If this seems a little too pedestrian for your tastes, you could always put together an e-ink movie player, a surprisingly functional Linux terminal, or a very slick ESP8266-based name tag. If you’ve got the better part of $1K USD and don’t know what to do with it, you could even get an e-ink license plate.
The ability to execute code in parallel is crucial in a wide variety of scenarios. Concurrent programming is a key asset for web servers, producer/consumer models, batch number-crunching and pretty much any time an application is bottlenecked by a resource.
It’s sadly the case that writing quality concurrent code can be a real headache, but this article aims to demonstrate how easy it is to get started writing threaded programs in Python. Due to the large number of modules available in the standard library which are there to help out with this kind of thing, it’s often the case that simple concurrent tasks are surprisingly quick to implement.
We’ll walk through the difference between threads and processes in a Python context, before reviewing some of the different approaches you can take and what they’re best suited for.
Continue reading “Thread Carefully: An Introduction To Concurrent Python”
Though Python 3 was released in 2008, many projects are still stuck on Python 2.
It’s understandable that porting large existing codebases to a new version is a prospect which sends a shiver down many a developer’s spine. But code inevitably needs to be maintained, and so when all the shiny new features that would fix everything are in a new version, is it really worth staying rooted in the past?
We’ll take you through some of the features that Python 2 programs are missing out on, not only from 3.0 but up to the current release (3.7).
Continue reading “Stop Using Python 2: What You Need to Know About Python 3”