d8adrvn / smart_sprinkler

Smart Sprinkler Controller Using Arduino and SmartThings
http://build.smartthings.com/projects/smartsprinkler/
Apache License 2.0
62 stars 55 forks source link

Can't tell if ThingShield is communicating with Arduino #29

Closed jenningsmd closed 8 years ago

jenningsmd commented 9 years ago

I'm am new to Arduino and ThingShield, but I am technical. I cannot get the Arduino to turn on a relay. I have tried to troubleshoot all aspects of the solution but feel I am blind to what the ThingShield is receiving/sending. To test the Arduino and relay, I took off the shield and programmed the Arduino to run through the relays (8 channel). I got them all to respond and even have them lighting an LED per channel. I then reconnected the shield and uploaded the 8zone code (recabled to the ThingShield). Still no activity on the relays when I push titles on my phone. I can see the shield in My Devices in the SmartThings IDE and I can see the events in the live log. I tried going to the console on the Arduino IDE and I get "setup...", but no other output.

Where else can I monitor what is going on?

Thanks

d8adrvn commented 9 years ago

A couple things to try: My best guess is that the DIP switch the ThingShield is set at D0/D1 and needs to be switched to D2/D3. This configures the ThingShield to listen to pins2 and pins3 for serial communications.

The other possibility is that you have not yet hit "Publish" and then "for me" on your Device-Type page at api.graph.smartthings.com. Its not enough to just save the device type code. You probably already did this though since you are seeing things on the live log, which is why I think the solution is above.

jenningsmd commented 9 years ago

I received it defaulted to D2/D3. Yes, I have published it for me. Is there anyway to see what the shield is sending (or not) to the arduino?

On Sat, Apr 4, 2015 at 4:11 PM, Stan notifications@github.com wrote:

A couple things to try: My best guess is that the DIP switch the ThingShield is set at D0/D1 and needs to be switched to D2/D3. This configures the ThingShield to listen to pins2 and pins3 for serial communications.

The other possibility is that you have not yet hit "Publish" and then "for me" on your Device-Type page at api.graph.smartthings.com. Its not enough to just save the device type code. You probably already did this though since you are seeing things on the live log, which is why I think the solution is above.

— Reply to this email directly or view it on GitHub https://github.com/d8adrvn/smart_sprinkler/issues/29#issuecomment-89668688 .

jenningsmd commented 9 years ago

Also, is this typical output I should be seeing on pressing a tile?

6d15dcef-4cdf-4f0b-bdb6-1048ee6e3889 https://graph.api.smartthings.com/ide/logs#6d15dcef-4cdf-4f0b-bdb6-1048ee6e3889 4:39:57 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 received '' 6d15dcef-4cdf-4f0b-bdb6-1048ee6e3889 https://graph.api.smartthings.com/ide/logs#6d15dcef-4cdf-4f0b-bdb6-1048ee6e3889 4:39:57 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0b, data: [0x0a, 0x00], destinationEndpoint: 0x01, direction: 0x01, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x0000, options: 0x0140, profileId: 0x0104, senderShortId: 0xb7f0, sourceEndpoint: 0x01, text: ) 6d15dcef-4cdf-4f0b-bdb6-1048ee6e3889 https://graph.api.smartthings.com/ide/logs#6d15dcef-4cdf-4f0b-bdb6-1048ee6e3889 4:39:57 PM: debug Parsing 'catchall: 0104 0000 01 01 0140 00 B7F0 00 00 0000 0B 01 0A00'

Also, not sure if this is typical but I don't see the blue LED light up on the shield until I hit the console in the Arduino IDE.

Thanks

On Sat, Apr 4, 2015 at 4:39 PM, Mike Jennings jenningsmd@gmail.com wrote:

I received it defaulted to D2/D3. Yes, I have published it for me. Is there anyway to see what the shield is sending (or not) to the arduino?

On Sat, Apr 4, 2015 at 4:11 PM, Stan notifications@github.com wrote:

A couple things to try: My best guess is that the DIP switch the ThingShield is set at D0/D1 and needs to be switched to D2/D3. This configures the ThingShield to listen to pins2 and pins3 for serial communications.

The other possibility is that you have not yet hit "Publish" and then "for me" on your Device-Type page at api.graph.smartthings.com. Its not enough to just save the device type code. You probably already did this though since you are seeing things on the live log, which is why I think the solution is above.

— Reply to this email directly or view it on GitHub https://github.com/d8adrvn/smart_sprinkler/issues/29#issuecomment-89668688 .

