After setting up a Raspi with Recalbox to have a first foot step in the Raspberry Pi world, I’m starting a IoT project of my own.
The idea is to make a little cardbord/wooden message box containing a screen printing messages when recieved (notifications, little reminders).
To make this project happen, I’ve found in Amazon:
The box should have a workday long autonomy
It should be able to read messages from the Internet : being portable, it will not be connected during the day, so it have to have some kind of sync mechanism
This will have a little camera in the lid to take pictures of the reaction when the person read the received message
It should be a interface to create messages with time-stamp so that people can send to the box messages that will be pop’d-up after the next sync
The box itself: it should be a pretty little box that doesn’t “smell techie”. It should be a friendly box, with maybe some kind of “personal assistant” in the screen saying a sweet Hello in the morning!
Being a web-developer, I will simply make a form in a web page to put the messages in it. Fields could be: “author”, “message”, “date”, so that anyone who care to the box owner should send messages to her. Sending pictures could be awesome too!
Data will then be sent to a private webpage, mounting a database for this might be a bit too much.
To sync, the box will frequently try to connect to the Internet. When connected, it will scrap data from the private webpage where JSON parsed data will wait. Once synchronized, it will send a message to the webpage saying “Hey, I’ve got what I need, you can now erase the staging messages”.
In the box:
Now that the box scraped the data, it will simply pop-up the messages when the message’s time arrives.
The lid may have a little hole in a corner. When a programmed notification arrives, the screen would turn on and show a little blinking icon (a red heart, a star, whatever) that could be seen from the lid’s hole.
The screen will arrives on Wednesday, I can’t wait for it to be there. When there, I’ll see if it would be feasible to use the Raspi GPIO inputs to plug a servo or DC motor, so that I’ll make a wooden heart rotating in the outside of the box when a notification comes. This would be sweet.
The idea is for the owner to push a “take a picture” button to save her reaction to the messages. Maybe with the message printed in the picture too. There is a Python PiCamera library making the use of the camera really, really easy!
The interface shall be made in Python to make use of the most out of the Raspi functions. I don’t know how to make a GUI in Python, next step being learning how to do that!
I’m fairly new to the Rasberry Pi world, so those are my first notes about my project. I may be wrong in some points, maybe I turnaround with stuff when there are more straight-forward ways to do it, but it is all part of the learning process 🙂
Laravel 5 is wonderful for handling errors. Creating custom error pages is easy too. You can find one default 500 error page (the one you’ll see when turning your app in maintenance with php artisan down (put it back up with php artisan up) in /ressources/views/errors/500.blade.php. Here is how to create some other ones :
TL;DR : I’ve switched from a MBP Retina 13″ to a Lenovo Yoga 900. Same price, better perfs.
Leaving the Macbook Pro for the iMac
My Macbook Pro Retina 13″ being somehow unusable for weeks now (coffee might be involved), I’ve had to buy a new machine for my development setup.
I tried the iMac 21″. This is a wonderful machine : OSX is awesome for development thanks to its Unix-like, POSIX compliant. For the cons, I might have been struggling with the exotic repositories you have to use (Homebrew, and MacPorts or Fink before it…), being used to apt-get in Debian based machines and servers I manage. But whatever troll I’m raising here, in the other side, Linux distros doesn’t have the feeling nor the perfect third-party devices integration that you’d find in commercial OSes, for obvious and completely dumb -commercial – reasons from the manufacturers.
But unfortunately, it fails on one point : no SSD built-in it. I thought this wasn’t really an issue, that I wasn’t dealing a lot with files, but I was wrong. I use Atom as my main IDE, which is usually full of 15+ files. I love working with Laravel, which also gives its share of files. To make this short: using Atom quick searches are a pain without SSD (at least, when you’re used to use them). Add to this that OSX relies a lot on swap files stored in drives for being so fluid and easy to use, switching under OSX from a SSD to a HDD is a though experience.
One could say that it is a matter of few seconds, but those are making a huge difference and makes you really think about why you’re buying your computer. Especially when you rely a lot more on software performance and cohesion before hardware capabilities.
Looking for a Device as Great as the MBP
So I was again looking for another workstation.
At first, I was passive-aggressively looking at PC laptops : why would I buy something that last, say, 2 years tops (cheers HP, Acer and so) before hardware starts being absolute mess ? I was out there looking for a Macbook Pro, of course.
It is a strange reaction since I’m not one of those Apple fanboys : I proudly use a Huawei P9 as a smartphone, a Samsung Galaxy tablet, I do love Android based products, and I really can’t deal with iOS stuff. I love good concurrency, and when it comes to computers, Apple simply offered to the market some of the best products.
I’m just one of the numerous people who’ve switched for a Mac the first time during this last decade : tired of weak machines and a weaker OS when dealing with Windows, or a not-really user friendly OS when using any Linux distribution.
Don’t get me wrong : I’m a CLI lover, I donate to Wikipedia, but Office and Gimp just doesn’t have what it takes against their commercial pairs, and once a again, I know, they simply don’t have big companies behind them. But some are buying and using a computer to feel good with it, not to use software by pity simply because those ones are free.
When Apple Mess Things Up
But I had a feeling when looking at the shelves in the store. The feeling that Apple just released one of the crappiest product it ever shown : a Macbook Pro which is less powerful than the previous, with a small touchbar for the price of a great full size tablet. Even the touchbar-less version is more expensive.
That was at this moment where I’ve thrown a glance at the concurrency.
When Windows Becomes Cool Again
The PCs. These stuffs not all shaped the same way, with a clicky touchpad, some ugly stickers in it, a body made of plastic, with colors and wierd Windows stuff inside.
And it felt good. I was looking at a whole new world of personal computing : a lot of different machines, of course a lot of them crappy in many ways, but all of them made for different peoples, different usages.
And I was back to the PC world as I have been younger. Finally looking at the hardware, the choice being way more deep than choosing between 13″ and 15″. Looking for my own personal computer that fits my needs.
Of course, the Windows part was still a problem. Until I started testing it. Windows 10 finally feels elegant, complete, responsive. In the same range of years, Windows has learned on its mistakes, unlike OSX which various releases feels like “man, go buy a iPad and an iPhone so you can use your OS at its best”. Even Edge felt right. I know, Windows catches every of my strokes but Google almost did the same with my Android devices and years of using Chrome, and so did Apple.
And anyway, for the price of a Macbook Pro that I was coming for in the beginning, I could have a i7 inside (good ol’ days), 8 Go of RAM and… 512 Go of SSD ! Which makes me completely free to run a VM with Linux in it at full speed (I can’t deal with the dual boot for now, being way too used, with the MBP, never to reboot my laptop).
Remains the problem of having a development workstation that simply works. The VM running Ubuntu is great, but still having to switch between two environments (Windows 10 and Ubuntu) once in a while feels a bit uncomfortable.
And, surprise, after digging into a few years of updates about Microsoft and Windows, I’ve discovered that Microsoft released with the Windows 10 Anniversary Update… A Bash ! Sounds like an April’s fool, but there it is : Bash On Ubuntu On Windows, in a partnership with Canonical.
I just can’t say how great it feels. Everything works fine – at least, all of my main usages : git, ssh, vim, Ubuntu apt repositories, the AMP stack, zsh… Even the famous Agnoster OhMyZsh theme.
It is really unexpected : you can finally have the great Windows 10 UX/UI with the comfort of a fully working Unix environment. There are some issues, Vagrant for example which can’t run under the Ubuntu bash because of a Virtualbox issue, but it is a least problem, Vagrant works great under Windows. You just have to have a second terminal tab opened.
iTerm2 will be missing a lot, but I’ve found a good candidate, ConEmu which does the job.
In part 2, I’ll tell you about how to setup your desktop environment under Windows 10 so that you feel just like home.
One frustrating issue that I encounter every time I setup an OSX machine for development is that the very useful Ctrl+Maj+Down (and Ctrl+Maj+Up) keybinding to select multiple lines in Atom or Sublime Text doesn’t work out of the box.
This is because OSX already uses this shortcut for its Mission Control app.
Go to Settings > Keyboard > Shortcuts > Mission Control ;
Unselect the shortcuts (or bind another keystroke if you need the functions). Ctrl is the little ^ icon.
And there you go, open up Atom or Sublime Text and it should be working.