ESP-AT device name and sys store

dairequinlan
Posts: 4
Joined: Sat Feb 26, 2022 8:07 pm

ESP-AT device name and sys store

Postby dairequinlan » Sat Feb 26, 2022 8:25 pm

Hi, I've been using an ESP32 (wroom32) to provide BLE functionality for a keyboard I'm building, using the AT firmware and communicating over UART. The basic functionality works fine i.e. I can call AT+BLEHIDINIT=1 to set up BLE, and then I use AT+BLEHIDKB to send key press reports. I can pair with my phone and the keyboard works fine.

Then I started trying to finesse the implementation. First thing I did was try to set the name of the BLE device, at the moment it always comes up on any connected devices as ESP-AT-HID. I've tried changing it using AT+BLENAME to no effect, both in isolation and by using AT+BLEADVDATA before hand. The name remained the same.

Secondly, using AT+SYSSTORE to try and setup the device, and have it maintain state doesn't seem to work in the that BLEHIDINIT mode ? I have to call it every time regardless. I had hoped that I would be able to setup the device once and then from that point on just power it up into BLEHID mode and have it working.

I've logged an issue on the ESP-AT GIT previously about the operation of the HID reports (the way they work doesn't really match up with how USB HID works) but didn't get any traction on it.

My take out on this is that the BLEHIDINIT 'mode' is a kind of substandard way of getting a HID device up and running quickly, but doesn't support any of the functionality offered if you were to spin up your own descriptor and do it through a full GATT implementation? Does that make sense? I have to admit that the first thing I did was go looking for source for the AT firmware but the actual implementation for all the commands is closed, though the wrapper for the firmware is up on GIT obv.

Daire.

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP-AT device name and sys store

Postby ESP_Sun » Mon Feb 28, 2022 2:28 am

Hi,
1. The problem that your AT+BLENAME setting does not take effect is because the Bluetooth LE HID command cannot be used at the same time as the general GATT/GAP command. (AT+BLEHIDINIT https://docs.espressif.com/projects/esp ... ialization)
2. Commands Affected by the AT+SYSSTORE Command (https://docs.espressif.com/projects/esp ... store-mode):

Code: Select all

AT+SYSMSG

AT+CWMODE

AT+CIPV6

AT+CWJAP

AT+CWSAP

AT+CWRECONNCFG

AT+CIPAP

AT+CIPSTA

AT+CIPAPMAC

AT+CIPSTAMAC

AT+CIPDNS

AT+CIPSSLCCONF

AT+CIPRECONNINTV

AT+CIPTCPOPT

AT+CWDHCPS

AT+CWDHCP

AT+CWSTAPROTO

AT+CWAPPROTO

AT+CWJEAP

AT+CIPETH

AT+CIPETHMAC

AT+BLENAME

AT+BTNAME

AT+BLEADVPARAM

AT+BLEADVDATA

AT+BLEADVDATAEX

AT+BLESCANRSPDATA

AT+BLESCANPARAM

AT+BTSCANMODE
Hope the above helps you.

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP-AT device name and sys store

Postby ESP_Sun » Mon Feb 28, 2022 3:01 am

Can you provide a link to a question you raised on git about HID reporting operations?

dairequinlan
Posts: 4
Joined: Sat Feb 26, 2022 8:07 pm

Re: ESP-AT device name and sys store

Postby dairequinlan » Mon Feb 28, 2022 9:40 am

Hi, thanks for the response. Yeah I figured it was something to do with that mix of BLEHIDINIT and other GATT services not working, as I'm guessing that BLEHIDINIT just sets everything up in the background from scratch. Is there some kind of workaround to allow the device name to be set while using the BLEHIDINIT command ?

The issue I posted on the GIT repo was here https://github.com/espressif/esp-at/issues/601

I guess I should just post all these questions on the GIT repo as requests for enhancement or something ? Or just not use the BLEHIDINIT functionality and roll my own keyboard implementation from scratch through GATT, it's just a pity because the BLEHIDINIT functionality is _almosssst_ there, but not quite.

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP-AT device name and sys store

Postby ESP_Sun » Tue Mar 01, 2022 3:51 am

Hi, you can use the AT+BLEHIDNAME=<name> command to set the name of the HID, and the <name> parameter can be up to 32 bytes long, for example: AT+BLEHIDNAME="BLE-HID", this command has been supported on the ESP-AT master branch, but no documentation has been added yet.

dairequinlan
Posts: 4
Joined: Sat Feb 26, 2022 8:07 pm

Re: ESP-AT device name and sys store

Postby dairequinlan » Wed Mar 02, 2022 11:11 am

Ah, cool, good to know. Will it be included in the next ESP32 AT firmware release, v2.3.0.0_esp32 I guess ? There's no timeframe given for that on the github site though.

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP-AT device name and sys store

Postby ESP_Sun » Thu Mar 03, 2022 3:30 am

If there is no accident, v2.3.0.0_esp32 is expected to be released at the end of March this year.

ggeorge
Posts: 32
Joined: Mon Mar 07, 2022 6:00 am

Re: ESP-AT device name and sys store

Postby ggeorge » Mon Mar 07, 2022 8:52 am

The BLE name change AT command is not working.

3/3/2022 13:44:09.811 [RX] - <NUL> <CR><LF>
ready<CR><LF>

3/3/2022 13:44:54.436 [TX] - AT+GMR<CR><LF>

3/3/2022 13:44:54.439 [RX] - AT+GMR<CR><LF>
AT version:2.3.0.0(e98993f - ESP32C3 - Dec 23 2021 09:03:35)<CR><LF>
SDK version:v4.3.1-354-g98d34e5<CR><LF>
compile time(9ff1373):Dec 24 2021 11:22:05<CR><LF>
Bin version:2.3.0(MINI-1)<CR><LF>
<CR><LF>
OK<CR><LF>

3/3/2022 13:47:50.516 [TX] - AT+CMD?<CR><LF>

3/3/2022 13:47:50.519 [RX] - AT+CMD?<CR><LF>
+CMD:0,"AT",0,0,0,1<CR><LF>
+CMD:1,"ATE0",0,0,0,1<CR><LF>
+CMD:2,"ATE1",0,0,0,1<CR><LF>
+CMD:3,"AT+RST",0,0,0,1<CR><LF>
+CMD:4,"AT+GMR",0,0,0,1<CR><LF>
+CMD:5,"AT+CMD",0,1,0,0<CR><LF>
+CMD:6,"AT+GSLP",0,0,1,0<CR><LF>
+CMD:7,"AT+SYSTIMESTAMP",0,1,1,0<CR><LF>
+CMD:8,"AT+SLEEP",0,1,1,0<CR><LF>
+CMD:9,"AT+RESTORE",0,0,0,1<CR><LF>
+CMD:10,"AT+SYSRAM",0,1,0,0<CR><LF>
+CMD:11,"AT+SYSFLASH",0,1,1,0<CR><LF>
+CMD:12,"AT+RFPOWER",0,1,1,0<CR><LF>
+CMD:13,"AT+SYSMSG",0,1,1,0<CR><LF>
+CMD:14,"AT+SYSROLLBACK",0,0,0,1<CR><LF>
+CMD:15,"AT+SYSLOG",0,1,1,0<CR><LF>
+CMD:16,"AT+SYSSTORE",0,1,1,0<CR><LF>
+CMD:17,"AT+SLEEPWKCFG",0,0,1,0<CR><LF>
+CMD:18,"AT+SYSREG",0,0,1,0<CR><LF>
+CMD:19,"AT+SYSTEMP",0,1,0,0<CR><LF>
+CMD:20,"AT+USERRAM",0,1,1,0<CR><LF>
+CMD:21,"AT+USEROTA",0,0,1,0<CR><LF>
+CMD:22,"AT+CWMODE",0,1,1,0<CR><LF>
+CMD:23,"AT+CWSTATE",0,1,0,0<CR><LF>
+CMD:24,"AT+CWJAP",0,1,1,1<CR><LF>
+CMD:25,"AT+CWRECONNCFG",0,1,1,0<CR><LF>
+CMD:26,"AT+CWLAP",0,0,1,1<CR><LF>
+CMD:27,"AT+CWLAPOPT",0,0,1,0<CR><LF>
+CMD:28,"AT+CWQAP",0,0,0,1<CR><LF>
+CMD:29,"AT+CWSAP",0,1,1,0<CR><LF>
+CMD:30,"AT+CWLIF",0,0,0,1<CR><LF>
+CMD:31,"AT+CWQIF",0,0,1,1<CR><LF>
+CMD:32,"AT+CWDHCP",0,1,1,0<CR><LF>
+CMD:33,"AT+CWDHCPS",0,1,1,0<CR><LF>
+CMD:34,"AT+CWSTAPROTO",0,1,1,0<CR><LF>
+CMD:35,"AT+CWAPPROTO",0,1,1,0<CR><LF>
+CMD:36,"AT+CWAUTOCONN",0,1,1,0<CR><LF>
+CMD:37,"AT+CWHOSTNAME",0,1,1,0<CR><LF>
+CMD:38,"AT+CWCOUNTRY",0,1,1,0<CR><LF>
+CMD:39,"AT+CIFSR",0,0,0,1<CR><LF>
+CMD:40,"AT+CIPSTAMAC",0,1,1,0<CR><LF>
+CMD:41,"AT+CIPAPMAC",0,1,1,0<CR><LF>
+CMD:42,"AT+CIPSTA",0,1,1,0<CR><LF>
+CMD:43,"AT+CIPAP",0,1,1,0<CR><LF>
+CMD:44,"AT+CIPV6",0,1,1,0<CR><LF>
+CMD:45,"AT+CIPDNS",0,1,1,0<CR><LF>
+CMD:46,"AT+CIPDOMAIN",0,0,1,0<CR><LF>
+CMD:47,"AT+CIPSTATUS",0,0,0,1<CR><LF>
+CMD:48,"AT+CIPSTATE",0,1,0,0<CR><LF>
+CMD:49,"AT+CIPSTART",0,0,1,0<CR><LF>
+CMD:50,"AT+CIPSTARTEX",0,0,1,0<CR><LF>
+CMD:51,"AT+CIPTCPOPT",0,1,1,0<CR><LF>
+CMD:52,"AT+CIPCLOSE",0,0,1,1<CR><LF>
+CMD:53,"AT+CIPSEND",0,0,1,1<CR><LF>
+CMD:54,"AT+CIPSENDL",0,0,1,0<CR><LF>
+CMD:55,"AT+CIPSENDLCFG",0,1,1,0<CR><LF>
+CMD:56,"AT+CIPSENDEX",0,0,1,0<CR><LF>
+CMD:57,"AT+CIPDINFO",0,1,1,0<CR><LF>
+CMD:58,"AT+CIPMUX",0,1,1,0<CR><LF>
+CMD:59,"AT+CIPRECVMODE",0,1,1,0<CR><LF>
+CMD:60,"AT+CIPRECVDATA",0,0,1,0<CR><LF>
+CMD:61,"AT+CIPRECVLEN",0,1,0,0<CR><LF>
+CMD:62,"AT+CIPSERVER",0,1,1,0<CR><LF>
+CMD:63,"AT+CIPSERVERMAXCONN",0,1,1,0<CR><LF>
+CMD:64,"AT+CIPSSLCCONF",0,1,1,0<CR><LF>
+CMD:65,"AT+CIPSSLCCN",0,1,1,0<CR><LF>
+CMD:66,"AT+CIPSSLCSNI",0,1,1,0<CR><LF>
+CMD:67,"AT+CIPSSLCALPN",0,1,1,0<CR><LF>
+CMD:68,"AT+CIPSSLCPSK",0,1,1,0<CR><LF>
+CMD:69,"AT+CIPMODE",0,1,1,0<CR><LF>
+CMD:70,"AT+CIPSTO",0,1,1,0<CR><LF>
+CMD:71,"AT+SAVETRANSLINK",0,0,1,0<CR><LF>
+CMD:72,"AT+CIPSNTPCFG",0,1,1,0<CR><LF>
+CMD:73,"AT+CIPSNTPINTV",0,1,1,0<CR><LF>
+CMD:74,"AT+CIPSNTPTIME",0,1,0,0<CR><LF>
+CMD:75,"AT+CIPRECONNINTV",0,1,1,0<CR><LF>
+CMD:76,"AT+MQTTUSERCFG",0,0,1,0<CR><LF>
+CMD:77,"AT+MQTTCLIENTID",0,0,1,0<CR><LF>
+CMD:78,"AT+MQTTUSERNAME",0,0,1,0<CR><LF>
+CMD:79,"AT+MQTTPASSWORD",0,0,1,0<CR><LF>
+CMD:80,"AT+MQTTCONNCFG",0,0,1,0<CR><LF>
+CMD:81,"AT+MQTTALPN",0,0,1,0<CR><LF>
+CMD:82,"AT+MQTTCONN",0,1,1,0<CR><LF>
+CMD:83,"AT+MQTTPUB",0,0,1,0<CR><LF>
+CMD:84,"AT+MQTTPUBRAW",0,0,1,0<CR><LF>
+CMD:85,"AT+MQTTSUB",0,1,1,0<CR><LF>
+CMD:86,"AT+MQTTUNSUB",0,0,1,0<CR><LF>
+CMD:87,"AT+MQTTCLEAN",0,0,1,0<CR><LF>
+CMD:88,"AT+HTTPCLIENT",0,0,1,0<CR><LF>
+CMD:89,"AT+HTTPGETSIZE",0,0,1,0<CR><LF>
+CMD:90,"AT+HTTPURLCFG",0,1,1,0<CR><LF>
+CMD:91,"AT+HTTPCGET",0,0,1,0<CR><LF>
+CMD:92,"AT+HTTPCPOST",0,0,1,0<CR><LF>
+CMD:93,"AT+BLEINIT",0,1,1,0<CR><LF>
+CMD:94,"AT+BLEADDR",0,1,1,0<CR><LF>
+CMD:95,"AT+BLENAME",0,1,1,0<CR><LF>
+CMD:96,"AT+BLEADVPARAM",0,1,1,0<CR><LF>
+CMD:97,"AT+BLEADVDATA",0,1,1,0<CR><LF>
+CMD:98,"AT+BLEADVDATAEX",0,1,1,0<CR><LF>
+CMD:99,"AT+BLEADVSTART",0,0,0,1<CR><LF>
+CMD:100,"AT+BLEADVSTOP",0,0,0,1<CR><LF>
+CMD:101,"AT+BLESCANRSPDATA",0,1,1,0<CR><LF>
+CMD:102,"AT+BLEGATTSSRVCRE",0,0,0,1<CR><LF>
+CMD:103,"AT+BLEGATTSSRVSTART",0,0,1,1<CR><LF>
+CMD:104,"AT+BLEGATTSSRVSTOP",0,0,1,1<CR><LF>
+CMD:105,"AT+BLEGATTSSRV",0,1,0,0<CR><LF>
+CMD:106,"AT+BLEGATTSCHAR",0,1,0,0<CR><LF>
+CMD:107,"AT+BLEGATTSNTFY",0,0,1,0<CR><LF>
+CMD:108,"AT+BLEGATTSIND",0,0,1,0<CR><LF>
+CMD:109,"AT+BLEGATTSSETATTR",0,0,1,0<CR><LF>
+CMD:110,"AT+BLESCANPARAM",0,1,1,0<CR><LF>
+CMD:111,"AT+BLESCAN",0,0,1,0<CR><LF>
+CMD:112,"AT+BLECONNPARAM",0,1,1,0<CR><LF>
+CMD:113,"AT+BLECONN",0,1,1,0<CR><LF>
+CMD:114,"AT+BLEDISCONN",0,0,1,1<CR><LF>
+CMD:115,"AT+BLEDATALEN",0,0,1,0<CR><LF>
+CMD:116,"AT+BLECFGMTU",0,1,1,0<CR><LF>
+CMD:117,"AT+BLEGATTCPRIMSRV",0,0,1,0<CR><LF>
+CMD:118,"AT+BLEGATTCINCLSRV",0,0,1,0<CR><LF>
+CMD:119,"AT+BLEGATTCCHAR",0,0,1,0<CR><LF>
+CMD:120,"AT+BLEGATTCRD",0,0,1,0<CR><LF>
+CMD:121,"AT+BLEGATTCWR",0,0,1,0<CR><LF>
+CMD:122,"AT+BLESPPCFG",0,1,1,0<CR><LF>
+CMD:123,"AT+BLESPP",0,0,0,1<CR><LF>
+CMD:124,"AT+BLESECPARAM",0,1,1,0<CR><LF>
+CMD:125,"AT+BLEENC",0,0,1,0<CR><LF>
+CMD:126,"AT+BLEENCRSP",0,0,1,0<CR><LF>
+CMD:127,"AT+BLEKEYREPLY",0,0,1,0<CR><LF>
+CMD:128,"AT+BLECONFREPLY",0,0,1,0<CR><LF>
+CMD:129,"AT+BLESETKEY",0,1,1,0<CR><LF>
+CMD:130,"AT+BLEENCDEV",0,1,0,0<CR><LF>
+CMD:131,"AT+BLEENCCLEAR",0,0,1,1<CR><LF>
+CMD:132,"AT+BLEEXTADVPARAM",0,1,1,0<CR><LF>
+CMD:133,"AT+BLEEXTADVDATA",0,1,1,0<CR><LF>
+CMD:134,"AT+BLEEXTSCANRSP",0,1,1,0<CR><LF>
+CMD:135,"AT+BLEEXTADVSTART",0,0,0,1<CR><LF>
+CMD:136,"AT+BLEEXTADVSTOP",0,0,0,1<CR><LF>
+CMD:137,"AT+BLEEXTSCANPARAM",0,1,1,0<CR><LF>
+CMD:138,"AT+BLEEXTSCAN",0,0,1,0<CR><LF>
+CMD:139,"AT+BLEAUXCONN",0,1,1,0<CR><LF>
+CMD:140,"AT+BLEHIDNAME",0,1,1,0<CR><LF>
+CMD:141,"AT+BLEHIDINIT",0,1,1,0<CR><LF>
+CMD:142,"AT+BLEHIDKB",0,0,1,0<CR><LF>
+CMD:143,"AT+BLEHIDMUS",0,0,1,0<CR><LF>
+CMD:144,"AT+BLEHIDCONSUMER",0,0,1,0<CR><LF>
+CMD:145,"AT+BLUFINAME",0,1,1,0<CR><LF>
+CMD:146,"AT+BLUFI",0,1,1,0<CR><LF>
+CMD:147,"AT+MDNS",0,0,1,0<CR><LF>
+CMD:148,"AT+WPS",0,0,1,0<CR><LF>
+CMD:149,"AT+CWSTARTSMART",0,0,1,1<CR><LF>
+CMD:150,"AT+CWSTOPSMART",0,0,0,1<CR><LF>
+CMD:151,"AT+PING",0,0,1,0<CR><LF>
+CMD:152,"AT+CIUPDATE",0,1,1,1<CR><LF>
+CMD:153,"AT+FACTPLCP",0,0,1,0<CR><LF>
+CMD:154,"AT+UART",0,1,1,0<CR><LF>
+CMD:155,"AT+UART_CUR",0,1,1,0<CR><LF>
+CMD:156,"AT+UART_DEF",0,1,1,0<CR><LF>
<CR><LF>
OK<CR><LF>

3/3/2022 13:49:04.853 [TX] - AT+UART_CUR?<CR><LF>

3/3/2022 13:49:04.857 [RX] - AT+UART_CUR?<CR><LF>
+UART_CUR:115201,8,1,0,1<CR><LF>
<CR><LF>
OK<CR><LF>

3/3/2022 13:50:17.704 [TX] - AT+SYSRAM?<CR><LF>

3/3/2022 13:50:17.707 [RX] - AT+SYSRAM?<CR><LF>
+SYSRAM:186684,182632<CR><LF>
OK<CR><LF>

3/3/2022 13:52:07.472 [TX] - AT+BLENAME?<CR><LF>

3/3/2022 13:52:07.478 [RX] - AT+BLENAME?<CR><LF>
+BLENAME:ESP-AT<CR><LF>
<CR><LF>
OK<CR><LF>

3/3/2022 13:52:59.468 [TX] - AT+BLENAME=TRIMBLE_BLE<CR><LF>

3/3/2022 13:52:59.473 [RX] - AT+BLENAME=TRIMBLE_BLE<CR><LF>
<CR><LF>
ERROR<CR><LF>

3/3/2022 13:53:36.687 [TX] - AT+BLENAME=TRIMBLEBLE<CR><LF>

3/3/2022 13:53:36.691 [RX] - AT+BLENAME=TRIMBLEBLE<CR><LF>
<CR><LF>
ERROR<CR><LF>

Kindly help me with this issue.

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP-AT device name and sys store

Postby ESP_Sun » Mon Mar 07, 2022 9:45 am

Before setting ble name, you need to initialize ble(AT+BLEINIT)

Who is online

Users browsing this forum: No registered users and 15 guests