Hello everybody !
I'm still trying to get the RSSI info for a received message.
Firstly, I updated the XBEE firmware to 10A2.
Secondly, I tried with the AT commands manualy in the console and it works.
Now I'm trying to have it via the 6th IO pin on the ARM microcontroler.
In order to do this , I added this to the utils.c file :
Code:
unsigned char P06_read() {
return (unsigned char) ((IOPIN0 & 0x00000040) >> 6);
}
And I added this function to the main.c file:
Code:
//get RSSI from PWM output of xbee
int getRssi(void) {
unsigned int i,j;
int cnt = 0;
//wait until 1 in P06
do { i = P06_read(); }while(i==0);
//for 64 µs
for (j=0;j<64;j++) {
i <- P06_read();
if(i != 0) { cnt++; }
delayUs(1);
}
uart0SendChar(cnt);
uart0SendChar("\n");
return cnt;
}
I call this function after receiving a message on the robot.
And it sends the value '@' which means '64'
So it doesn't seems to work as it allways send the maximum value ?
As I sais I tried with the AT commands and it works ok but it is really too slow to wait 2 seconds each time I want the RSSI value.
About the OEM/API mode it seems a bit complicated as a good part of the firmware should be modified in order to pass from transparent mode to API mode.
Another thing I'd like to mention is that both the JAVA and PYTHON programs do not work right with the latest (10A2) xbee firmware.
Thank you in advance.
Mathieu