Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

Trying out the AT Style Commands on your 32u4 Bluefruit LE Feather

Contents

Do you know what AT Commands are? Want to use these serial commands for your Bluetooth applications? See the rest of the article to find out.

Introduction

Your Adafruit Bluetooth module probably uses an AT-style command set to define its functions and execute operations. Using AT-style commands makes things easy, as you can easily switch between command and data mode. Command mode commands includes resetting the device, turning your module into an HID-compatible wireless keyboard or mouse, checking radio signal levels, and even doing ADC conversions or checking the die temperature. Data mode turns your module into a wireless UART module. You can send serial data uninterrupted to and from your devices.

 

The AT-style commands originated from the command set made by Dennis Hayes for his Hayes Smarmodem. There are two modes for the Hayes AT communication style: command mode and data mode. Command mode, as its name implies, sends commands to the receiving modem.  On the other hand, data mode treats the sent or received signals entirely as data on the phone line. Adafruit copies this AT-style feature to operate their BLE UART Modules.

Try it Out

Set up your 32u4 Adafruit Bluefruit LE Feather by connecting it to your PC with a micro USB cable. You’ll also want to download the Bluefruit LE Connect app on your smartphone. Before anything else, see this previous blog to setup your 32u4 Bluefruit LE correctly.

Program your Feather with the atcommand example program

Yes, you can do so much more with the AT commands. These commands come from the ATmega32u4 and reach its destination, the nRF51822 BLE module. The connection between the two chips is serial in nature (hardware SPI in this case) and the nRF51822 chip has been programmed to respond to the AT commands accordingly.

First, download the atcommand example code for the Bluefruit nRF51.

Go ahead and download the code to your Feather. After this, open your serial monitor. Upon a reset, you should immediately see some BLE info and the AT> serial prompt.

Ready to Type Those AT Commands

There are several categories of AT commands which include Standard AT, General Purpose AT, Hardware, Beacon, BLE Generic, BLE Services, BLE GAP, BLE GATT, and Debug. The first thing we can do is to simply ping check AT command mode through the Standard AT command AT.

				
					AT > AT


<- OK
AT > 
				
			

Next, let’s try a factory reset by issuing a General Purpose command AT+FACTORYRESET

				
					<- OK
AT > AT+FACTORYRESET


<- OK
AT > 
				
			

If you want to see all the available AT commands for your system, issue the AT+HELP command.

				
					<- OK
AT > AT+HELP


<- +++,ATZ,ATI,ATE,AT+HELP,AT+FACTORYRESET,AT+DFUIRQ,AT+DFU,AT+MODESWITCHEN,AT+DBGMEMRD,AT+DBGNVMRD,AT+DBGSTACKSIZE,AT+DBGSTACKDUMP,AT+NVMWRITE,AT+NVMREADRAW,AT+NVMREAD,AT+BAUDRATE,AT+UARTFLOW,AT+HWMODELED,AT+HWCONNLED,AT+HWRANDOM,AT+HWGETDIETEMP,AT+HWGPIOMODE,AT+HWGPIO,AT+HWI2CSCAN,AT+HWADC,AT+HWVBAT,AT+HWPWM,AT+HWPWRDN,AT+BLEPOWERLEVEL,AT+BLEGETADDRTYPE,AT+BLEGETADDR,AT+BLEGETPEERADDR,AT+BLEGETRSSI,AT+BLEBEACON,AT+BLEURIBEACON,AT+EDDYSTONEURL,AT+EDDYSTONESERVICEEN,AT+EDDYSTONECONFIGEN,AT+EDDYSTONEBROADCAST,AT+GAPGETCONN,AT+GAPDISCONNECT,AT+GAPCONNECTABLE,AT+GAPDEVNAME,AT+GAPDELBONDS,AT+GAPINTERVALS,AT+GAPSTARTADV,AT+GAPSTOPADV,AT+GAPAUTOADV,AT+GAPSETADVDATA,AT+BLEUARTTXF,AT+BLEUARTTX,AT+BLEUARTRX,AT+BLEUARTFIFO,AT+BLEBATTEN,AT+BLEBATTVAL,AT+BLEHIDEN,AT+BLEKEYBOARDEN,AT+BLEHIDCONTROLKEY,AT+BLEKEYBOARDCODE,AT+BLEKEYBOARD,AT+BLEHIDMOUSEMOVE,AT+BLEHIDMOUSEBUTTON,AT+BLEHIDGAMEPADEN,AT+BLEHIDGAMEPAD,AT+GATTADDSERVICE,AT+GATTADDCHAR,AT+GATTCHARRAW,AT+GATTCHAR,AT+GATTLIST,AT+GATTCLEAR,AT+BLEMIDIEN,AT+BLEMIDITX,AT+BLEMIDIRXRAW,AT+BLEMIDIRX,AT+EVENTENABLE,AT+EVENTDISABLE,AT+EVENTSTATUS
OK
AT > 
				
			

Next, let’s try some hardware features. Let’s try to toggle the LED on the BLE module. We can do this through the command AT+HWMODELED=MANUAL,TOGGLE

				
					OK
AT > AT+HWMODELED=MANUAL,TOGGLE


<- OK
AT > AT+HWMODELED=MANUAL,TOGGLE


<- OK
AT > 
				
			

You should be able to see the RED LED of the BLE Module toggle for each command.

Now comes the interesting part where you’ll be able to communicate with your smartphone. First, run the Bluefruit Connect app on your phone and connect to your Bluefruit Feather.

After that, under Modules, tap UART. You’re now in UART mode with your Bluefruit LE Feather.

Change Command Mode to Data Mode on your Feather

Go back to your Serial Monitor in Arduino and switch the AT mode to data mode. To do this, simply shortcut with the +++ command. You’ll be able to switch back and forth between data and command mode by entering +++ repeatedly.

Go ahead and type on the Serial Console and you’ll be able to see this text on your smartphone.

Conclusion

This concludes our AT command sessions with the 32u4 Bluefruit LE Feather. If you’d like to explore some more interesting articles regarding the Adafruit Feather, be sure to search our blog section for more.

SUBSCRIBE FOR NEW POST ALERTS

Subscribe to be the first to know when we publish a new article!
List Subscriptions(Required)

POPULAR POSTS

Scroll to Top