Sunday, November 22, 2015

Badge as USBASP verry badly explained

Make your BSides Badge into a USBASP Programmer

Step 1. Download Github repo
Important stuff is:
Flash compiled file:
MakeFile for easier flash:

Step 2: Get your badge ready
Connect your Badge into the PC usb and press the reset button.
On Linux you should see something like (with lsusb):
"...ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb"
On Windows you may need to install some drivers
If on windows 10 you may need signed driver. Use Adafruit's drivers,
On mac, you are on your own but it should just work.

Step 3: Burn firmware
If using Makefile go ahead and just type
make flash
If you want to just flash the code use avrdude straight
avrdude -c usbasp -p atmega328p -P /dev/usb/ttyUSB0 -U flash:w:main.hex

avrdude port may change with different OS. Hope this helps, latter I hope to make this more organized.

USBASP pin out to connect another board, use same pins as Arduino as ISP

Tuesday, June 2, 2015

A three months developer.... yeah right

All over the news we see reports about the need of developers and if we do not teach programming skills to youngster we might run out of
developers in the near future . I am all in to teach and encourage people to try programming. 

Becoming a developer is not for everyone, and as a society we need people in other professions as well. So showing what programming is to young is a good way to let them choose if this is the carer for them.

All is good but like always, there comes people that to my opinion are into this to only make money. Making promises to young people that in three months they can become excellent developers and land a job with a lot of money. That my friend in bull.

There is no way that you can go from zero to senior in three months, not even to beginner. There will always be people with talent that can achieve a lot in short period of times. And even those (minority) need to get some typing time, and they will because they love what they do. However the regular person will not have the born talent and require a lot of practice. It takes practice and dedication to become a good developer as everything else. Snapping together some web framework and a beautiful template  (downloaded) does not makes you an developer, and even less a good one.

All this crap about three months excellent developer is like a loose weight without diet and exercise. It does not works like that.

What would happen if a people buy into the dream of senior developer in no time? Well a lot of people asking for a lot of money to copy/paste code from web and create crappy code. The ones paying are not stupid, and when they keep spending money and not receiving good products in return will force them to look for other alternatives. What are those alternatives you may say, not other that outsourcing.

To keep my rant short. Do not buy in the idea that anyone can snap their fingers and make you a good developer with a simple programming course. To become a good developer you need some fire inside that keep you eager to learn and keep on learning. When the lights goes out you still want to  keep on going because you are in the flow of the moment. Do it because you love it, not because of the money.

It is easy to point fingers into a doctor and say they are into that only for the money and in doing so risking the life of he/her's customers. Same thing apply to IT professionals in all areas.
In conclusion practice, practice and practice is the only way. Work day and night and eventually you will get better and better. There is no substitute to good elbow grease.

Friday, November 7, 2014

ESP8266 possible breadboard interface

Probably you know what the ESP8266, if not it is a very cheap Uart to Wifi module (more info). Anyhow to the important part.
This module is 3.3V and my Arduino is 5V. There is a problem. Also the module is not "breadboard friendly".
So there are two problems that a simple interface board can fix very easy. Based on that, I have a few ideas running in my head about this. I am in the process of designing a board that I would like to build a prototype.
What this magic board do?
1. Voltage regulator, IN 5V and regulate to 3.3V with 3.3V output as well.
2. Level shifter for RX and TX signals, so you can wire it up straight to the arduino.
3. Bread board friendly header pins for easy testing.

This is a very small design to keep it cheap. As is of now it is 1 inch by 1 inch. It is not in its final stage, however I like to write about it, just in case.

pcb board


I will continue on improving the design for a bit more. However I want to try to actually build it, however build time for me is very limited now, so only time will tell how this gets done.

All eagleCad files are here. This is very early in the design process. I have started two times, and probably restart it all again.

Any idea or comment, please do. This is public domain, so you may do what ever you want with it. If you build it as is or modify it, comment about it and post pictures. There is no need to mention or link back to me.

Board modified a little bit and sent to oshpark for a prototype. Soon will know if it actually works.
Eagle files moved to a github repo of it's own here. Now the board has a name it is called WifIco (it needed a name you know).

This is the image rendered by OSHPark web site when ordered.

Bottom View Top View

This has not been tested however I decided to order it anyhow. It has a mini usb port beneath only for 5V input. Just in case I wanted to power it stand alone, who knows!
It also has two resistors visible on the bottom view, that should be soldered shut for normal use. You may solder a wire or a zero resistor, actually whatever you have. They are pull up and can be shut. I figure that since I will be receiving a few boards may find it useful to use one to update the firmware and in those cases I would need access to the pins exposed there. But for normal operations I may not. 