d8adrvn commented 9 years ago

If you have the Arduino connected to your Mac via an USB cable, and ensure "isDebugEnabled=true", you will see the commands that the Arduino receives from the ThingShield, if any, via the SerialMonitor in the Arduino IDE (look under Tools Menu)

The LED light doesn't always light until it starts receiving commands. Its a known bug.

Looking at your log, your just seeing a line feed and null character 0A00 which was parsed into a " In between is a message from the SmartShield which I think has been recently added either with the hub upgrade or your later model SmartShield. In any case, I don't see any evidence that a tile was pushed.

When I push the zone1 tile, here is the immediate log on the "live log" tab at api.graph.smartthings.com 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone eight is off8 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone seven is off7 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone six is off6 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone five is off5 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone four is off4 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone three is off3 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone two is off2 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller zone one is on1 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:23 PM MDT: info Irrigation Controller is: Irrigation Controller refresh is ok 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:21 PM MDT: info Irrigation Controller is: Irrigation Controller received '' 022144ed-b18a-43c4-b806-636a53c15e5b 4:07:20 PM MDT: info Executing 'on,1'

Read bottom to top: info Executing 'on,1' is a log that indicates that the tile was pressed. Note; this is generated by device type and does not require successful communication to the ThingShield The next log is just a LF+Null The third log shows that the Arduino received a command and is ok Then the four log shows on1, indicating that the command was processed by Arduino and zone1 was turned on. Note: this is actual feedback from the Arduino.

If you are not seeing that first log line (Executing on,1) then this is with the device type (try publishing) or you have not assigned the irrigation controller device type to the actual device (go under devices and edit the device and select the irrigation device-type).

d8adrvn commented 9 years ago

Also, you should be receiving a ping about every min: 4:21:05 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping'

If not, then the ThingShield may not be paired with the hub. Try repairing the ThingShield

d8adrvn commented 9 years ago

022144ed-b18a-43c4-b806-636a53c15e5b 4:24:14 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping' 022144ed-b18a-43c4-b806-636a53c15e5b 4:23:12 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping' 022144ed-b18a-43c4-b806-636a53c15e5b 4:22:09 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping'

jenningsmd commented 9 years ago

Unpaired it, deleted it, repaired it...seems the same.

2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:04 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 received '' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:04 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0b, data: [0x0a, 0x00], destinationEndpoint: 0x01, direction: 0x01, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x0000, options: 0x0140, profileId: 0x0104, senderShortId: 0x506a, sourceEndpoint: 0x01, text: ) 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:04 PM: debug Parsing 'catchall: 0104 0000 01 01 0140 00 506A 00 00 0000 0B 01 0A00' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:03 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 received '' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:03 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0b, data: [0x0a, 0x00], destinationEndpoint: 0x01, direction: 0x01, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x0000, options: 0x0140, profileId: 0x0104, senderShortId: 0x506a, sourceEndpoint: 0x01, text: ) 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:03 PM: debug Parsing 'catchall: 0104 0000 01 01 0140 00 506A 00 00 0000 0B 01 0A00' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:03 PM: info Executing 'off,2' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:02 PM: info Executing 'on,2' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:00 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 received '' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:00 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0b, data: [0x0a, 0x00], destinationEndpoint: 0x01, direction: 0x01, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x0000, options: 0x0140, profileId: 0x0104, senderShortId: 0x506a, sourceEndpoint: 0x01, text: ) 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:21:00 PM: debug Parsing 'catchall: 0104 0000 01 01 0140 00 506A 00 00 0000 0B 01 0A00' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:20:58 PM: info Executing 'on,1'

On Sat, Apr 4, 2015 at 5:24 PM, Stan notifications@github.com wrote:

022144ed-b18a-43c4-b806-636a53c15e5b 4:24:14 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping' 022144ed-b18a-43c4-b806-636a53c15e5b 4:23:12 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping' 022144ed-b18a-43c4-b806-636a53c15e5b 4:22:09 PM MDT: info Irrigation Controller is: Irrigation Controller received 'ping'

— Reply to this email directly or view it on GitHub https://github.com/d8adrvn/smart_sprinkler/issues/29#issuecomment-89672602 .

d8adrvn commented 9 years ago

I can now see the 6:20:58 PM: info Executing 'on,1' and 6:21:02 PM: info Executing 'on,2', etc.. which indicate tiles are working and trying to execute a command to the ThingShield. Again no evidence of a response from the Arduino or the ThingShield. I already covered the likely solutions which are the "publish", and "D2/D3".

