Can't figure out the SM shield with a Leonardo Arduino


(Pj Hollenbeck) #1

Hi all,

I am having a heck of a time trying to figure out the problem with connecting the SM shield to a Leonardo arduino. I’m trying to run the simple on/off/hello sample sketch, and am getting “setup…” in the serial monitor but that’s it. Otherwise the SMartthings hub sees the shield and I have it set as the On/Off (example) option. I already added the "while (!Serial) ; portion to the code, so that should be working ok (I think…) I did see something about the 2-3 pins not being the same on the Leonardo that they are on the Duo, but I’m not completely clear on what that means or if/how I can get it to work. I’d love to have the Leonardo working with this, but I guess if need be I can spring for a Duo instead…

Thanks!


(Surya) #2

@snooginsguy, I found this line in the Smarthings.h header…Did you uncomment that line to define leonardo board type?

//*******************************************************************************
// @note Set to Leonardo here if using Leonardo board
//*******************************************************************************
//#define BOARD_TYPE BOARD_TYPE_LEONARDO //TODO Incomplete


(Pj Hollenbeck) #3

Hi Surya,

thanks for the suggestion. I uncommented the line, but then the project wouldn’t compile at all! I then added the line #define BOARD_TYPE BOARD_TYPE_LEONARDO to the sketch just under the lines to define the PIN_THING_RX/TX but that doesn’t seem to have done anything. Any other ideas?

Shoot, I did just notice in the info.txt of the smartthings libraries folder that on 2/8/2012 they “Began framework for working on Leonardo” but there’s no subsequent entry that it was finished. It seems that it’s unlikely the Leonardo will work after all? Bit disappointing if that’s the case since the arduino shield page specifies the Leonardo as working…


(Surya) #4

calling in the big guns…@urman, @megapixel, @chrisb, @wackware …can one of you answer the question about how to get smartthings shiled working with the LEONARDO board?


(Chrisb) #5

Sorry @gopi2212, in this area I’m more of a BB-gun than a big gun!

Based on what PJ was saying above:

Shoot, I did just notice in the info.txt of the smartthings libraries folder that on 2/8/2012 they “Began framework for working on Leonardo” but there’s no subsequent entry that it was finished. It seems that it’s unlikely the Leonardo will work after all? Bit disappointing if that’s the case since the arduino shield page specifies the Leonardo as working…

Might be the clue. I’d send an email to support and ask if the Leonardo is even supported.


(Todd Wackford) #6

If I remember right there was hardware or software serial issue and there was/is a fix. Definitely send an email to support@smartthings.com.

Twack


(Pj Hollenbeck) #7

Thanks for the responses everyone! I’ll shoot an email to support, and will post back here with results, hopefully positive ones…


(Ed D) #8

Any response? I’d also like to use the Leonardo I bought for my project rather than pirate an Uno from an older project…


(Todd Wackford) #9

Did you read this?

http://build.smartthings.com/forums/topic/arduino-mega-2560-and-thingshield-no-upload/


(Ed D) #10

Thanks, Twack - I did not read that as it seemed to be related to the Mega. Easy fix to use another pin, thanks for the pointer.


(Todd Wackford) #11

Let us know if that worked for you. And no prob for the pointer, I like to share what little I know :slight_smile:


(Ed D) #12

Yep, it did! My application is a controller for multiple strings of LEDs, driven by a 6-FET Sparkfun power shield. Fortunately I only need 4 control channels, as the power controller uses all 6 PWM pins and the ThingShield now wants two of them (3 and 10).