Xbee and Arduino acting strangely regardless of code - arduino

I'm trying to write a simple code that sends a string to an xbee and one that sends the string back, I was able to do this with XCTU via console, but I want my arduino to send the string.
I was able to use a simple code that read my output from the serial monitor and sends it to an xbee connected via usb adapter, the problem is that I now wrote the code so it sends a predefined string like in the screenshot, but when I write into the monitor it still sends whatever I wrote instead of the static string. I'm also unable to read what I type into the xbee console from XCTU.
I'd love any assistance in this, I've tried uploading and resetting everything to no avail.
Screenshot of problem with the current code of the arduino on the left

You said you were using an Arduino to try to communicate with your XBee Zigbee module.
One thing you have to check is the connection between the TX and RX signals on the Arduino side and on the XBee Zigbee side.
I've helped someone on another forum who used this Seed Studio XBee shield :
If you look at the schematics of this shield, the XBee 'DOut' signal (Tx) is wired to the XB_TX line which can be connected to any of the AJ2 pin with a jumper.
Now on the Arduino side :
On this extract of the Arduino schematics, we can see that the ATMEGA UART has it's RX signal connected to pin 2 of the CPU which is wired to the IOL (AJ2) pin 0.
So, that means that on this shield, the jumper have to be placed between XB_TX and pin 0 of AJ2 to connect the XBee transmission signal (output) to the ATMEGA reception signal (input) [and also XB_RX have to be connected pin 1 of AJ2].
As you didn't mention what kind of shield you were using, you have to double check this point which is a common issue when using serial communication.
In a general way, ALWAYS connect 1 output to N input (except open-drain or open-collector outputs which can be connected together to make a wired OR but which finally have to be connected to N inputs)
Hope this helps
Best regards

From what I can tell on the documentation Xbee "hijacks" the serial system. Instead try blinking an LED to confirm data is being received and sent.
documentation

Related

USB connection to move a Servo Motor

I want to know how to connect a phone to an arduino via usb and then have a servo motor move once the arduino recognizes that it is a phone. I'm very very new to arduino but I think it is an arduino uno.
We haven't tried anything yet because we don't know if out school has the proper hardware. Any guidance would be greatly appreciated.
There isn't a way for the Arduino to just "know" what it's connected to. The USB connection is handled with the USB to TTL converter on the board and thats what the computer sees. The rest of the Arduino board is simply rxing or txing serial data if there is any and there wont be unless you send something. You would have to send some serial data from the phone using an app to identify the phone.
If you give more detail, then maybe we can figure out some other way to solve the problem.

FTDI + ESP8266 [Need to use AT Commands] without Arduino

I am trying to write standalone ESP8266 code so that it can communicate to wifi and change its states. For this, what I want to do is to send some command "AT+CWMODE=1" or "AT+CWMODE=3" to ESP8266 via code and toggle them on push button tap.
So, like in Arduino there is a Serial.write which writes on a serial monitor via SoftwareSerial class.
But when I am sending Serial.write("AT+CWMODE=1") it prints on the monitor as a string rather than changing the wifi state.
Is there a way to send AT commands without using Arduino chip software serial pins?
Thanks.
Sorted out the issue. All those who are new like me to ESP world, I did the serial.write "AT" commands using wifi classes of Esp8266.
You need to connect the board as ESP8266 Generic Module and send/receive data using ESP8266Wifi class, by reading the scanned networks, changing mode, using Serial.read on the connected devices on Access point of Esp8266.
Let me know if someone need help on this future, I will be happy to help.

How to Control LED with NRF24l01 And arduino

I have a nrf24l01+PA+LNA .also i have arduino mega and nano boards. I try some arduino projects with it . but i cannot found a project which is working.Also i could not understand my nrf circuit is working.
Can anyone please give me a arduino code?
First you need to check the baud rate of your NRF24L01 and arduino are they both same? to check your arduino and nrf ckt perform this test :
Write Operation
1st send Read signal , register address of nrf , and then the value you have to write.Write operation will be done through SPI port of arduino.
Read Operation
1st send Write Signal , register address of nrf then wait for arduino to output the register value.
If written and read values are same then congratulations you have configured them both correctly and your circuit is working.
You can also look at :
https://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

Rs232 arduino issue

I have a little confusing about arduino uno. I use Serial.print("hi") code then it "hi" appears on the serial monitor. I also use rs232/ttl converter which are connected pin 1 and 0 on the arduino properly.
Then I realize that when serial.print("hi") working the data first is going through usb cable. But I want the data has to go through tx rx pins which are 1 and 0.
But when I enter some data from serial monitor , rs232/ttl will work and some data will be sended ?
I do not understand the situation?
Why this is happening ? I just want to sent a data from pin 1 and 0 using rs232/ttl converter.
How can I do that ? I do not use usb cable to sent datas.
If you see the data coming from and to your PC by default USB port, then you ARE using pin 0 and 1.
If you correctly connect an extenal converster, you should be able to read exactly the same thing, if not, connection are wrong. Classic error is to switch TX and RX, as they have to be crossed.
Also remeber that RS232 does not support multiple host, but normally give no problem if the "others host" are just reading, as they will simply sniff the connection.

What is the cause of "stk500_getsync(): not in sync: resp=0x00" in Arduino

I was using Arduino Uno to build a robot, but suddenly this error (stk500_getsync(): not in sync: resp=0x00) occurred. I tried a lot, searched on the net, to fix this error, but no solution worked for me. At last I bough 2 new Arduinos. But each of those 2 Arduinos ran few days correctly and after a few days gave the same error.
I was, and am, unable to find what causes this error. Can anyone kindly tell what could be the mistake I may be doing?
This has happened when the COM port is not correctly selected. Determine the COM port used to communicate with Arduino and set in in the IDE, then recompile the sketch.
I just found the reason from this link
of this error.
There are a TON of pages out there on how to solve this error. The problem is none of them worked for me. The typical solutions range from not having the correct serial port or correct Arduino model board selected under the Tools menu in the Arduino software, to not having a driver (or the correct driver) loaded.
However, the frustating part for me is I KNEW I had the correct serial port and board and driver selected because I was getting output from a sketch scrolling in the Serial Monitor window via a USB connection.
The fix? DISCONNECT ANY WIRES going to pin 0 (RX) while you do the upload. The sketch upload function uses the RX pin.
NOTE: You also need to disconnect any wires going to pin 0 (RX) if you have a sketch with a Serial.read() or Serial.peek() statement, and you want to use the Serial Monitor input field (as shown using the '752' in the example below) to feed data into the running sketch. If you don't disconnect pin 0 it will appear as if your data was entered into your sketch but nothing will happen because the data never truly gets input.
It's looks like there is no connection between PC and Arduino. Possible reasons: Something wrong with USB port OR driver, USB wire, ATMega16 controller, ATMega328 UART or bootloader. First, try to check, if data from Serial Port reaches Arduino. Pull ATMEGA from socket, short-circuit pins RX and TX on Arduino board (pins 0 and 1), and send some data from PC. You should receive exactly same string, as you sent. Also you should se RX TX LED's blinking. If you can't see data back, check if serial port you are using are actually exist in device manager, try to play with it's settings (speed, port numer), try to use another USB port and cable, etc.
I was having the same issue. But for me no led was lighting up on connection and the error observed was the same as yours. I fixed this by changing jumper pin configuration from ext to usb . You can try the same settings by altering the jumper pins between power jack and usb jack.

Resources