Can you get it hooked up to your computer and run the SerialMonitor in the Arduino IDE? That would let you know if the Arduino is receiving anything (but won't help diagnose if its not).

The fact that there is no "ping" bothers me.

Also, I never see this: 6:21:03 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0b, data: [0x0a, 0x00], destinationEndpoint: 0x01, direction: 0x01, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x0000, options: 0x0140, profileId: 0x0104, senderShortId: 0x506a, sourceEndpoint: 0x01, text: ) 2c9f8647-be24-49e2-b91d-99845624084b

Maybe you should shoot the above over to SmartThings support to see if this is normal?

jenningsmd commented 9 years ago

Now I'm getting refresh is ok, but the no signals to the relay.

2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone eight is off8 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone seven is off7 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone six is off6 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone five is off5 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone four is off4 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone three is off3 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone two is off2 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 zone one is off1 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 refresh is ok 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0a, data: [0x0a, 0x6f, 0x6b, 0x2c, 0x6f, 0x66, 0x66, 0x31, 0x2c, 0x6f, 0x66, 0x66, 0x32, 0x2c, 0x6f, 0x66, 0x66, 0x33, 0x2c, 0x6f, 0x66, 0x66, 0x34, 0x2c, 0x6f, 0x66, 0x66, 0x35, 0x2c, 0x6f, 0x66, 0x66, 0x36, 0x2c, 0x6f, 0x66, 0x66, 0x37, 0x2c, 0x6f, 0x66, 0x66, 0x38, 0x2c], destinationEndpoint: 0x01, direction: 0x00, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x382c, options: 0x0140, profileId: 0x0104, senderShortId: 0x506a, sourceEndpoint: 0x01, text: ok,off1,off2,off3,off4,off5,off6,off7,off8,) 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:19 PM: debug Parsing 'catchall: 0104 0000 01 01 0140 00 506A 00 00 0000 0A 00 0A6F6B2C6F6666312C6F6666322C6F6666332C6F6666342C6F6666352C6F6666362C6F6666372C6F6666382C' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:18 PM: debug Parse returned Irrigation Controller 8 Zones v2.66 received 'pumpRemoved' 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:18 PM: debug Parsed: SmartShield(clusterId: 0x0000, command: 0x0a, data: [0x0a, 0x70, 0x75, 0x6d, 0x70, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64], destinationEndpoint: 0x01, direction: 0x00, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: 0x6564, options: 0x0140, profileId: 0x0104, senderShortId: 0x506a, sourceEndpoint: 0x01, text: pumpRemoved) 2c9f8647-be24-49e2-b91d-99845624084b https://graph.api.smartthings.com/ide/logs#2c9f8647-be24-49e2-b91d-99845624084b 6:33:18 PM: debug Parsing 'catchall: 0104 0000 01 01 0140 00 506A 00 00 0000 0A 00 0A70756D7052656D6F766564'

zuperman4ever commented 9 years ago

So you are able to view and compile and then upload to the Arduino with the smartthings shield attached and the wires as they are in the pictures? You created the device type in SmartThings with the correct version so that when you added the shield to your HA it automaticaly recognized the shield as a sprinklers system? The light on the smartthings shield on or off? It will turn on of the code is correct with the device type that is assigned to the shield and is rx tx.

d8adrvn commented 9 years ago

Ok, so communications should all be fine. You were able to successfully send the pump removed command and got response back from the Arduino.

d8adrvn commented 9 years ago

The above log file indicated that all the relays should be "off". Did you go into preferences and set some time for each zone? If zone times are not set (set to 0 min), then they do not fire. Add 1 min to each zone and try again

jenningsmd commented 9 years ago

I did set Zone one to one minute and it showed that it fired on and off in the log but I'll try it again and set them all and do another test

On Sat, Apr 4, 2015, 18:44 Stan notifications@github.com wrote:

The above log file indicated that all the relays should be "off". Did you go into preferences and set some time for each zone? If zone times are not set (set to 0 min), then they do not fire. Add 1 min to each zone and try again

— Reply to this email directly or view it on GitHub https://github.com/d8adrvn/smart_sprinkler/issues/29#issuecomment-89689186 .

jenningsmd commented 9 years ago

I set all the zones with 1 min and ran a schedule. Still nothing from the relay.

I do have a support email into SmartThings. I'll see what they say. Thanks for the responses.