Netduino Plus with RelayShield as networked light switches

Picked up a fun relay shield from the seeedstudio people. My goal was to be able to control lights over the network. After grabbing some webserver code from this post, I was able to get a simple basic web server and light controller up in no time. One stumbling block I had was the MAC configuration with MFDeploy. If you don’t use the proper MAC that was assigned to the Ethernet controller you could have potential DHCP or router ARP table issues. When setting up the netduino network I was lazy and put in a bogus MAC, that caused a few hours of debugging. Once deployed and networking is configured hit the root address from the network and a simple page with links get displayed

Quick photo and diagram of the setup





Pick up the code hack around and have fun. Suggestions and comments welcome.

Building and Editing Linux Kernel in Eclipse for Android Rowboat

First off some references I used to complete this task. This was possibly the best so far
http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html
Some other references also helped Ref1, Ref2, Ref3, Ref4
I had following file system layout when dealing with TI_DevKit V2.2


After you have everything imported per directions the next big step is getting the .config setup. Follow the directions on the android rowboat site for doing a first build of the linux kernel in commandline before trying to build from eclipse. This helps generate the .config file. Some additional settings needed was PATH and Build Command


/home/adam/BeagleBoard/rowboat-prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


BeagleTouch on TI_Android_Froyo_DevKit-V2.2

Liquidware’s BeagleTouch provides a nice display device for BeagleBoard developer. They provide non android linux kernel source code to jump in right away to use it. BeagleTouch blog post by will on antipastohw. Here is some crude patches to get started with it on rowboat / TI DevKit. I have my patches located on google docs:

BeagleTouch.TI_Android_Froyo_DevKit-V2.2.config

BeagleTouch.TI_Android_Froyo_DevKit-V2.2.patch

Apply the patch accordingly and copy over the config into the kernel source tree.


One issue that was noticeable from a direct patch of code was the y-axis being inverted. I corrected it with a hard coded reference value for now.



This patch doesn’t help when offset loss happens in the touch screen. Looking info using tslib to capture better data settings and a linear formula for pointer calculations. Some good instructions for compiling tslib on android can be found on wenes1’s blog. A different direction to fix this issue would be to use Y_AXIS_MAX constant.

It was hard for me to find any direct documentation on how touch screen drivers should be designed and configured in Android. If you know of any please ping me.

How to Flash New Boot Loader and Firmware netduino mini

I got my netduino in the mail and whatever was flashed on it was toast, so after a few posts on the forum I got great advice on how to flash the Boot Loader (TinyBooter) and firmware (ER_CONFIG and ER_FLASH)
Erase Chip
Erase the chip by applying +5v to the gold pad located by pin 12

Download the TinyBooter
http://forums.netduino.com/index.php?/topic/621-netduino-mini-firmware-v410-update-5/

Run SAM-BA
Run the SAM-BA application from ATMEL (Note if your on windows 7 Ultimate stick with an older version of SAM-BA, do not use 2.10.)
The current package I have installed is from: Install_AT91-ISP_v1.13.exe

Power Up
Power up the netdruino by connecting the power and serial TX/RX on pin 1 & 2 (Note: make sure you have completely removed power after sending +5v to the gold pad)

Chose serial port and board

If the first time does not succeed power down and try again. And if it still does not succeed try hitting the gold pad for a second time.
If SAM-BA can communicate and get a valid id on the chip you should be presented with the following screen

Choose a file to send while in the “Flash” tab.

Click Send File. The SAM-BA application isn’t that great and locks up while sending data over the serial port. If possible just wait. This part of the process will take a while, even if you don’t see data being sent over the serial port stuff is going on.

SAM-BA will ask you if you want to “lock involved lock region(s) (0 to 2)”, I choose “No” on this.

At this point you should have succeefully flashed the Boot Loader onto the netduino mini. Click on “Compare sent file with memory” to ensure the Boot Loader did not get corrupted in the process. If everything is fine you should be presented with something similar to the following screen.

While still in the “Flash” tab execute the script “Boot from Flash (GPNVM2)” by clicking on the “Execute” button. The terminal on the bottom of the app should display “-I- GPNVM2 set”

Download and extract the firmware
http://forums.netduino.com/index.php?/topic/621-netduino-mini-firmware-v410-update-5/
Run MFDeploy.exe

Remove power from the netduino before trying to pin the device.
If you open a putty terminal and repower the device you should see the following

This should help you determine if the Boot Loader that has been flash is working.
Choose the proper COM port the netduino is on.

Try and ping

Erase

Deploy Firmware

A successful flash should look something like this

Try sending some debug commands