Busy Tag USB CDC Command Reference Guide

This article provides an overview of various USB CDC (Communications Device Class) commands for the Busy Tag device. It details "Get Commands" for retrieving device information, "Set/Get Commands" for configuring device settings, and "Action Commands" for performing operations such as file management and device resets.


1. Overview

Table 1: Command descriptions

Note 1: Added in Firmwarev0.8

Note 2: Added in Firmwarev1.1


2.  Get Commands

Returns string data. Each response ends with “\r\n”.

AT+GDN

Description:

This command gets device name.


Default:

Determined by hardware.


Command example:

AT+GDN


Response example:

+DN:busytag-653574\r\n


AT+GMN

Description:

This command gets the device manufacture name.


Default:

+MN:GREYNUT LTD


Command example:

AT+GMN


Response example:

+MN:GREYNUT LTD\r\n


AT+GID

Description:

This command gets device ID. Returns data in hex string format.


Default:

Determined by hardware.


Command example:

AT+GID


Response example:

+ID:F412FA653574\r\n


AT+GFV

Description:

This command gets device firmware version.


Default:

Determined by firmware.


Command example:

AT+GFV


Response example:

+FV:0.5\r\n


AT+GPL

Description:

This command gets a list of pictures that is stored in device FAT storage. Return structure: +PL:<name>,<size>


Default:

Determined by firmware.


Command example:

AT+GPL


Response example:

+PL:BTS0005.png,5157\r\n

+PL:BTS0004.png,5182\r\n

+PL:BTS0007.png,4355\r\n

OK\r\n


AT+GFL

Description:

This command gets a list of files that is stored in device FAT storage. Return structure: +FL:<name>,<type>,<size>


Default:

Determined by firmware.


Command example:

AT+GFL


Response example:

+FL:System Volume Information,dir,0\r\n

+FL:readme.txt,file,120\r\n

+FL:wifi_config.json,file,40\r\n

+FL:config.json,file,1362\r\n

+FL:BTS0005.png,file,5157\r\n

+FL:BTS0004.png,file,5182\r\n

+FL:BTS0007.png,file,4355\r\n

OK\r\n


AT+GLHA

Description:

This command gets the device’s local host address. Return structure: +LHA:<local_address>


Default:

Determined by firmware.


Command example:

AT+GFL


Response example:

+LHA:http://busytag-653574.local\r\n


AT+GFSS

Description:

This command gets the device's free storage size inbytes. Return structure: +FSS:<size>


Default:

Determined by firmware.


Command example:

AT+GFSS


Response example:

+FSS:3039232\r\n


AT+GTSS

Description:

This command gets the device's free storage size in bytes. Return structure: +TSS:<size>


Default:

Determined by firmware.


Command example:

AT+GTSS


Response example:

+TSS:3080192\r\n


AT+GLEC(1)

Description:

This command gets the last CDC commands error code. Error code descriptions are in Table 3. Return structure: +LEC:<code>


Default:

+LEC:-1\r\n


Command example:

AT+GLEC


Response example:

+LEC:-1\r\n


Note 1: Added in Firmwarev0.8


AT+GLRR0(1)

Description:

This command gets the last reset reason for core 0.Reset reason descriptions are in Table 4. Return structure: +LRR0:<code>


Default:

+LRR0:1\r\n


Command example:

AT+GLRR0


Response example:

+LRR0:1\r\n


AT+GLRR1(1)

Description:

This command gets the last reset reason for core 1.Reset reason descriptions are in Table 4. Return structure: +LRR1:<code>


Default:

+LRR1:1\r\n


Command example:

AT+GLRR1


Response example:

+LRR1:1\r\n


Note 1: Added in Firmwarev1.1



3.  Set/Get Commands


This group of commands is used to configure specific functions of the Busy Tag device. The Set commands start with the letters “AT+” and are followed by additional letters as the command identifier. The Set command parameters are mandatory and are separated from the command by a comma.


Set command format

“AT+”

Command Identifier

“=”

Input Parameter

