Wifi enabled mailbox.

Yeah, I built one!


So I’ve been toying around with the ESP8266 wifi chip, and I also hate walking outside to check if the mail has arrived in my mailbox, also this one is old and does not look very nice.

Solution to this partly artificial problem?
Use a ESP8266 to connect to my wifi every time the mailbox is opened, get a php page that downloads sends an email to me with the exact time the mailbox was opened.




I ran into a few snags, battery wise I want it to last forever, and ever. So decided to make the ESP turn itself off, that turned out harder then I thought and I had to get both additional hardware and also help.

First things first though, the ESP8266 is running Arduino, so I thought that buying a https://www.sparkfun.com/products/8904 I could get the esp to tell the pushbutton power switch to turn itself off.  And that worked to a degree. The boot time of EPS was to long and the pin had to be did not have time to change to a correct value so it immediately shut down. It’s a latching thing. That is when I got help, Jesper told me that I could make a ramp with a resistor and a capacitor and then he helped me calculate the values.
Long story short, I thought it would work, it didn’t, then I got help, and then it worked again.


Was the way to my “no dry run utopia” without fail? No. It was actually full of fail. First I made a new mailbox with the kids, in wood. And I used BTLE to communicate from the mailbox. The wooden mailbox did not turn out as stylish as I hoped it would, so I bought the red metal one. BTLE did not reach the house, so that was also useless. Anyways onwards to the pretty pictures and actual code.




And then transferred to vero board and inside the new mailbox




Arduino code:

