Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: (Almost) identical software, doesn't work the same
PostPosted: Fri Mar 09, 2012 4:46 pm 

Joined: Wed Feb 22, 2012 1:34 pm
Posts: 22
Hi!

I am trying to send data from two slaves to one master.

First, the master initiates the clock, send a synchronization signal to both slaves so they can set the clock.
Then the two slaves send their sensor data (having trouble with sending some, so I send pre-defined data instead but this doesn't matter now), but only one of the slaves sends the actual data.

Please, have a look at this: http://diffchecker.com/00G92F2
It is the difference between the two files.

The left one sends all data correct, while the right one only sends payload[0] correct.

Please, can anyone suggest why? Thank you very much in advance.
There is a lot of code, but this is done for debugging purposes.


Top
 Profile  
 
 Post subject: Re: (Almost) identical software, doesn't work the same
PostPosted: Fri Mar 16, 2012 1:35 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7508
sinnadyr,

First of all sorry about delay answering.

While we think in your issue, did you tested both slaves separately?
Besides that, did you try to send a "hello word" message with both slaves?

Tell us in the meantime.

Regards.


Top
 OnlineProfile  
 
 Post subject: Re: (Almost) identical software, doesn't work the same
PostPosted: Fri Mar 16, 2012 1:56 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7508
sinnadyr,

thinking about your issue, it would be good if you introduce a random delay to avoid packet collision.

We do something similar in our API, but you can generate random delay in your preferred way.

random delay wrote:
srand(millis()); // set seed
delay( (rand()%1000+ 1) ); // delay between 1ms and 1s


Try this and tell us what happens.

best regards.


Top
 OnlineProfile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 3 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use