How to enable AT interface in your programs ?

Posts: 1
Joined: Thu Aug 03, 2017 8:42 pm

How to enable AT interface in your programs ?

Postby dniekowal » Thu Aug 03, 2017 9:15 pm


I am using esp-open-sdk.

AT commands work for default esp software (or after flashing esp with Espressif bin files).
Each time I overwrite default software with my own programs, the esp does not react to AT commands.

Do You know how to enable AT module in Your own programs ?
Is it possible ?

The Espressif SDK NONOS SDK API documentation says about at_custom.h and at_init(), but it looks like this is for developing custom AT commands.

I do not want to implement any custom AT commands, I just want expose standard functionality via AT commands (connecting to access point etc) in my own programs.

Is calling at_init() the right way to go ?

I tried to verify it on my own, but I am facing following problem.

This is my sketch:

Code: Select all

#include <osapi.h>
#include <eagle_soc.h>
#include <at_custom.h>

void ICACHE_FLASH_ATTR user_init(void)
   uart_div_modify(0, UART_CLK_FREQ / 115200);

   at_port_print("\r\nAT module initialized\r\n");

And this is error I get while building:

Code: Select all

xtensa-lx106-elf-gcc -I. -DICACHE_FLASH -mlongcalls   -c -o user_main.o user_main.c
xtensa-lx106-elf-gcc  user_main.o  -nostdlib -Wl,--gc-sections -Wl,--start-group -lgcc -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -lat -lairkiss -lwps -lsmartconfig -lespnow -lssl -Wl,--end-group -o user_main
/opt/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: user_main section `.text' will not fit in region `iram1_0_seg'
/opt/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 3641 bytes
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'user_main' failed
make: *** [user_main] Error 1

I am using the same makefile for all my "projects", and it looks for me like I get this problem only when libat.a is used.

Thanks in advance.

User avatar
Posts: 416
Joined: Wed Jun 29, 2016 7:17 pm
Location: India

Re: How to enable AT interface in your programs ?

Postby pratik » Mon Aug 07, 2017 12:37 pm
You should compile this example first, then remove all the custom command registrations. Then you can use AT commands and also have your own custom program.
Calling at_init enables all default AT commands. You can use the commands even if you don't add any new ones.
Pratik Panda

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):

Posts: 1
Joined: Fri Aug 11, 2017 12:57 pm

Re: How to enable AT interface in your programs ?

Postby trice001 » Fri Aug 11, 2017 12:59 pm


Who is online

Users browsing this forum: No registered users and 1 guest