“,”

Input Parameter


The Get commands start with the letters “AT+” and are followed by additional letters as the command identifier and will end with the “?” character.


Get command format

“AT+”

Command Identifier

“?”



AT+SC

Description:

This command sets/gets a solid color. The set command has two parameters. The first parameter represents the LED element ID. It uses binary logic addresses for LED identification. For example, 127(0b01111111)will address all device LEDs. The device has a total of 7 LED elements. For example, to set solid color only for the first two LEDs, need to set the parameter to 3(0b00000011). The second parameter is RGB color in hexadecimalformat. Set LED command structure: AT+SC=<led_pins>,<color>. Get return structure: +SC:<led_pins>,<color>.


Default:

Determined by firmware.


Get command example:

AT+SC?


Get response example:

+SC:127,990000\r\n

OK\r\n

Set command example:

AT+SC=127,FF0000


Set response example:

OK\r\n


AT+CP

Description:

This command sets/gets custom color pattern array.  To set pattern it has specific command routine.

On the first command need to send basic information of file: AT+CP=<pattern_line_count>.

After successful command sending should return “>\r\n” response, after that can be send pattern lines:+CP:<led_pins>,<color>,<speed>,<delay>\r\n. If pattern line sending is successful receive response with “OK” command. Max pattern line size is 40.


Default:

Determined by firmware.


Get command example:

AT+CP?


Get response example:

+CP:127,1291AF,100,0\r\n

+CP:127,FF0000,100,0\r\n

OK\r\n


First set command part example:

AT+CP=3


Set response example on first part:

>\r\n


Second set command part example (pattern lines):

+CP:127,1291AF,100,0\r\n

+CP:127,FF0000,100,0\r\n

+CP:127,1291AF,100,0\r\n


Set response example on second part:

\r\nOK\r\n


AT+DB

Description:

This command sets/gets display brightness. <brightness> value range 1-100. Get return structure: +DB:<brightness>


Default:

Determined by firmware.


Get command example:

AT+DB?


Get response example:

+DB:100\r\n


Set command example:

AT+DB=100


Set response example:

OK\r\n


AT+SAD

Description:

This command sets/gets show after drop flag.<flag> value range 0-1. Get return structure: +SAD:<flag>.


Default:

Determined by firmware.


Get command example:

AT+SAD?


Get response example:

+SAD:1\r\n


Set command example:

AT+SAD=1


Set response example:

OK\r\n


AT+AWFS

Description:

This command sets/gets allow web file server flag.<flag> value range 0-1. Get return structure: +AWFS:<flag>.


Default:

Determined by firmware.


Get command example:

AT+AWFS?


Get response example:

+AWFS:1\r\n


Set command example:

AT+AWFS=1


Set response example:

OK\r\n


Note: If the flag is set, it will automatically disable USB communication and activate the local webserver.


AT+WC

Description:

This command sets/gets Wi-Fi config. Set command structure: AT+WC=<ssid>,<password>. For each parameter max 32characters. Get return structure: +WC:<ssid>,<password>.


Default:

Determined by firmware.


Get command example:

AT+WC?


Get response example:

+WC:ssid,password\r\n


Set command example:

AT+WC=ssid,password


Set response example:

OK\r\n


AT+UMSA

Description:

This command sets/gets USB mass storage flag.<flag> value range 0-1. Get return structure: +UMSA:<flag>.


Default:

Determined by firmware.


Get command example:

AT+UMSA?


Get response example:

+UMSA:1\r\n


Set command example:

AT+UMSA=1


Set response example:

OK\r\n


AT+SP

Description:

This command sets/gets showing picture. Get return structure: AT+SP=<file_name>.


Default:

+SP:def.png\r\n


Get command example(1):

AT+SP?


Get response example:

+SP:BTS0006.png\r\n


Set command example:

AT+SP=BTS0006.png


Set response example:

OK\r\n


Note 1: Added in Firmwarev0.8



AT+AASS(1)

Description:

