I’ve been running Octoprint for about a year now and it’s a great tool for making your printer smarter. A couple of days ago i stumbled across this guide https://learn.adafruit.com/3-dot-5-pitft-octoprint-rig/overview from adafruit on how to make a Octoprint rig with a touchscreen. I’ve immediately liked the idea since the MP select mini is lacking controls on the printer during a print.
I knew i didn’t want the Octoprint rig detached from the printer, so heres what i’ve come up with. The Raspberry Pi will be attached to the back of the printer with this solution (LINK) and the screen will be attached using this solution. Then a GPIO-ribbon cable will be run thru the machine connecting the Raspberry Pi to the screen. The Raspberry Pi has the GUI-version of Octoprint (Raspberry Stretch) installed and on boot it automatically loads into a script that shows the Octoprint webpage in kiosk-mode.
This 3.5″ touchscreen is mounted on the top of the printer with a GPIO-ribbon cable running to the Raspberry Pi on the back. It works really well with the TouchUI for Octoprint.
This tutorial will go in depth on how to install the software to make this work. It will not focus on the 3D-printed back part and the basics of Raspberry. There are plenty of guide for it on youtube.
To make this you will need the following parts for the MP select mini:
Plug the SD-card into the Raspberry Pi and ssh into the Raspberry. Head to Octoprint using your local ip adress and configure it. Also make sure you install the TouchUI-plugin for Octoprint.
Now it’s time to upgrade Octoprint to the GUI-version of Raspbian Stretch. It’s necessary for having the browser show Octoprint on the screen. SSH in to the Rasberry pi and Octoprint will prompt you with the command to perform the upgrade.
Step 2 – Add support for the screen.
Turn off the Raspbian Pi and screw in the screen to the 3D-printed screen holder using 4 M2 screws and nuts. Pull the GPIO-ribbon cable thru the printer and connect it to the Raspberry Pi and the screen. SSH in to the Raspberry pi and run the following code.
cd ~ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/adafruit-pitft.sh chmod +x adafruit-pitft.sh sudo ./adafruit-pitft.sh
Alright, so right now you should have a working version of Raspberry Pi and the 3.5″ screen should be showing the GUI version of Raspbian.
Step 3 – Create a python bootscript
Now it’s time to create a script that autoruns on boot and shows Octoprint in kiosk-mode.
Start by SSH into your Raspberry pi and create a new file (i prefer nano and python)
sudo nano start.py
Past the following where XXXX is the URL to your Octoprint:
import os os.system("DISPLAY=:0 sudo -u pi chromium-browser --kiosk --incognito http://XXXX &")
Save it and exit the nano-editor. Next up is to run this python script on boot:
sudo nano /etc/rc.local
And add the following:
su -l pi -c 'startx' & sleep 3; DISPLAY=:0 sudo python /home/pi/start.py &
Save it and exit the nano-editor. Reboot the Raspberry Pi.
Step 4 – Unclutter and screensaver
The last two steps is to install unclutter and removal of the screensaver. Unclutter is for removing the mouse from the GUI and giving it a more touchscreen feeling. Removal of the screensaver because it’s just annoying. I prefer to have the screen go blank rather than to show a screensaver.
sudo apt-get install unclutter
For removing the screensaver we don’t need to install anything. Now we’re going to remove the screensaver and add unclutter to run on boot.
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add @unclutter somewhere in the file and uncomment by adding a # before @xscreensaver -no-splash, i.e:
Step 5 – Done
You are now done and the Raspberry Pi should now boot up Octoprint and show the Octoprint in the screen with the TouchUI. Enjoy!
A couple of weeks ago i decided to buy a GoPro, because why not?
I have always wanted a GoPro and a tool for creating short recordings of random stuff. So i spent some time looking for the best GoPro setup out there and i think i managed to build a rather neat setup that’s not that exepensive.
Unfortunately you will need a mic adapter in order to have an external mic for the GoPro Hero 5. This adapter connects over USB-C and it will need to be connected at all time. What i did was that i superglued the adapter to the housing so that it doesn’t get in the way. Not perfect but it works.
A couple of months ago i was i discovered 3D-printing and fell in love with it instantly. After looking at _alot_ of youtube videos i finally ordered my (first) 3D-printer. Due to the lack of space in my apartment in Stockholm i needed a smal desktop printer. I found a printer called PrimaCreator P120 which is a re-branded version of the Monoprice select Mini. It’s an smal 200 dollar printer that’s just pure awesomeness.
The printer came asambled, so i pretty much bough some filament (PLA) and started printing the same day. After printing som random stuff from thingiverse i found out the pro’s and con’s of this printer.
Pro: Pre-assambled Ready to print directly BIG community (forums, wikis, facebook groups) for support
Cons: Tiny Manual bed leveling Some mods is necceary (like bed-rewiring)
For 200 dollars it’s totaly worth it. As i’m writing this blasogpost i just read about a v3 where Monoprice has adressed some of this cons. So maybe in a couple of months it’s an v3 out where all of this is fixed.
However, after been printing i started to mess around with the printer and today i’ve made some hefty modifications to the printer:
After all of theese mods this is how my printer now looks:
The mod’s i’ve done are somewhat overkill but it also has helped making this 200 dollar printer to an 500 dollar printer. The fun part is that you can easily download mods from thingiverse and print them yourselfe, like a 3D-printer that’s upgrading itselfe.
If you are looking for a new hobby i can strongly recommend 3D-printing. It’s extremly frustrating and fun. Welcome to the rabbit hole.
It’s been a while since i’ve update this post. I’ve now added some the following upgrades to the printer:
This robotic vacuum cleaner is a cheap vacuum cleaner that’s been getting a lot of attention because of it’s price and accessibility with home automation.
When I ordered the robot i wasn’t really sure what to expect but i haft to say that i’m positively surprised over how great it works. On my order from Aliexpress i choose to get the delivery from Germany which gave me a total shipping time of only three days!
This is the box it came in.
After unboxing and plugging the vacuum cleaner in – this is how it will look.
The setup was pretty painful. Since all of the documentation was in Chinese i’d had to youtube on how to set it up. But once i’ve figured out that all you needed to do was to download an app called ”XIAOMI home” it was pretty straight forward. After syncing the app and creating an account i could start the first clean.
This is the vacuum cleaner cleaning 🙂
This vacuum cleaner really does the job. It vacuums places that you normally won’t vacuum with attention, like under your bed or your sofa. However, it does not fully replace an ordinary vacuum cleaner since it wont be able to take areas where chair and tables are blocking.
After my first run i’ve got an notification saying that it had an firmware update available. And this is where it started to get a bit tricky. I’ve tried numerous times to update the firmware but for some reason it didn’t go thru. So i gave up and decided to try at a later time. The next day i had no problems updating the firmware and with that i also got the option to switch to the english voice pack (yes, the robot has a speaker and speaks to you with the commands that you give it).
After this i added the robot to my home-assistant.io setup and made a simple script making it available to start the clean with Google Home.
To summarize i’ve written some pros and cons.
Available in English (Voice, App etc)
Integrations (Home-assistant.io, Google Home thru IFTT)
Super fast delivery (3 days!)
Can pass thresholds
Requires great patience while updating the firmware and getting english as main language
Overall i can recommend this robot vacuum cleaner! Feel free to comment if you have any questions regarding this product.
1 Plexiglas sheet; 3mm thick, 94mm tall and 128mm long
You will also need to following:
Some double-sided velcro
Access to a computer
Step 1 – Assemble
Once you have gotten ahold of all the stuff you need it’s time to start making the build! I took my LCD-display and made holes in my plexiglas so i could mount the LCD on to the plexiglas. After that it’s pretty self explaining. The gamepad and the battery-pack is attached with double-sided velcro, so i easily can remove the parts, here are some images of the complete build.
Once you have flashed your SD-card with the latest version of Retropie you need to mount the SD-card to your computer and edit the file called ”config.txt” in the boot-partition. In this file you’ll need to put the following in order to make the LCD screen to work:
In the boot-partition you will also want to create a blank file called ”ssh”. The file should have no content and no extensions. This file is for enabling SSH to your Retropie.
Step 3 – Pair the controller
Plug in your USB-keyboard to your Raspberry Pi and boot it up. Once it’s fully booted click the ”RetroPie Configuration”, then go down to ”Bluetooth”.
Before making any further adjustments make sure that your IPEGA PG-9055 Controller is in the ”Android”-mode. There’s a physical switch on the left side of the controller. Once that is done, hold the ”Home”-button for 5 seconds to start the controller. There should be two blue lights flashing once the controller is on.
Back to the Retropie, first click ”Register and Connect to Bluetooth Device”. The RetroPie will now search for your controller. Once it finds it click it to register it to the RetroPie. Once you’ve clicked ”OK” you will get a second prompt, here you want to select ”NoInputNoOutput”. You should now be prompt that the pairing is done with the controller and the blue lights on your controller should be solid.
Back in the Bluetooth devices configure select ”Set up udev for Joypad (required for joypads from 8Bitdo etc)” and hit OK. Choose the PG-9055 controller again and hit OK. Then in the configure device choose ”Configure bluetooth connect mode”. Here you want to select ”background”. Hit ok. The configuration is now almost done! Hit cancel and go back to the Retropie UI. Klick ”Start” on your controller and go down to ”Quit” -> ”Restart system”.
After you reboot you might notice that the lights are off on the IPEGA controller, which is expected. Hold the Home-button for 2 second to connect it to the Raspberry Pi. We now need to configure the controller. Hit Start on your keyboard and go down to ”Configure input”. Hold A on the IPEGA controller and set it up as you want it to by hitting the buttons on your IPEGA controller.
Once done with this, you should be able to use the controller in the Retropie UI. It’s time for the final configuration for the controller! Again, go to ”RetroPie configuration” and then ”RetroArch”. Enter the menu and scroll down to ”Settings” -> ”Driver” -> ”Joypad driver”. Make sure the ”Joypad driver” is set to ”sdl2”. Then go back, twice, and hit ”Configurations”. And here you want to save the configuration. Then go back and exit RetroArch.
Step 3 – Done
You are now done! Wohoo! You can now add games to your Retropie by SSH’ing in to your device and upload them to your Raspberry Pi. I wont go in to detail on how to do this, but if you are not familiar with this then google has the answers :-).
A big shoutout to ETA PRIME for coming up with this idea. Make sure to check out his channel.
Feel free to comment below for feedback or questions.
I usually don’t blog in English but since I couldn’t find any good tutorial how to set up an raspberry pi cluster running docker swarm i thought i’ll write one based upon my experience and what i’ve stumbled upon searching for information on this. Feel free to use the comment section below with suggestions on how i can improve this tutorial.
There are 5 images, one for the controller which is the main raspberry pi and 4 images for the raspberry pi Z.
Then you’ll need to prepare and move the images you just downloaded to the SD-cards. Since I’m using a Macbook this guide will describe on how to do it on a Mac. If your’e using a windows computer then visit this page to learn how to do it.
Start by inserting the SD-cards to your Macbook. The newest Macbook don’t have an SD-card slot so you will need a dongle/adapter, but the older once do have a SD-card slot.
After mounting start the disk utility-app and format the SD-card with FAT32. The SD-card is now formatted and ready to get the image(s) on them.
Then hit up a new terminal window and do the following commands. Start by identifying the name of the SD-card by doing:
Identify the disk (not the partition) of your SD card, e.g. disk4, not disk4s1.
Unmount your SD card by using the disk identifier, to prepare it for copying data:
diskutil unmountDisk /dev/disk<disk# from diskutil
Where disk is your BSD name e.g. diskutil unmountDisk /dev/disk4
Copy the data to your SD card:
sudo dd bs=1m if=image.img of=/dev/rdisk<disk# from diskutil> conv=sync
This may take a while but to make sure everything is running and the data is being transferred to the SD-card you can hit CTRL + T to see the progress.
When the data transfer is done and the image is on the SD-card you’ll need to create a new file on your desktop called ”ssh” (just ”ssh” and nothing more”. The SD-card will probably be named ”boot” now and you’ll need to put that file (the ”ssh” file) on the SD-card. This file will enable SSH on your Raspbian Pie which will make everything a bit easier.
Repeat this process for all 5 SD-cards. Once that is done – put the SD-cards in to your Raspbian. Where the controller image/SD-card should go on the main Raspbian Pie 3 and the other SD-card (p1, p2, p3 and p4) on the other raspberry pi’s Z.
Step 4 – Start the cluster
Plug in the ethernet cable and the MicroUSB-cable in to your main raspberry pi (controller). Your controller is now online and you will be available on your local network. Next you will need to figure out what local IP address your router has assigned your Raspbian Pie controller. I’m using an app called ”inet network scanner” which scans the network and prompts the device on the network and what ip-addresses they have. There are a tons of ways of doing this.
The ip will be something like 192.168.0.X or 10.0.1.X.
Step 5 – Activate the cluster (p1, p2, p3 and p4)
Now that we know what IP our controller has we can access it by SSH. The default username for the pies are ”pi” and password is ”raspberry” Open a terminal window and enter the following:
The terminal will now prompt use asking you if you really want to connect to this device and that your fingerprint will be logged. Type yes and hit enter,
You will now be prompted to enter the password, enter ”raspberry” and you will now have access.
Since we downloaded the images from the cluster hat-project there are some already installed packages for controlling your cluster-hat:
cluster-hat on all (This will turn on your raspbian pies Z)
cluster-hat off all (This will turn off your raspbian pies Z)
So in the terminal type:
cluster-hat on all
The LED’s on your cluster hat should now be orange meaning that the full cluster is now online.
Step 6 – Configurations
There are some important configurations on all (5) of the Raspbian Pies. These are password change, expand the filesystem and updates, install fail2ban and only allow access with SSH-keys. This following steps are importing and will greatly improve the security of you cluster.
Step 6.1 – Change password
The first thing you should do is to change the ”raspberry” password since its something that default.This should be done on In the terminal type:
The terminal will now prompt you to enter the current password (”raspberry”) and then the new password twice. Please use a secure password with some capital letters and some signs like ”!” or ”#”.
Step 6.2 – Expand the filesystem
In the terminal type:
This will prompt and UI-like window where you can make some basic changes. Here you’ll need to go down to ”Advanced options” and then ”Expand filesystem”. Hit enter and then the guide will as you to do a reboot, do that.
Step 6.3 – Updates
The next step is to perform updates. First, update your system’s package list by entering the following command:
sudo apt-get update
Next, upgrade all your installed packages to their latest versions with the command:
sudo apt-get dist-upgrade
Step 6.4 – Install fail2ban
This is a service that will auto block some login attempts. No configuration is needed, just install the package with typing the following in the terminal:
sudo apt-get install fail2ban
Step 6.5 – Only allow SSH-access thru SSH-keys
This will be one of the most important security update we can do. This will only allow your local computer to access the raspberry pi’s thru SSH. This also means that you can’t login thru SSH from another computer with password.
Start by opening a new terminal on your local machine and type the following:
Step 7 – Install docker (which includes swarm-functionality)
So, finally we get to the part that most likely got you here; installing docker swarm on your Raspbian Pie cluster.
The first step is to ssh in to all of your devices, yes – all five of them. Once you have a terminal for all of them type the following in each terminal:
curl -sSL https://get.docker.com | sh
The progress of installing docker should now begin and it will probably take a while. Once that is done you will now have docker installed.
Step 8 – Build the docker swarm cluster
One we have docker installed on all of our machines we should now make a swarm. On the controller, the main Raspbian Pie, type the following in the terminal:
sudo docker swarm init --advertise-addr
Replace MANAGER-IP with the ip-number of your main raspberry pi/controller.
This will initiate the swarm and make the controller to the manager.
Then on the 5 Raspbian Pies Z type the following in their respective terminal:
This will join the the p1, p2, p3 and p4 into the swarm and slaves. Remember to change the token and the ip-number
Now you have a docker swarm cluster running, cool huh? But before we can start messing around with docker swarm we need to do one last thing in the controller terminal, type:
sudo iptables -P FORWARD ACCEPT
This will enable the cluster hat again after the installation of docker.
Step 9 – Docker swarm is now ready and ready to launch services
In this tutorial we will create a web-server. Since docker is based upon containers and services (for swarm) we can utilize this. I’ve messed around a lot of the top images on hub.docker.com but no-one of them really suited my needs, a simple web server with some custom code.
Also, since we are using raspberry pi’s we will need to use ”ARM” or ”RPI” images that optimized for raspberry pi. Not all of the images on hub.docker.com will work on your cluster. So I’ve found that creating your own image is probably the best for running a web server with some custom code.
Step 10 – Create your own docker image and repository
First of start by making an account on http://hub.docker.com. This account will enable 1 free private repository (like GitHub but not with so many functions). After you have made a new account go to https://hub.docker.com/add/repository/ and create the repository. Choose private and enter a name and a short description.
Once that I done we can start with creating our own docker image locally. This will need you to install docker locally on your computer. If you haven’t already done that you can download docker here: https://docs.docker.com/engine/installation/
Next up, we need to create a directory/folder where we keep our files for the imags. I’ve personally use documents/project/ as directory for my project, but hey choose whatever floats your boat.
So create a new folder, with the same name as your repository and go in to it. Here we will create a new folder called ”code” which we will store our code. In this folder create a file named ”index.php” and edit it to the following:
<?php echo "hello world";
Then save the file and go back to your project folder. In this folder you will need to create a new file called ”Docker-file”, no extensions. This file is necessary for the docker image building processes and specifies what images (apache and php) that are needed to create our web server. In this ”Docker-file” put the following:
COPY code/ /var/www/html/
What this does is that it’s telling Docker to include the ARM-build of sergeytykhonov/rpi-php which enables php and apache. It also tells docker that our code in the ”code”-folder should be put to the standard apache folder (/var/www/html/).
Now everything is ready and we can build our image.
In our local terminal type:
And now we are in the folder with the ”Docker-file”. Start by loggin in to docker with:
sudo docker service create --name NAME-OF-SERVICE --publish 1337:80 --with-registry-auth YOUR-DOCKER-USERNAME/REPOSITORY-NAME
You should now get an message saying that the docker service is created and that it will load the docker service in the background.
In the terminal, type the following to see status:
sudo docker service ls
This tells us that everything looks good and that our service is created. It usually takes a couple of minuets to start the service.
To check that everything is good we can type the following:
sudo docker services ps NAME-OF-SERVICE
This tells us that everything looks good and that our service is created. It usually takes a couple of minuets to start the service.
Now is an excellent time to browse social media on your smartphone while it’s preparing and running the service. After 2-3 minuets you can type:
sudo docker service ls
The replicas should now be 1/1 and the service should now be running. You can visit http://IP-TO-CONTROLLER:1337 to visit the page. This should show you the ”hello world” text.
Step 12 – Scale the service to your p1, p2, p3 and p4
Now that the service is up and running on our controller we can scale the service to our other pies (p1, p2, p3 and p4) which is done by typing the following:
sudo docker service scale NAME-OF-SERVICE=5
This will scale your service to 5, meaning that it will run 1 instance of your service on every raspberry pie (controller, p1-5).
You can track the progress by typing the following in the terminal:
sudo docker service ls
Step 13 – Update the service
So now you got the POC (proof of concept) up and running and you want to edit the code and maybe add some awesome features to your ”index.php” file or add whatever you like.
So after you have done your changes to your file(s) in the folder ”code” on your local machine, then we need to build a new image, push it to the private repository and update the service, with the new image, to our swarm.
So after you have made the changes you like, open a terminal for your local machine and type:
Nyligen anordnade Blocket bostad en reklamtävling vid namn #mäklarcupen. Tävlingen beskrivs enligt följande:
Under sommaren passar Blocket Bostad på att locka fram kreativiteten och tävlingsinstinkterna ur mäklarkedjorna och drar igång Mäklarcupen 2015 med start den 13 juli. Tävlingen går ut på att skapa den mest engagerade annonskampanjen.
HusmanHagberg, Mäklarhuset, Era, SkandiaMäklarna och Länsförsäkringar – hittills har dessa fem mäklarkedjor anmält sig till Blocket Bostads tävling Mäklarcupen där annonsmaterial bedöms utifrån bostadssäljarnas respons. Blocket Bostads analysavdelning mäter bland annat tydligheten i budskapet, liking, klick, och köpintention. Utslagstävlingen går från kvartsfinal till final. Segraren vinner hela 200 000 kr i värde att annonsera för på Blocket.
– Den här typen av tävlingar är vanliga internationellt sätt. Vi jobbar ju med framtagningar och optimeringar av olika annonslösningar så den här typen av utmaning känns väldigt naturlig att satsa på, säger Marcus Surtén, försäljningschef på Blocket Bostad.
Fram till 5 augusti kommer de tävlandes annonskampanjer synas på Blocket Bostad i formaten takeover på desktop och på olika bannerytor på mobilsajten.
– Detta är en period som är perfekt att nyttja då många potentiella säljare går i tankar kring val av mäklare inför augusti, säger Marcus Surtén.
Då har vi kikat igång en ny kampanj från SkandiaMäklarna som kan ses som en förlängning på tidigare kampanj ”Vi tar fram det bästa”. Kampanjen bygger på en tävlings i sociala medier där man under hashtaggen #vinnenmäklare kan tävla om en mäklare (mäklarvodet), styling av sin bostad och en fotografering. Med en vinstsumma på ca 100 000 kr är detta en av årets häftigaste tävlingar!
Idén är framtagen av IK Stockholm, filmerna är producerat av House of Wizard och digital strategi samt material är framtagna av inhouse av SkandiaMäklarnas marknadsavdelning.
För att sprida budskapet ”Behöver du hjälp?” och kommunicera tävlingen tog vi fram fyra karaktärer som presenterades i varsin reklamfilm. Filmerna driver med svenskar inredningsstil och har plattor i slutet som kommunicerar budskapet. Varje film har en subtil humor där karaktärerna beskriver hur deras inredningsstil är, men när det i själva verket egentligen är något helt annat.
Filmerna har fått väldigt bra spridning på Youtube och i skrivande stund har filmerna lite över 182 000 visningar.
För att sprida tävlingen och reklamfilmerna har vi köpt annonsutrymme i följande medier:
Men givetvis har vi även egna kanaler att tillgå såsom;
Banner på Hemnet
Banner på Blocket bostad
Banner på Skandiamaklarna.se
Banner på SkandiaMäklarnas objektsidor
SkandiaMäklarnas sociala medier
SkandiaMäklarnas nyhetsbrev (Kunddatabas)
SkandiaMäklarnas nyhetsbrev bostadsbrevet
Nedan kommer några skärmdumpar på det digitala materialet: