Sunday, June 21, 2009

RTFM Works

Last gasp accomplishment for the day - Friday. The inhouse software guru spoke - it's just RTFM. Use Zterm on the Mac to connect to the radio. Before that, open up the manual for Roving Networks' radio that Sparkfun is using. I keep claiming to want to be in RF, how come I never did that? Hmmm..

Anyhow, in this case, the Mac never did pair with the modem - needed default passkey, not no passkey. So, Igoe should really have said to RTFM.

What I have noticed with Zterm is this - you can power up the modem and use Zterm to talk to the modem in command mode - as long as TX/RX are not connected to the AVR. If they are, no hope.

Then, if you have connected TX/RX to the AVR and are running the monski pong sensor reader program, you can't get the sensor values - no matter how many /r's you send - which is exactly what the Processing sketch does. Why? If I run the Processing monski_pong_handshake sketch, stuff works fine. And then, once the sketch is up and running, I can interrupt it and go into Zterm and continue reading sensor values using Zterm. What's going on??

Whoops, and just like that, after my friend returns, stuff behaves. I can go into CMD mode arbitrarily, and even read sensor data through Zterm. The trick seems to be to wait a few seconds after powering up the Arduino setup. After that, the Mac has paired with the device and made the serial port available. Of course, once the Mac has seen the device, the serial port is always available. But, if you try connecting to it 5 seconds after you power up the bluetooth modem, you're out of luck.

Friday, June 19, 2009

Wireless Monski Pong

Alright Mr. Igoe, this is the first one that doesn't work.

When I power up the setup, the LED near the RTS pin blinks (keeps) about 2x a second.

If the MAC has already paired with the device once, then, if you run the program in processing, the LED near the CTS pin goes solid on.

Then, if you stop the program, (it does draw the screen BTW, but no action), the LED near CTS goes off, and the one near RTS starts blinking at 1 Hz.

Very hard to debug this one on the MAC - how to you know what's showing up on the serial port?

A general question about the Arduino board - are the RX/TX pins on the header connected to the same ones that go to the serial-USB adapter chip?

So Much for Mac's Users Friendliness

I still remember a show on TV 20 years ago touting the Mac's user friendliness with a PC example - "abort,retry, fail?". Here's what I got from the Mac Mini today when I tried to run Arduino :

uncaught exception in main method:
java.lang.UnsatisfiedLinkError: /Useres/xx/arduino-0015/Arduio
15.app/Contents/Resources/java/librxtxSerial.jnilib: no suitable image
found. Did find:
/Users/xx/arduino-0015/Arduino15.app/Contents/Resources/java/librxtxSerial.jnilib:
no matching architecture in universal wrapper

Leaves me helpless.

Sunday, June 14, 2009

Mission A.d : Push Button, Send LED

Accomplishes a Hello World version of Igoe's CatCam program. I can push a button on my Arduino board connected to the Mac and get my PC to send a mail to my gmail. Will post the code soon.

With the help of a software guru of course :)

Basically, following the lead from Tom Igoe :

App running on the Arduino is very simple and just services a pushbuttom press and a very simple handshake with the PC over the serial port, which also serves in the debounce (PC implements a 2 second delay. Yuck!)

PC runs a very simple program (in Processing code) to monitor the serial port and look for the secret byte. When it gets it, it fetches a PHP page from the webserver.

Webserver, services that request by sending a mail using the simple port 25 protocal at mail.google that doesn't require authentication.

Mail will be in your spam folder in your gmail because it looks like an obvious forgery.

Saturday, June 13, 2009

VDIG Mirror

The whole setup - Arduino + processing is quite unreliable - no offense to the nice people who've put it together. It lacks the "heavyweight" quality.

Anyhow, for those seeking VDIG - which lets you generate quicktime output from you webcam, here's a mirror:

http://www.eden.net.nz/7/20071008/

Courtesy of Tim Molteno. Hero!

One glaring error by Tom Igoe :

Pg 298 - he's put "myCam" before width in his call to Capture. How????????

The Best Apache PHP Setup Guide in the World

Here :

http://www.reaper-x.com/2007/09/24/installing-and-setting-up-apache-22-series-with-php-5-on-windows/

But, this is a mistake to install just Apache. Later you'll be installing PHP, etc. What you want to install is XAMPP. Check that out!

Thursday, June 4, 2009

Arduino Igoe Monski Pong Prequel

Code for the book Making Things Talk is available online :

http://www.makershed.com/ProductDetails.asp?ProductCode=0596510519

Now, code for the example on Pg 59 is in the file called sensor_reader.

Set Realterm to ASCII to see a presentable display. I used just resistors (no flex) and moved the probe (analog Pin 0 or 1) around VDD and GND to see that max code is 1023 and min is 0. Tells you it's a 10 bit ADC - neat. The last character appears weird it must be said.

With a 1k to 5V and 10k to GND divider, I see codes ranging from 931 to 929 - 2 LSB's of p2p noise. About 10 mV of noise there p2p. That's within the ADC bandwidth. And what is that? Need to check the datasheet there. Gives an idea of the KT/C noise and the active device noise of the ADC? p2p noise is about 6x the rms noise?

Arduino Serial Success

The big tip - screw what Igoe says - don't even look at Putty. Putty was busy with I don't know what when I clicked "Open" - not even a peep.

Go straight for Realterm - probably the best serial comm tool ever written.

Goes without saying - you can't have Realterm looking at your port and use the same port to write to the arduino simultaneously. You'll have to close the port in Realterm first - just press the button.

Wednesday, June 3, 2009

Arduino Interrupt Handling

This stuff worked very cleanly in MSP430. Problem is that people are doing a lot more basic stuff with Arduino at the moment so interrupts don't seem to have caught on just yet.

Anyhow, here's what I was trying to do :

Push the button and get the uC to play the Melody. Didn't work, so then I say just blink the LED. That also doesn't work.

This much I see :

(stuff you have to know is that every program in Arduino has a "setup()" and a "loop()")

I light up the pin 13 LED within loop.
Then, I set the ISR to clear the LED, delay and the light it up again.

Doesn't work - all I see is it clears the LED. Come on, this is really simple.

Then, Lefty tells me that you can't use delay within your ISR.

WTH!!

The goal, BTW, is to get through Igoe's book. Great guy - saw him at Maker Faire. Seems to have done everything I want to do. Now, while the economy's got me down is the time.

Anyhow, 11:35 at night, nailed the interrupt thing - can play Melody at the press of a buton. Now, to try out one serial example from Igoe's book and call it a day.

Arduino Here I Come

Okay, MSP430 sucks, Atmel rules. Yesterday was day one. BTW, Atmel and Arduino rule the Maker Faire (no one mentions Atmel of course). I asked on Dallas guy at the MF if he's considered MSP430 and he said no. No way.

Anyhow, we put Arduino on a Compaq running XP yesterday and the performance was pretty crappy. You click the Tool menu and wait about half a minute.

At some point, we're going to get some smart CS people from Eastern Europe to fix this. Italy doesn't seem to cut it yet.