This command sets/gets allowed auto storage scan flag.<flag> value range 0-1. Get return structure: +AASS:<flag>.


Default:

+AASS:1\r\n


Get command example:

AT+AASS?


Get response example:

+AASS:1\r\n


Set command example:

AT+AASS=1


Set response example:

OK\r\n


Note 1: Added in Firmwarev0.8


4.  Actions


AT+GF

Description:

This command activates the process to get file from device mass storage.


Command example:

AT+GF=wifi_config.json


Response example:

+GF:wifi_config.json,33\r\n

\r\n

{"ssid":"ssid","pass":"password"}\r\n

OK\r\n


AT+UF

Description:

This command activates a process to upload files into device mass storage. It has a specific command routine. On the first command need to send basic information of file: AT+UF=<file_name>,<file_size>.

After successful command sending should return “>\r\n” response, after that can be send file content. If file sending is successful receive response with “OK” command. Max file size for upload is 1MB.


First command part example:

AT+UF=wifi_config.json,33


Response example on first part:

>\r\n


Second command part example (content of file):

{"ssid":"ssid","pass":"password"}


Response example on second part:

\r\nOK\r\n


AT+DF

Description:

This command activates the process to get file from device mass storage.


Command example:

AT+DF=BTS0002.png


Response example:

+DF:BTS0002.png,2922\r\n

OK\r\n


AT+RST

Description:

This command restarts the device.


Command example:

AT+RST


Response example:

OK\r\n


AT+FD

Description:

This command activates the process to format device mass storage. After formatting the storage device will restart.


Command example:

AT+FD


Response example:

OK\r\n


AT+AFSS

Description:

This command activates file storage scan. On file storage scan initialize def files, checks if has new firmware bin file.


Command example:

AT+AFSS


Response example:

OK\r\n


AT+FRMCF(1)

Description:

This command activates factory reset for main config file.


Command example:

AT+FRMCF


Response example:

OK\r\n


AT+FRWCF(1)

Description:

This command activates factory reset for Wi-Fi config file.


Command example:

AT+FRWCF


Response example:

OK\r\n


Note 1: Added in Firmware v1.1




AT+FRDI(1)

Description:

This command activates factory reset for default image.


Command example:

AT+FRDI


Response example:

OK\r\n


Note 1: Added in Firmware v1.1


5. Event Commands

Table 2: Event overview

Event Name

Description

+evn:SP

Showing picture event

+evn:FU

Firmware updating event

+evn:PP

Playing pattern event

+evn:WIS

Writing in storage event

Event format

“+evn:”

Event Identifier

“,”

Additional Parameter

+evn:SP

Description:

Showing picture event. An additional parameter is image name, which is starting to display.


Event example:

+evn:SP,BTS0002.png


+evn:FU

Description:

Firmware updating event. An additional parameter represents the percentage stage of the updating process.


Event example:

+evn:FU,9.12%


+evn:PP

Description:

Playing pattern event. An additional parameter represents the state of LEDs: 1- playing pattern; 0- stopped to play pattern and showing solid color.


Event example:

+evn:PP,1


+evn:WIS

Description:

Writing in storage event.  An additional parameter represents the state of storage: 1- writing in storage; 0- stopped to write in storage.


Event example:

+evn:WIS,1

6. Command Error Codes


Errors are received in format:“ERROR:<error_code>\r\n”.

Table 3: Error code descriptions

Error code

Description

-1

None

0

Unknown error

1

Unknown command

2

Invalid argument

3

File not found

4

Invalid size


Table 4: Reset reason descriptions

Error code

Description

1

Power on reset

3

Software resets the digital core

5

Deep sleep reset the digital core

6

SDIO module resets the digital core

7

Main watch dog 0 resets digital core

8

Main watch dog 1 resets digital core

9

RTC watch dog resets digital core

11

Main watch dog resets CPU

12

Software resets CPU

13

RTC watch dog resets CPU

14

CPU0 resets CPU1

15

Reset when the VDD voltage is not stable

16

RTC watch dog resets digital core and rtc module

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us