This design has a lot of errors in the silk screen for the board connections. It worked, but the labeling of the connections is incorrect.

Thursday, October 2, 2014

Adding .gitignore file after first repository commit

It happen to me very often to create a git repository and even push it to mu github without first creating a .gitignore file. Specially on Android projects this publishes a lot of unwanted files, like binary and temporary files. For this I found a post on stackoverflow for just that.

From all the post I read this is the one that worked for me (at least now)

I did this, however in the post is more information about it, please go to the stackoverflow link and if it work for you go ahead a plus it.
git rm --cached `git ls-files -i --exclude-from=.gitignore` 
git commit -m 'Removed all files that are in the .gitignore' 
git push origin master

If you have a better way to do this please leave a comment.

Thursday, July 17, 2014

Note to future self

Today is a regular day of July 2014 with the exception that I am writing a few lines for my future self.
These days the technology is moving very fast. Everyone has or want what is called a smart phone. The market is dominated by Apple iPhone and Google Android. In a not so close third place there is Microsoft with the windows phone.
Apart of phones home electronics is getting everyday more strong.
Just wanted to tell myself that no matter how cool technology may be there are other things more important. As am engineer we need to understand that at the other end of any software or hardware there is a person.  Is on those humans that we need to think.
When you read this,  Samsung may not have any galaxy phone but there will be people and your family will be at your side.
Keep what is worth, there is no undo checkout for missing life moments. Today I am a happy person and for sure in the future will still be.
The crime is worst every day like the economy.  We are holding up for better days to come. Always happy and together with the family.

Tuesday, July 15, 2014

Remote Alert Server is public

Just as mentioned on a previous blog post I opened the Remote Alert server code. The repository is at my github. It is a Flask app ready to be used on heroku.
Heroku may look complicated for a windows developer but if you give it a chance and try other hosting turns out that heroku is not that hard.
I like it because the code is pretty clean and without much modifications.
The code is at:

Latter on the android code will be published as well and hope to inform in a post about it.
Fork it, copy, sell, modify. Do what ever you like with the code. No need to even mention where you got it. Do as you like.

Saturday, May 24, 2014

How to send notifications from Raspberry Pi to your Android Phone (Free!)

Ever wanted to send notifications from your hardware project to your phone but didn't wanted to code it all up. Well I wanted to do the same so I created a simple app to do just that. 
A few simple steps and you will be pushing on custom messages into your phone. There is no registration required and the app has the least permissions to get the job done. There is no user information saved on the server, just the id you see on the screen and the Google registered id of the device so a message can be sent to it.

How to? 
1. Install RemoteAlert app from the android market. The app will show a big orange number on the main activity. 
2. All needed to do is to do a HTTP post with that number and you should get a message on the notification of the phone. Message may take up to a minute to arrive. There is nothing I can do to send it faster, it is just the way it is.
3. Refer to the samples bellow on how to send the HTTP Post to make it work.

Remember to replace the Id with the id from your own device!

Python sample code:
import json
import urllib2

class RemoteAlert:
    def send(self, device_id, message ):
        data = { 'message' : message }
        url = '' + device_id
        req = urllib2.Request( url )
        req.add_header('Content-Type', 'application/json')
        urllib2.urlopen(req, json.dumps(data))
        return 'OK'

ra = RemoteAlert()
dev_id = 'a32b831c-7623-4c43-99cf-b614ff54e902'

print ra.send(dev_id, 'Hellow Push Message World')

Push message sent from the shell using curl
curl -X POST -H "Content-Type: application/json" -d '{"message":"Hellow Push Message World"}'

The above curl sample you can send a notification to your phone, just replace the long id with the one from your phone and write in your message.

These two samples sends exactly the same message. There is so much that can be done to improve this and get a better solution but a friend said to me once "Forget about it, ship it" and keeping the spirit better to have something than nothing. Improvements will be latter added depending in my needs and if the community request it.

Future plans:
1. Formal documentaion
2. Sample codes for different platforms and languages
3. Make it all open source for references. The android app is pretty much the same code from the Google push notification sample and the hosting is on heroku using a free account. I do not know how long this will work if I get too many users and reach the hosting limit. However I feel pretty confident this will hold it's ground and the plan is to keep it free so anyone can have push notifications from their respective projects.

Server Source Code Posted at: