Sunday, March 17, 2013

Pepita Board soon to be a reality

Pepita V1
A few weeks ago decided to get some experience under my belt on PCB designing. So I just decided to build a variation of the Metaboard. All began with the name, for that I turned to my wife and asked for a name. Without any hesitation she said "We shall call it Pepita", so Pepita it is then.

Pepita Goals:
1. Create a multipurpose micro-controller board with an Atmega328.
2. Cheap
3. Get the experience of PCB designing.

Pepita Challenge:
1. Make it fit on a 5cm x 5cm board. (cheapest size).

As you may see, this board will not make any revolution but for me it is a needed step.
I do not create here any tutorial, cause I just sent it out for manufacturing. Still I do not know how many mistakes I made or what could be better designed. Probably in two months or what ever it takes to get back to me I will know.
Anyhow, I post here the link of the Eagle Cad schematic and board files.

Schematic pepita.sch
Board Files pepita.brd

Hope to write something once I get the actual board and post some successful pictures of it.
If you want to build something, make up your mind and do it. No need to wait for everything to be perfect, if you keep waiting it will never get done. Like the comercial, just do it!

Here is a short video of the board after it came back from manufacturing.
There are no surface mount components, so far so good. It is working great, and I am continuing adding code and devices to it, just to expore the posibilities.




Monday, January 7, 2013

Programming for my network android (MK802)


Christmas came and with it a new nerd toy. In my case it was in the for of a Rikimagic MK802II android minipc.

Wanted to debug apps directly into the device but the device is plugged via HDMI to the TV and it would be hard for me to place a laptop near the TV just to debug a simple app. Knowing that you can use the Android Development Bridge over network by running a few shell commands, I decided to do that precisely. Instead of typing each time and being the nerd I am. Just put a few lines together to activate this via simple app click. Also to install for first time easy I uploaded the app to the market.

The app turns out to be great for my phone (Motorola Atrix 2 rooted) as well.

The link for the app is:
https://play.google.com/store/apps/details?id=com.soynerdito.adbnetworkenabler&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5zb3luZXJkaXRvLmFkYm5ldHdvcmtlbmFibGVyIl0.

Your PC should be in the same network as the device.
Steps to Develop Via Network (WIFI):
1. Download the app from the play store into the device
2. On the Device Run the app and click on Toggle once. (it enable and if it is enable it tries disable). It is not intelligent at all, so it just toggle, click it once and keep count so you know if enable or disable.
3. On the PC (get the IP from the device app) open a shell or command prompt and run
adb connect <DEVICE_IP_ADDRESS>

You should see a connection confirmation on the shell. Alfter just run your Eclipse or other environment and debug as a regular device.


I have not uploaded the code for this app still but could be if somebody want's it.Anyhow soon the code will be uploaded just to save it for future reference.

The app requires the device to be rooted and the super user app be installed. Could not make it to work without the super user (also I do not have a non rooted phone). If learn how to do un-rooted will be better, that could be an upgrade.

This post describes the commands to connect the ADB over network (from here I got the commands to run)
http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp

Tuesday, August 7, 2012

Custom firmware on my trendnet 652BRP

I have a few routers, most of them with the dd-wrt custom firmware which I love. But there is one ugly duck in the pack, my trendnet TEW-652BRP V2.1. This revision is not supported by the dd-wrt... UURRR!!!
Lucky me, I found a link of somebody that compiled the GPL version of the firmware and changed it's functionality to be in Client Mode.The firmware can be downloaded from https://sourceforge.net/projects/tew652brpv2wcl/ .



What the firmware does?
The router operating mode is changed from Access Point to a Wireless Bridge. The router now is in Client Mode. When on client mode, the router accepts up to four wired devices and link those connections to a wireless network. This now accepts up to four devices wired to it. I had just connected one, but in the web site it says up to four.

Pros:
1. The router gets to be a bridge for up to four devices

Const:
1. In order to change to be an access point you need to flash the original firmware of the device.

All this is possible for curious people and open source. If more

If you have only one router, do not use this firmware. This is only if you want to use your router now as a bridge to provide wireless connection to some wired only devices, like a DVD player, TV set, media player...