#include <ESP8266WiFi.h> 
 const char* ssid = "LarsbyFiber";
 const char* password = "***********"; 
 const char* host = "www.maskelot.se"; 
 int outpin = 0; 
 void setup() {
 pinMode(outpin, OUTPUT);
 //Set digital pin 7 LOW. HIGH turns off the Pololu Pushbutton Power Switch
 // We start by connecting to a WiFi network 
 Serial.print("Connecting to ");
 WiFi.begin(ssid, password); 
 while (WiFi.status() != WL_CONNECTED) {
 Serial.println("WiFi connected");
 Serial.println("IP address: ");
 Serial.print("connecting to ");
 // Use WiFiClient class to create TCP connections
 WiFiClient client;
 const int httpPort = 80;
 if (!client.connect(host, httpPort)) {
  Serial.println("connection failed");
 // We now create a URI for the request
 String url = "/****.php";
 Serial.print("Requesting URL: ");
 // This will send the request to the server
 client.print(String("GET ") + url + " HTTP/1.1\r\n" +
 "Host: " + host + "\r\n" +
 "Connection: close\r\n\r\n");
 // Read all the lines of the reply from server and print them to Serial
 while (client.available()) {
 String line = client.readStringUntil('\r');

 Serial.println("closing connection");
 //Turning off
 Serial.println("Turning off.");
void loop() {
 //lol no!

PHP Code:


 $tz = 'Europe/Stockholm';
 $timestamp = time();
 $dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string
 $dt->setTimestamp($timestamp); //adjust the object to correct timestamp

 $admin_email = "johan.larsby@maskelot.se";
 $email = "redbox@maskelot.se";
 $subject = "redbox opened at: " . $dt->format('d.m.Y, H:i:s');
 $comment = "";

 echo $admin_email;
 echo "<br>";
 echo $subject;
 echo "<br>";
 echo $email;
 echo "<br>";

 mail($admin_email, $subject, $comment, "From:" . $email);

 echo print_r(error_get_last());


As an end I want to show you the wooden mailbox that we ended up converting to a very hipsterish backpack rather then using as a new mailbox. it’s available since I have all the backpacks I can use (holds a macbook pro 15″)


ESP8266 Prankster

ESP8266, it’s probably the future of IOT. When I first saw it I thought about my mailbox (will be a later blogpost) and something that makes fun and irritating WiFi networks. When finally the ESP8266 arduino port arrived I made a little program that makes new AP’s some with names from a list, and some from existing networks, where the program adds open, free or sucks to an AP it finds when scanning.

In the end it sports a 5vto3.3 step down converter I had from another project, the ESP8266 and some cables.

Tomorrow I’m going to deploy it somewhere.


IMG_20150430_180816 (1)

Programming the ESP.


Testing with a step down power converter


Final prankster, ready to be hidden somewhere


#include "ESP8266WiFi.h"

String names[] = {
  "affischering förbjuden",
  "ektoplasma? nä snor!",
  "enarmad, men ambidextriös",
  "arla förmiddag",
  "bestefar kan inte simma",
  "bortklemad pågatös",
  "tösapåg med råg",
  "debil gerbil",
  "dissonans med diskreptans",
  "ekolali ekolali ekolali igen, flera gånger",
  "embar spann hink",
  "eskalera Eskalera ESKALERA",
  "postmortisk exhumering",
  "omvändbar reversibel = anagram?",
  "tvehågsen beslutsofattare",
  "ligga på åga",
  "ett slags skrin",
  "didaskaleinofobisk rektor",

void setup() {


  //without this in setup it hung.

void useAMadeUpName()
  int nameNum = random(23);
  String APname = String(names[nameNum]);
  WiFi.softAP(APname.c_str(), "", 1);;

void modifyExistingApName()

  int n = WiFi.scanNetworks();
  if (n != 0)
    int randChooser = random(3);
    int randNetwork = random(n);
    if ( randChooser == 0)
      String APName = WiFi.SSID(randNetwork) + String(" SUCKS!");
      WiFi.softAP(APName.c_str(), "", 1);
    else if ( randChooser == 1)
      String APName = WiFi.SSID(randNetwork) + String(" rules!");
      WiFi.softAP(APName.c_str(), "", 1);;
    else if ( randChooser == 2)
      String APName = String("open") + WiFi.SSID(randNetwork);
      WiFi.softAP(APName.c_str(), "", 1);;

void loop() {

  int a = random(1);
  if (random(2) == 1)
  delay(random(50000) + 1000);

Leaving and starting.

Today is the last day of my six month parental leave. I’ve changed a lot of diapers, fed a lot of meals and I have had the time of my life. Getting to know my youngest daughter and also being at home when the two older kids where finished with school have been wonderful. I have had freedom and purpose at the same time and it felt great.

But today is the last day of that. Tomorrow my little girl will start going to daycare and after the ease-in period is done I must again fill my days with code and emails. But not at BlackBerry where I was when I started out on this adventure. No I will be self-employed, working with casual gaming. I will make less money (at least at first, knock on wood etc) but I will have more freedom to manage my time so I can continue to pester my kids being a dad that knows what they are doing. Being a dad that finds the weird tv-shows and watches ALL THE EPISODES with them.

Wish me luck.

Eggbot at the library.


Two of my kids are takin art-classes after school, the principal and I have a good relationship. So when she asked if I could bring some cool techno-gadget (she wanted the 3D printer) to an event at the library I agreed.

The event was a birthday-party for children book characters Pettson and Findus and there was a lot of participants. I stood during 4 hours talking to kids about robots, and how they could do cool stuff. Like paint on eggs for the pancake – cake the eggs that we had the eggbot paint would become. I had them draw something in Inkscape and then they watched (in awe) when the robot painted on the egg what they just painted on the computer.

One cool thing was that most of the children approaching the egg-painting robot where girls. There was a lot of eggs with hearts, suns and names.

And I was so proud of my kids that helped out in showing the other kids how to operate a mouse (not all kids know how!) and explaining how the robot worked. They where also polite with all suggestions about how easter at our house works.

There was a small article in the local paper, they did not mention a tenth of what happened though (I’m a little bitter)

Delayed start of wash

I think about usability and features a lot, or rather, I think about how to make things better. Features and usability just sort of follows there. One nut I have not been able to crack is my new dishwashers delayed start feature.

That’s right, you can tell the dishwasher to wait for 3,6,9 or 12 hours before it starts it’s washing cycle.

Now who would find this useful?
* Someone that wants to wake up to the nice smell of newly dished cups?
* Someone that wants to load the machine and have it running when not at home? But then, why not just start the machine and step outside? Or just press the “go” button when walking out the door?
* Someone that wants to get warm plates at the exact time s/he get’s home with the takeout food?

And wouldn’t each of these use cases be solvable with a timer?

If anyone has a good idea about what this might be fore, please tell me, I just can’t crack why this is useful.

Transportation, kid by bike. And the modifications I made.


First thing to fix for parental leave is a way to transport myself and the little miss. With a budget of around 10 000 swedish krona I could get a pretty undecent car. However, there are more things to take into account then just what the cost of purchasing. With a car, there is a lot of extras. Gas and insurance just to name two. Other things I’ve been thinking about is environmental impact, and the safety when travelling.

So I went looking for a bike. First I thought about getting a wagon that you attach to the back of your bike, but after looking at other parents transporting their kid like that I thought it looked to insecure and bumpy. And I could not look to see how she was doing while pedalling, not safe at least.

I tried a Christiania bike a while back, the three wheel model. I did not really care for that construction, The microadjusments you make while leaning was impossible, and it was heavy.

Then I found the dutch model, with two wheels. Found a seller close to where I live and went to try it. It was very easy to ride. To bad he only had the electrically assisted version to sell. Long story short, I got one with electrical assist.

After a pretty terrified transportation home via train I am so happy with it. The two older kids live to ride in it and 11year old have driven me around in it.

But to modifications.

* Back mirror: I added a mirror so I can watch traffic trying to pass me.
* Car seat. 7 months is to young to be in the box, and a bike chair is not good enough either. Her neck would get super tired. So I attached a second hand car-seat. And she is facing me so I can see if she is sleeping or if she is bored. I used the straps that came with the seat and baggage fasteners for the other part. I screwed a strip of wood for the chair to lean on and it worked great.
* Sun-block: Just added a bit of sleeping mat as sun blocker.


Why I don’t have a CV anymore.

Picture by https://www.flickr.com/photos/slgc/

I don’t have a CV anymore.

I stopped several years ago when I joined TAT, mostly because I had a job I liked and did not feel like hunting for a new one, and a little because it takes time to maintain it. And whenI’ve been approached by external agencies wanting to win me over to “the new next big super thing, that I’m totally the correct person for”. Either by recommendation or LinkedIn or this here blog I have refused to provide a CV. I have several reasons for this, and I will list them here in an unordered list, hoping to get more to stop having CV’s and maybe spark some sort of discussion about this. So far every one of my colleagues and friends I’ve talked to have been agreeing with me.

  • The information is already on LinkedIn. I have spent some time to add a lot of information to my profile over at LinkedIn, it contains everything a CV contains anyway.
  • CV’s are old school. Again, why would you want something that’s already available at LinkedIn?
  • Un polite 1. When the second question you get is “can I have your CV” what you really are saying to me is “give me a list of what you have done, I’m not really interested in listening to what you want to do now”. What the second question should be is “What do you want to do?” or “This is how I think you will fit with us.
  • Un polite 2. When a conversation starts with “Can I have your CV” it signals a lot of trust-issues.
  • Bad experiences 1. I met a recruiter once, he talked and talked about what he could do for me, selling it as it was the best thing without any concrete stuff. I answered a lot of questions but it was not until he heard about a technology I worked with 7 years ago that he made a connection to where he wanted me to start. LOL, I had begun that sentence with “I never want to do blah blah blah again”.
  • Bad experience 2. One place where I was working we where told to update our CV’s and send them in, real urgent. Two days after the deadlines there where massive layoffs of those that did not have the correct buzzwords in their CV’s.
  • Bad experience 3. Technology is hard, there are a gazillion technologies and everything is fluid. I understand that it is hard for someone that not works hands on with the technology that it is hard to keep up and understand. But using simple word matching is still not acceptable. Not if you are recruiting techie talent.
  • Being a cog. A CV is begging to be put into a big machine that looks for keywords and you will be nothing more then a cog in that machine. I don not want to be that.
  • Changeable. When I was working as a consultant, my managers usually took my CV and “polished” it, I did not think that was strange at the time, but now I really do. If I write who I am, what I have done, why would that not be awesome enough in it’s own right? If I need to add lipstick and gloss different to wherever I send it, it’s probably not good enough or representative enough of me. So getting a CV should actually scare an employer rather then make them happy.


So what do I have instead?

  • I have a LinkedIn, where I provide a lot of the information available in the traditional CV form. It however is static in the sense that I don’t make a special tailored version for anyone.
  • I have my blog, where I post a lot of the things I do with my spare time.

Will I ever make a CV again? I’m not saying that I never ever will make a CV or provide information that way, but the circumstances and the time points against it.