# Unsupported operating mode: AT mode

**URL:** <https://forums.digi.com/t/unsupported-operating-mode-at-mode/21727>\
**Category:** XBee Programamble (S2C & 900 HP)\
**Tags:** api-mode, xbee-java-library, xbee\
**Created:** [August 31, 2020, 6:26am UTC](https://forums.digi.com/t/unsupported-operating-mode-at-mode/21727 "2020-08-31T06:26:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark9806](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Mark9806](https://forums.digi.com/u/Mark9806)\
**Post date:** [August 31, 2020, 6:26am UTC](https://forums.digi.com/t/unsupported-operating-mode-at-mode/21727/1 "2020-08-31T06:26:08Z")

</div>

When i use XBee Java Library User Guide.  
I use the code to test my Xbee.

the code is here(the same with the code in pdf) and i find something strange。

package com.digi.xbee.example;  
import com.digi.xbee.api.WiFiDevice;  
import com.digi.xbee.api.XBeeDevice;  
import com.digi.xbee.api.exceptions.XBeeException;  
import com.digi.xbee.api.models.XBeeProtocol;  
public class MainApp {  
/\* Constants \*/  
// TODO Replace with the port where your sender module is connected to.  
private static final String PORT = “COM5”;  
// TODO Replace with the baud rate of your sender module.  
private static final int BAUD\_RATE = 9600;  
private static final String DATA\_TO\_SEND = “Hello XBee World!”;  
public static void main(String[] args) {  
XBeeDevice myDevice = new XBeeDevice(PORT, BAUD\_RATE);  
byte[] dataToSend = DATA\_TO\_SEND.getBytes();  
try {  
myDevice.open();  
byte[] sleepTime = myDevice.getParameter(“SP”);  
System.out.println(sleepTime[0]);  
System.out.format(“Sending broadcast data: ‘%s’”, new String  
(dataToSend));  
if (myDevice.getXBeeProtocol() == XBeeProtocol.XBEE\_WIFI) {  
myDevice.close();  
myDevice = new WiFiDevice(PORT, BAUD\_RATE);  
myDevice.open();  
((WiFiDevice)myDevice).sendBroadcastIPData(0x2616, dataToSend);  
} else  
myDevice.sendBroadcastData(dataToSend);  
System.out.println(" \>\> Success");  
} catch (XBeeException e) {  
System.out.println(" \>\> Error");  
e.printStackTrace();  
System.exit(1);  
} finally {  
myDevice.close();  
}  
}  
}

when i connect my xbee with a arduino uno R3,i got this :  
SLF4J: Class path contains multiple SLF4J bindings.  
SLF4J: Found binding in [jar:file:/C:/Users/lenovo/eclipse-workspace/myFirstXBeeApp/libs/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: Found binding in [jar:file:/C:/Users/lenovo/eclipse-workspace/myFirstXBeeApp/libs/slf4j-nop-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: Found binding in [jar:file:/C:/Users/lenovo/eclipse-workspace/myFirstXBeeApp/libs/slf4j-simple-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: See [http://www.slf4j.org/codes.html#multiple\_bindings](http://www.slf4j.org/codes.html#multiple_bindings) for an explanation.  
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]  
八月 31, 2020 7:26:44 下午 com.digi.xbee.api.AbstractXBeeDevice open  
信息: [COM5 - 9600/8/N/1/N] Opening the connection interface…  
八月 31, 2020 7:26:44 下午 com.digi.xbee.api.AbstractXBeeDevice open  
信息: [COM5 - 9600/8/N/1/N] Connection interface open.  
八月 31, 2020 7:26:49 下午 com.digi.xbee.api.AbstractXBeeDevice close  
信息: [COM5 - 9600/8/N/1/N] Connection interface closed.  
\>\> Errorcom.digi.xbee.api.exceptions.InvalidOperatingModeException: Unsupported operating mode: AT mode

```
at com.digi.xbee.api.AbstractXBeeDevice.open(AbstractXBeeDevice.java:3153)
at com.digi.xbee.api.XBeeDevice.open(XBeeDevice.java:135)
at com.digi.xbee.example.MainApp.main(MainApp.java:18)

```

i DO determine that my xbee is in API mode.And the interesting thing is that i also have a arduino board without chip(so it can not upload program in arduino).When i use this borken board,this code can run well,and i can receive “Hello XBee World” from XCTU.

Does anyone have a similar problem？Can anyone give me some advice?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [September 4, 2020, 10:04am UTC](https://forums.digi.com/t/unsupported-operating-mode-at-mode/21727/2 "2020-09-04T10:04:21Z")

</div>

This sounds like you are not getting to COM port that the XBee is connected to. You may need to run some jumpers on you board to connect the two.
