I am trying to implement this electrical energy consumption project ( Using an Arduino to Track My Electricity Consumption Cost in Real-Time). except for the servo part. My project is to detect the LED blink on the energy meter and send it to PC with XBee s1 through Xbee s1 mounted on arduino uno board.
At the PC side I have a java program to read the raw bytes received to insert in to database.
I am looking for help in xbee s1 configuration. First i tried following configs in xbee s1 on arduino and PC side resp.
Arduino side
AP 1
MY 1
ID 1977
DL 2
CH C
AP 1
MY 2
ID 1977
DL 1
CH C
But I am not getting any data on the Java application using above xbee . My arduino configuration is giving desired results.
Can you suggest best possible way to configure xbee . Also in the process i have bricked one of the xbee , any suggestions to unbrick. I have tries some methods stated in other sites like selecting the No baud change option (9600,NONE,8,NONE,1) & always update firmware option selected (under Modem configuration ) in X-CTU but no success.
Is there a sure shot way to unbrick xbee. ?
But I am not getting any data on the Java application using above xbee .
Then, the problem is likely in how the Arduino is sending data or how the Java application is receiving data or how the XBees are connected to the Arduino/PC - details that you failed to provide.
The shield is provided with a DPDT sliding switch which helps XBEE module to connect either PC via USB or UART Pins of Arduino microcontroller. This feature helps you to configure the XBEE module before using in your project.No need for separate XBEE development board or XBEE explorer. Power is taken from the 5V pin of the Arduino and regulated on-board to 3.3VDC before being supplied to the XBee. The shield also takes care of level shifting on the DIN & DOUT pin of the XBee.There is another option(Jumper Selectable) which allows you to connect XBEE module to either Digital UART or Software UART.
I suggest that you move the switch from the hardware UART position to the software UART position, and figure out which pins it is connected to (probably pins 2 and 3). Then, create a SoftwareSerial instance to talk to the XBee and use Serial to talk to the PC, so you can debug your code.
That shield has LEDs that show transmit and receive activity. It would be nice to know what they are doing.
And, of course, one XBee is useless. We need to know how the other one is connected to the PC.
Xbee shield is already in Software UART mode it self, but result is same . Do i need to change my arduino code ?
Of course you do. You are reading from/writing to the hardware serial port. You need to read from/write to a software serial port, and add debug messages (sending them to the hardware serial port).
So, now we know that both ends have TX and RX leds, but not whether they are doing anything. Sooner or later, I'm sure you'll provide all the answers.