I am trying to use ESP-01 (ESP8266) with Arduino Zero.
Works fine with Arduino Uno.
With Zero, i get various compiler errors.
For example: #include "SoftwareSerial.h"
gives:
....\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:152:2: error: #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors
Anyone who have a working scetch using ESP-01 to help a newbie?
I previously tried WifiEsp and WifiEspAT (and others), but these did not correctly recognise the initial response from the ESP-01, so (incorrectly) gave the message "WiFi shield not present". I traced the commands and response these libraries used, and it seems that the ESP-01 simply gave responses which the libraries were not prepared for. Maybe because my two ESP-01 modules had old firmware (different versions from 2015-2016).
Anyway, here are some notes for other newbies trying to connect the ESP-01 to Arduino Zero:
Use the library ESP_AT_Lib.
Connect the ESP-01 to the Zeros pin 0 and 1, Tx to Rx and Rx to Tx
The easiest way to make example code to print to Serial Monitor is to include #define Serial SerialUSB
When uploading the scetch from IDE to the Zero, the USB connection will be reset. Due to this anything immedialtely sent to the serial monitor will be lost. To avoid this, include a delay(1000) as first statement in the setup() part (at least if you are using the Arduino IDE for Windows)
ESP-01 may come with different baud rates. 115200 was used on old modules (and are still sold), 9600 on newer, but dont be surprised if you have to use another baud rate such as 19200 (you may change to defined values in between)
Thank you for pointing me in the right direction, and especially thanks to @okvittem