Categories
Hacking Hardware Gadgets

DIY MQTT smart plug with MicroPython…

I’ve been playing around with MicroPython and Home Assistant. MicroPython is a ‘bare-metal’-Python flavor that you can use to program ICs. Home Assistant is a home automation and home control software written in Python 3. It can be hosted on a Raspberry Pi. It enables you to connect a vast amount of different devices: lights, switches, sensors, locks etc.

This is a raw guide on how to make your own smart plug and connecting it to MQTT which is then connected to Home Assistant.

You will need a relay board (single relay), a NodeMCU board, a power adapter for 5V, a case, a button, some wire and a 1k resistor.

Connect the devices according to this schema (WARNING: Don’t do this if you’re not comfortable handling mains power!). Don’t forget earthing (it’s not on the diagram):
circuit diagram

Flash the MicroPython firmware to the NodeMCU board. Put the ‘relay_mqtt.py‘ file on it as main.py. That way it will be run when the device boots up. Adjust the code to connect to your network and MQTT server first.

You can download the code here.

My device looks like this:

See the Home Assistant documentation for how to integrate the MQTT part with Home Assistant.

The nice thing is: you can press the button to switch the device. The status of the device will update via MQTT and Home Assistant gets a correct status update. You can of course switch the device from within Home Assistant as well.

Happy hacking!

Categories
english OnlineLife Net Webapps

Jabber via TOR…

The torproject just released ‘Tor Messenger‘. It’s an instant messaging application that allows you to communicate via XMPP (jabber) over the Tor network. It is based on Instantbird.

It is important to know that the client will mask from where you are connecting, but it will NOT mask who you are! This is due to the fact that your alias at the jabber server was probably created beforehand. And even if you create the alias with Tor Messenger, your connections to other users make it possible to identify you.

If you want to chat REALLY

Categories
Rezepte

Butterchicken…

Butter Chicken ist eines der klassischen indischen Gerichte. Es ist nicht schwer zu kochen, kommt aber immer gut an.
Das Gericht ist glutenfrei.

Zutaten (für 4 Personen):

Categories
Rezepte

Ravioli…

Neulich habe ich Ravioli gemacht. Hier das Rezept:

Nudeln:
250g Mehl (Typ 480) oder griffig
50g Weizengries

Categories
english Howto OnlineLife Net Webapps Software

HOWTO setup your very own Jabber server…

XMPP (aka Jabber) in combination with OTR is a secure way to chat with others. There are some public servers available, but their popularity centralizes the infrastructure and leaves single points of failure. A recent example is Chaos Computer Club’s Jabber server (jabber.ccc.de) which was down for some days between Christmas and New Years 2014/2015, as a consequence of a DOS attack.

I’ve been setting up a Jabber server of my own on my Raspberry Pi. Here is how you can too:

Categories
english OnlineLife Net Webapps

Cheap and Free SSL/TLS Certificates…

I recently was pointed to a website where one can get really cheap SSL certificates (Danke Oliver).
They sell certificates, signed by GeoTrust, Comodo, RapidSSL, Thawte and Symantec. As CheapSSLSecurity is a major reseller they can offer a really low price. If you take a 3 year certificate you get as low as 5$/year.

I am aware that there is an offer for FREE SSL Certificates out there. The drawback is however, that they are free to get, but cost 25$ to be revoked.

There are also efforts on the way to make encryption free and easy to use: Let’s Encrypt is a free and automated open-source certification authority. Their plan is to offer free certificates in summer 2015.
If you can wait for this service, it should be the cheapest option. To learn more about Let’s Encrypt, watch the talk that was given at 31c3 (icon-magnet magnet link).

And of course there is CAcert. They are a community driven assurer, which I’ve been using for many years. They however did not yet manage to be included in popular web browsers. Using their certificates will likely trigger warnings with normal desktop setups. Their certificates are free and depending on your involvement they grant certificates for up to two years.

Personally I’m using CAcert for most certificates, but whenever a broader audience should be able to connect without warnings these certificates become combersome. This blog is using a Comodo certificate via cheapsslsecurity.

Update 2015-01-03 14:00: added the Let’s Encrypt video from 31c3.

Update 2015-01-16 12:30: A user comment pointed at www.cheapsslshop.com, which seems even cheaper at $3.5/year, with a new years discount code (“CMDXMAS50”). Thanks.

Update 2016-02-04 07:30: Let’s Encrypt is issuing for a few weeks now, and they just issued their 500.000th certificate today.

Categories
Hacking Hardware Gadgets

Fixing brushes of the iRobot…

I’ve been using the same old brushes for more than a year now on our “Profimaster Robot Model 2712”. They are a little misdesigned, as the brushes go under the wheels of the robot, which makes them tare.