Localisation in Star topology

Hi ,

Plesae I need some help here:

So i'm working on localisation in star topology with 8 sensor nodes (Arduino + XBEE Serie 1 with USB cables not batteries)
I implemented an arduino code to execute the ATND command, then with processing i save the result in files.
Finally , I used java code to implement the positioning.

Now i'm wondering , Is it a good solution, or , i can't do it that way. And instead i should implement the positioning algorithm with Arduino and upload it on the XBEE's ( I tried this solution but I couldn't go on cause i couldn't filter the incoming bytes with Arduino for example to save the NI, RSSI....with Java it was easy using files and the arraylists).

Please Any idea to help me!

Thank you so much.

Now i'm wondering , Is it a good solution, or , i can't do it that way.

If it works, it's a good solution. Perhaps not the best one, but whether or not it's good enough is for you to say.

And instead i should implement the positioning algorithm with Arduino and upload it on the XBEE's

What positioning algorithm? You can't upload code to the XBees. You can only upload code to the Arduino(s).

I tried this solution but I couldn't go on cause i couldn't filter the incoming bytes with Arduino for example to save the NI, RSSI.

Not much we can do without seeing your code and knowing what your problems were.

First of, thank you :slight_smile:
And yes , i meant upload to Arduino ,(just confused).

And here it is my Ardunio Code execution ATNI and ATND command, and then using processing , i save the resukt into files. So here my questionis if I could add to this code how to filter the result of the commands to take what i really want, Hope that u understand me.


// code coordinateur

/* Moniteur-série
lit un message et annonce qu'il l'a reçu
*/
char recu[100];
//String response="";
int i;

void setup(){
Serial.begin(9600);

delay(1000);
command_mode();
}

void loop() {

i = 0 ;
while ( Serial.available()==0 ){}
while ( Serial.available()>0 ) {
recu = Serial.read();
_ char octet = recu*;_
_
i++;_
_
//delay(300);*_

* if (i>0) {*

* Serial.print(octet);*
* delay(300);*
* }*
* }*

}
void command_mode(){
delay(1200);
* Serial.print("+++");*
* delay(1200);*
* bool bOK = false;*
* while (Serial.available() > 0) {*
* Serial.write(Serial.read());*
* bOK = true;*
* }*

* if(bOK)*
* {*

* Serial.println();*
* Serial.println("ATNI");*
* delay(1000);*
* read_data();
_
delay(500);*_

* Serial.println("ATND");*

}
}
void read_data(){
* byte data;*
* while(Serial.available()){*
* data=Serial.read();*
* delay(1000);*
* Serial.print(char(data));*
* delay(500);*
* }*
Serial.flush();
}
------------------------------

There are stickies at the top of every forum that explain how to post code. Without the use of code tags, the forum software decides that some streams of characters represent instruction to bold text, to italicize test, to create lists, etc. I'm sure your code looks nothing like what you posted.

Before you post is again, correctly, though, there are some things you need to do. Commented out code is doing nothing. Delete it. Use Tools + Auto Format to fix the horrid indenting.

Depending on which version of the IDE you are using, Serial.flush() does different things. In 99.9% of the cases where it is used, it should not be. Unless you can provide a compelling case for using it (correctly), get rid of it.