This is strange. I am collecting data in the device and sending it to the agent. The agent is collecting and retaining the data.
It worked for a while and then one of my edits caused the output at the agent to change to this:
(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)(array : 0x7f99b8c8abe0)
The array seems to be ok at the device
I tried breaking down the function to this
DEVICE
`function loop()
{
local d = date();
local dday = d.day;
local dhour = d.hour-5;//corrects for UTC device time
if (dhour < 0) {
dhour += 24;//corrects for UTC device time
dday -= 1;//corrects the day count for UTC device time
}
local d1 = 1
local d2 = 2
local d3 = “dave"
local senddata = d.wday+”,"+dhour+":"+d.min+",C#,"+d1+","+d2+","+d3+","
server.log (“device=”+senddata);
agent.send(“comms”,senddata)
imp.wakeup (5,loop);
}
loop();`
AGENT
`save <- “”
device.on (“comms”, function (data){
save = save + data;
server.log (“agent=”+save+“s not here”)
})`
But of course this works perfectly returning the following:
2015-08-04 10:02:02 UTC-5 [Device] device=2,10:2,C#,1,2,dave, 2015-08-04 10:02:02 UTC-5 [Agent] agent=2,10:2,C#,1,2,dave, is not here 2015-08-04 10:02:07 UTC-5 [Agent] agent=2,10:2,C#,1,2,dave,2,10:2,C#,1,2,dave, is not here 2015-08-04 10:02:07 UTC-5 [Device] device=2,10:2,C#,1,2,dave,
Any ideas are welcome