I have nothing to do with this firmware, just found it downloaded it and installed. Since I liked it decided to share my experience.


Product picture from http://www.trendnet.com/downloads/list_subcategory.asp?SUBTYPE_ID=1259#

Tuesday, July 10, 2012

Escribiendo por escribir: Semana de Pruebas

Durante estas ultimas semanas he tenido la oportunidad de utilizar nuevos softwares. Al menos nuevos para mi. Vivo constantemente buscando cosas nuevas y haciendo pruebas a ver que pasa.
Asi que el camino de la curiosidad me llevo a probar los siguientes softwares:
  1. Para hacer development me encontre con el Window Builder Pro el cual es un tool gratis que ya esta incluido en la version de Eclipse Juno. EL Window Builder Pro es hecho por google y se puede usar para facilitar la programacion de ventanas en Java. Multi-plataforma, lo use en mi maquina primaria de Ubuntu 12.04 asi como en una con Windows 7. Funciona igual asi que en tu OS favorito lo puedes intentar. Eclipse lo consigues en http://www.eclipse.org y ya esta incluido en la version Juno, asi que solo baja el Eclipse IDE for Java Developers.
  2. Para los usuarios de Linux, le recomiendo el XWindows de Cinnamon. Yo he intentado en multiples ocaciones a moverme de KDE a Gnome sin exito. Por multiples razones siempre he vuelto a KDE en total descontenteo con Gnome. Ahora descubri que existia otro XWindows llamado Cinnamon (disculpen que no lo conocia desde antes) y me ha encantado. Aun llevo par de dias con el, pero me gusta que esta simple y no interfiere con mis trabajos. Es solo una barrita abajo (como el taskbar) y puedo subir y bajar mis programas sin ningun problema. Ya veremos cuanto tiempo me dura la luna de miel.

Por ahora estos son los dos programas mas importantes que he estado usando por ahora y ya veremos como siguen portandose conmigo. Ademas de estos dos he estado usando par de cositas mas que me estan gustando con el update que se le hizo al SDK de android ya que el Google IO fue hace unas semanas.

Ya he escrito mucho para algo que no compone mucho. Si leiste hasta aqui mereces un premio. Proximamente escribire algo con mas sentido.

Saturday, April 7, 2012

Mi Experiencia con USBasploader

Como parte de mi desarrollo con Arduino y el microcontrolador Atmega328 decidi intentar probar el USBaspLoader. Si conoces el Arduino has visto que el mismo cuenta con un circuito que convierte de USB a serial TTL. En versiones anteriores se utiliza el FTI mientras que el Arduino UNO utiliza el Atmega8U2 o similar para traducir de USB a serial TTL. Ahora, la diferencia del USBaspLoader es que permite tener el Atmega328 sin tener que utilizar este convertidor sino solamente el chip y un simple circuito.
Si eres como yo, esto me parecio fantastico asi que junte algunas piezas y decidi montarlo. Y increiblemente funciona como esta documentado. Claro si lo vas a intentar asegurate de utilizar los fuses correctos, los cuales aparentemente estan en el Makefile por microcontrolador. El setting del micro que estoy utilizando los vi escritos en un blog por ahi.


El diagrama del circuito utilizado puede ser encontrado en el siguiente enlace https://metalab.at/wiki/Metaboard. 
Esto es perfecto si tienes todos los componentes exactos. Peor que pasa cuando se te terminan las resistencias exactas. Pues eso fue lo que me paso, asi que buscando por intertet. Primero el "pull-up" resistor que es de 1.5K en el diagrama del metaboard lo cambie por uno de 2.2K segun se puede ver en el diagrama de usbasp (http://www.fischl.de/usbasp/) asi que este valor si tienes 1.5K o 2.2K funciona igual (almenos asi me funciona a mi).
Las otras resistencias so las de 68ohms, estas tambien se me terminaron. Gracias al internet pude ver unos  post de alguien que mencionaba que valores entre 47 ohms y 100ohms deberian ser buenos como quiera. Entiendo que esto lo lei en el web de avr-freaks, pero no tengo el link exacto. Anyway, estas resistencias aparentan ser para controlar la resistencia asi que decidi utilizar 100ohms y para mi sorpresa funciono.
Asi que este serian valores probados en 5V y con el Usbasploader conectado a una laptop con Ubuntu.

Resistencias y valores alternos que en mi caso funcionaron
68ohms ==> 100 ohms
1.5K ohms ==> 2.2K ohms

Mi experiencia con el usbasploader es de algunas horas solamente y con los microcontroladores tampoco es mucha, asi que disculpen la falta de detalles.

Antes de quemar el bootloader en el atmega, recuerda programarle los fuses correctamente. Esta es la configuración que utilizo.

avrdude -c stk500v1 -p atmega328p -b19200 -P /dev/ttyACM0 -U lfuse:w:0xf7:m -U hfuse:w:0xdA:m -U efuse:w:0x03:m

Nota: En mi caso, he creado un procesador alterno llamado atmega328np con el ajuste del signature del chip. Esta configuración es importante ponerla en el .conf de avrdude. Claro, solo para lo que usamos chips alternos, los demas deben pueden quedarse como esta escrito..


Wednesday, March 28, 2012

Atmega 328 non p adventure


A few weeks ago I ordered a pair of Atmega328 non P version to use in my Arduino projects. Since I am curious took the challenge of changing the bootloader on the chip. Went online, read a lot of tutorials and success stories about the desired task. All seems so easy that I took on the challenge without hesitation.
Started by openning the ArduinoISP (commenting the include of the pins.h library file) and downloading to the board. Connected the chip and... "no bacon". Try and try again and no bacon. A few nights and a lot of hours latter finally got it working and my steps to success are listed bellow

Short steps.
1. Loaded a VirtualBox Windows XP machine after reading in some forums about a situation with Ubuntu 11.X where the kernel may cause the burning process to fail. (Couldn't explain but since tried everything else..)
2. Loaded the Arduino 1.0 tool set in the WinXP machine.
3. Modify the Arduino ISP baud rate to 9600 and commented the "pins" include at the beginning (will not compile with it).
4. Edited 3 files in the arduino directory tree (boards.txt and avrdude.conf and programers.txt). Change the signature of the Atmega328p chip in avrdude.conf my recommendation as I founded by someone else post. Just open the file copy all Atmega328p and change the name Atmega328p to atmega328 and change the chip signature. Also open boards.txt and copy paste the ArduinoUno settings to Arduino328UnoNonP rename the uno. To uno328. And the chip type from atmega328p to atmega328. Edit programers.txt and change the baud rate of the ArduinoISP to 9600
5. Close and open the ArduinoISP and select the new ArduinoUno328 we just created from the menu.
6. Select ArduinoISP as the programer. Put a capacitor between reset and ground. The exact value was taken from the official arduino web site. This prevents the arduino from reset. 
7. Select burn bootloader
8. Wait for it to finish, that should be all.


Files are not here since this post was from my phone. But should be updated latter with more details and files for easy reproduce.
The Ubuntu problem I had may not be an Ubuntu issue but I tried and tried till changed to a virtual machine with XP. Still I will continue trying to make it work with in Ubuntu without the virtual XP. I had a version of avrdude compiled myself with the Arduino1.0 also downloaded not installed from ubuntu repository. Maybe all my stupidity was the cause, who knows. Important thing is that it is working now like new!!

The Atmega328 non P is a possibility and can be found for less than $3 in mouser.com or in other web sites for a little more preloaded with the Arduino bootloader.

Tuesday, March 13, 2012

How to Root Motorla Atrix 2 , Ver 2.3.6

Today I am happy, cause found the link to root my motorola Atrix 2 and it WORKED!!
As a developer having a non rooted device is a pin, specially for me since I wanted to extract the database from a restricted location for debugin my app.
This method was not made by me, I just founded the link for the video and wanted to share with all.

Update: After the phone is rooted it stays rooted until I restart the phone, then it goes back to stock non rooted, (good... bad... it is your call, just saying so you know).