I have a ThingShield attached to an Arduino Mega. I’m using the ST_Anything library. The switch is set to D2/D3. Pins 2/14 and 3/15 are jumpered.
The device type includes the following:
def open25()
{
zigbee.smartShield(text: “OPEN25”).format()
log.debug "Sent to device: OPEN25"
}
Logging shows that it “fires” appropriately.
The sketch includes:
SmartThings smartthing(HW_SERIAL3, messageCallout); //constructor for hardware serial port with ST_Anything Library
.
.
void messageCallout(String message)
{
smartthing.shieldSetLED(0, 1, 0); // shield led is green
if (message.length()>0) //avoids processing ping from hub
{
smartthing.shieldSetLED(0, 0, 9); // shield led is blue
smartthing.send(message);
if (message.equals("OPEN25")) { Serial.println("open25");
Serial.println("Interleave coil steps forward"); myMotor->step(25, FORWARD, INTERLEAVE);
smartthing.send("Opened 25%"); } if (message.equals("CLOSE25")) { Serial.println("close25");
Serial.println("Interleave coil steps backward");
myMotor->step(25, BACKWARD, INTERLEAVE);
smartthing.send("Closed 25%"); }
}
smartthing.shieldSetLED(0, 0, 0); // shield led is off
}
The shield receives a ping every so often. I’m using the LED to visually signal what’s going on. I can get it to send a message back to the cloud, but other than a ping, it NEVER receives a message from the cloud (i.e. the OPEN25 message).
Any ideas?