Is there an Arduino library, for ESP with at commands ?

Hi

Is there an Arduino library, for ESP with at commands, compatible with the WiFi library ?
Or a good library ?
For zero.

WiFi class:
begin()
disconnect()
config()
setDNS()
SSID()
BSSID()
RSSI()
encryptionType()
scanNetworks()
status()
getSocket()
macAddress()

there is only one such library for AT commands - WiFiEsp. but it is not made to be compatible with SAMD architecture

for example Teensy SAMD board users connect esp8266 over SPI and use WiFiSpiESP firmware and library. it is easier then with 5 V AVR boards because both boards are 3.3V, no level shifting is needed.

This use SPI.
I need use UART RX and Tx and AT command.

What is SAMD-incompatible about the WiFiEsp library? I haven't dug into the source very deeply but I can't imagine any of the code being architecture specific. The library.properties metadata claims it's compatible with all architectures.

Arduino: 1.8.5 (Windows 10), Board: "GEVINO SAM-BA bootloader"

C:\Users\x-gio\Documents\Arduino\libraries\WiFiEsp\src\utility\EspDrv.cpp: In static member function 'static int EspDrv::sendCmd(const __FlashStringHelper*, int, ...)':

C:\Users\x-gio\Documents\Arduino\libraries\WiFiEsp\src\utility\EspDrv.cpp:1020:25: error: 'va_start' was not declared in this scope

  va_start (args, timeout);

                         ^

C:\Users\x-gio\Documents\Arduino\libraries\WiFiEsp\src\utility\EspDrv.cpp:1021:56: error: 'vsnprintf_P' was not declared in this scope

  vsnprintf_P (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);

                                                        ^

C:\Users\x-gio\Documents\Arduino\libraries\WiFiEsp\src\utility\EspDrv.cpp:1022:21: error: '__gnuc_va_end' was not declared in this scope

  __gnuc_va_end (args);

                     ^

exit status 1
Error compiling for board GEVINO SAM-BA bootloader.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

pert:
What is SAMD-incompatible about the WiFiEsp library? I haven't dug into the source very deeply but I can't imagine any of the code being architecture specific. The library.properties metadata claims it's compatible with all architectures.

RingBuffer exists in SAMD core and in WiFiEsp and implementation of functions with variable arguments length are not compatible with ARM compiler

Juraj:
RingBuffer exists in SAMD core and in WiFiEsp

Since WiFiEsp uses the correct #include syntax, I don't see anything that would be problematic about that at a glance.

Juraj:
implementation of functions with variable arguments length are not compatible with ARM compiler

I noticed that from the error messages in the previous reply. I guess that needs C++11? It should be resolved by:

but there doesn't seem to be recent progress on that. It's kind of funny that the relatively modern SAMD boards are using a more outdated toolchain than the old school AVR.

pert:
Since WiFiEsp uses the correct #include syntax, I don't see anything that would be problematic about that at a glance.

RingBuffer in SAMD core is a template class

I have solved all the compilation issues this way, but it seems to not Work.

Changed RingBuff Class on RingBuffW
Added
#include <stdarg.h>
#include <stdio.h>
Changed
vsnprintf_P (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);
with
vsnprintf (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);

How is the equivalent of Vsnprintf_P with ARM ?

x-giorgio-x:
I have solved all the compilation issues this way, but it seems to not Work.

Changed RingBuff Class on RingBuffW
Added
#include <stdarg.h>
#include <stdio.h>
Changed
vsnprintf_P (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);
with
vsnprintf (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);

How is the equivalent of Vsnprintf_P with ARM ?

ARM doesn't have PROGMEM, so no _P functions. use the version without _P

This exactly my change.

Changed on RingBuffer.cpp & RingBuffer.h & EspDrv.cpp & EspDrv.h & Scketh
RingBuff Class on RingBuffW
Added on EspDrv.cpp
#include <stdarg.h>
Changed on EspDrv.cpp
vsnprintf_P (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);
with
vsnprintf (cmdBuf, CMD_BUFFER_SIZE, (char*)cmd, args);

But unit reboot each fiew seconds.
ESP led, blink repeatedly every few seconds, USB driver disappears and Returns.

I hope you use Serial1 for esp8266, not the SerialUSB?

Yes, I use Serial for ESP, SerialUSB for debug.

// use a ring buffer to increase speed and reduce memory allocation
RingBufferW buf(8);

void setup()
{
  Serial.begin(115200);       // initialize serial for ESP module
  SerialUSB.begin(115200);    // initialize serial for debugging
  WiFi.init(&Serial);         // initialize ESP module

Ok, no, all Work Well.

Only small problem.
On USB debug Appears IP 0.0.0.0
But really work well at 192.168.1.1