ssokol / esp8266

ESP8266 Wifi library and sample code for Arduino
112 stars 41 forks source link

New library #2

Open Diaoul opened 9 years ago

Diaoul commented 9 years ago

Just to let you know I created my own library here: https://github.com/Diaoul/arduino-ESP8266

It implements the full v0.20 AT command set and is non-blocking. I'll soon implement a derived client so I can pass it to the MQTT library.

Any help to improve the library is welcome :)

tprochazka commented 9 years ago

It looks very promising. This library has quite nice life cycle based on callbacks. You can send request any time and do anything until response will come in very easy way. But problem of most ESP8266 is that AT commands aren't stable and libraries are outdated soon. Great feature of your library is Client implementation which makes it compatible with official Arduino WiFi library.

Diaoul commented 9 years ago

I'll update the library to follow AT command set releases, I'm expecting flow control and/or buffers features soon which will make the AT interface much more stable.

I don't buffer anything in the library and IMO libraries shouldn't buffer given the limited amount of RAM on the Arduinos and given that Serial (and SoftwareSerial) already provide the buffer. Instead, I just implement the Stream interface so you can check for available() and call read() to get the incoming data. available() is non blocking so you can call that in a loop.

tprochazka commented 9 years ago

I mean that HardwareSerial has hardware buffer. I mean you can do a little bit more blocking operation than with SofwareSerial where this is not possible.

I just started to play with your library. You wrote that you use 0.20 AT. I upgraded my module to 0.20 AT and 0.9.3 SDK and it runs on 115200 bauds. Which is too much for SoftwareSerial. And I see that you use 9600 in the example code of yours library. You are using some custom AT firmware?

tprochazka commented 9 years ago

Sorry, I found that AT+IPR= works, it is only not mentioned in 4A-AT-Espressif AT Instruction Set_020.pdf