DheerajKhajuria / pimatic-mysensors

mysensors
http://forum.mysensors.org/topic/797/pimatic-mysensors-controller-plugin
GNU General Public License v2.0
23 stars 24 forks source link

Failure on sending payload #10

Closed cdkisa closed 9 years ago

cdkisa commented 9 years ago

First off, thanks for writing this plugin!

I am having an issue where I am trying to control a light switch from pimatic. I am receiving sensor values just fine. Seems that only sending is an issue. I followed your instructions for setting it up, but in the pimatic log files, I am getting this message:

-> Sending 1;6;1;1;2;1 <- I_LOG_MESSAGE 0;0;3;0;9;send: 0-0-1-1 s=6,c=1,t=2,pt=0,l=1,st=fail:1 -> Sending 1;6;1;1;2;0 <- I_LOG_MESSAGE 0;0;3;0;9;send: 0-0-1-1 s=6,c=1,t=2,pt=0,l=1,st=fail:0

Not sure why, but the first "Sending" message seems to be addressed correctly. But, in the "I_LOG_MESSAGE", it is different. Do I need some additional configuration?

In my setup, I have the following: Node on Arduino UNO R3

NODE_ID = 1 LIGHT_SWITCH_SENSOR_ID = 6 sensor type = V_LIGHT message type = S_LIGHT

pimatic plugin config { "plugin": "mysensors", "driver": "serialport", "protocols": "1.4.1", "driverOptions": { "serialDevice": "/dev/ttyUSB0", "baudrate": "115200" } }

pimatic devices config { "id": "laundryroom-lightswitch", "name": "Light Switch", "class": "MySensorsSwitch", "nodeid": 1, "sensorid": 6, "resetTime": 5000, "batterySensor": false }

cheers, cdkisa

funky81 commented 9 years ago

Hi, may I try to help? If you don't mind, please share your sketch.

cdkisa commented 9 years ago

https://github.com/cdkisa/arduino_uno/blob/master/laundry_room_node.ino

DheerajKhajuria commented 9 years ago

these are log message from gateway .. may be your gateway is not able to get the ack response to from sensor node..

cdkisa commented 9 years ago

In my serial monitor on the node, it says all is well when sending the sensor values, with or without ack request. my gateway is hooked up to a raspberry pi. do you know of a way to see the serial monitor on the pi so I can watch the messages on the gateway? can i just use cat /dev/ttyUSB0? am at work, will try when i get home. maybe funky81 will find flaw in my node sketch.

thanks for your help, cdkisa

cdkisa commented 9 years ago

mystery solved! apparently you cannot call gw.sleep(TIME); in your node sketches if you want to process incoming messages. but, you can call delay(TIME);

look forward to future development! thanks again.

funky81 commented 9 years ago

glad you can solve this.