UNO compile issue for sketch to use ESP8266 for email

I am doing my sketch based on AllAboutEE’s youtube video ( Send Email From ESP8266 Using NodeMcu Firmware - YouTube ) to send email via SMTP, but when I attempt to compile the sketch I get one error, repeatedly. I am using Arduino IDE v1.0.6 and an UNO Rev3. Here is the first IDE compile error instance:

ESP8266sendEmailCLEANED.ino: In function ‘boolean do_next()’:
ESP8266sendEmailCLEANED:152: error: ‘class Adafruit_ESP8266’ has no member named ‘cipSend’

I am using the Adafruit ESP8266 library (.cpp and .h files attached), and I verified that my ESP8266 is flashed with the same firmware as the library expects.

I attached my cleaned (i.e. removed sensitive info) sketch as a text file, but here is an excerpt where you can see the first instance of the offending “return wifi.cipSend” line:

// do_next executes the SMTP command in the order required.
boolean do_next()
{

switch(count){
case 0:
Serial.println(“Connecting…”);
return wifi.connectTCP(F(HOST), PORT);
break;
case 1:
// send “HELO ip_address” command. Server will reply with “250” and welcome message
return wifi.cipSend(“HELO computer.com”,F(“250”)); // ideally an ipaddress should go in place
// of “computer.com” but I think the email providers
// check the IP anyways so I just put anything.
break;

Adafruit_ESP8266.cpp (9.36 KB)

Adafruit_ESP8266.h (2.51 KB)

ESP8266sendEmailCLEANED.txt (7.46 KB)

There is no wifi.cipSend function in that library.

There is an AT command. AT+CIPSEND http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module

Watch this video instead of the one you posted before. https://www.youtube.com/watch?v=n5WZ_BNRvRY

I went to the video that you suggested and in his code he uses the same library as I was using (the Adafruit library). And his sketch has the same cipSend command as I was using and it was all working for him. But I did notice elsewhere on his page that the link to the library was to ITEADLIB_Arduino_ESP8266 rather than Adafruit, so I installed and used that instead of the Adafruit library. I have an issue now with the wifi declaration.

so my include statement now became:

//#include <Adafruit_ESP8266.h>
#include <doxygen.h>
#include <ESP8266.h>
#include <SoftwareSerial.h>

#define ESP_RX 2
#define ESP_TX 3
#define ESP_RST 4
SoftwareSerial softser(ESP_RX, ESP_TX);

// Must declare output stream before Adafruit_ESP8266 constructor; can be
// a SoftwareSerial stream, or Serial/Serial1/etc. for UART.
ESP8266 wifi(&softser, &Serial, ESP_RST);
// Must call begin() on the stream(s) before using Adafruit_ESP8266 object.

I also went into ESP8266.h and uncommented the line:
#define ESP8266_USE_SOFTWARE_SERIAL

But when I attempt to compile I get:

SENDIT_EmailESP8266UNO20150404:35: error: no matching function for call to ‘ESP8266::ESP8266(SoftwareSerial*, HardwareSerial*, int)’
…\Arduino\libraries\ITEADLIB_Arduino_WeeESP8266-master/ESP8266.h:60: note: candidates are: ESP8266::ESP8266(HardwareSerial&, uint32_t)
…\Arduino\libraries\ITEADLIB_Arduino_WeeESP8266-master/ESP8266.h:38: note: ESP8266::ESP8266(const ESP8266&)
SENDIT_EmailESP8266UNO20150404.ino: In function ‘void setup()’:
SENDIT_EmailESP8266UNO20150404:82: error: ‘class ESP8266’ has no member named ‘setBootMarker’
SENDIT_EmailESP8266UNO20150404:91: error: ‘class ESP8266’ has no member named ‘hardReset’
SENDIT_EmailESP8266UNO20150404:98: error: ‘class ESP8266’ has no member named ‘softReset’
SENDIT_EmailESP8266UNO20150404:105: error: ‘class ESP8266’ has no member named ‘println’
SENDIT_EmailESP8266UNO20150404:106: error: ‘class ESP8266’ has no member named ‘readLine’
SENDIT_EmailESP8266UNO20150404:108: error: ‘class ESP8266’ has no member named ‘find’
SENDIT_EmailESP8266UNO20150404:114: error: ‘class ESP8266’ has no member named ‘connectToAP’
SENDIT_EmailESP8266UNO20150404:119: error: ‘class ESP8266’ has no member named ‘println’
SENDIT_EmailESP8266UNO20150404:120: error: ‘class ESP8266’ has no member named ‘readLine’
SENDIT_EmailESP8266UNO20150404:122: error: ‘class ESP8266’ has no member named ‘find’
SENDIT_EmailESP8266UNO20150404:127: error: ‘class ESP8266’ has no member named ‘println’
SENDIT_EmailESP8266UNO20150404:129: error: ‘class ESP8266’ has no member named ‘find’
SENDIT_EmailESP8266UNO20150404:130: error: ‘class ESP8266’ has no member named ‘closeTCP’
SENDIT_EmailESP8266UNO20150404:131: error: ‘class ESP8266’ has no member named ‘find’
SENDIT_EmailESP8266UNO20150404.ino: In function ‘boolean do_next()’:
SENDIT_EmailESP8266UNO20150404:167: error: ‘class ESP8266’ has no member named ‘connectTCP’
SENDIT_EmailESP8266UNO20150404:171: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:177: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:181: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:185: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:193: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:201: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:206: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:216: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:226: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:233: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:237: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:240: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:243: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:246: error: ‘class ESP8266’ has no member named ‘cipSend’
SENDIT_EmailESP8266UNO20150404:249: error: ‘class ESP8266’ has no member named ‘closeTCP’

I have attached the different library .h and .cpp files for reference

doxygen.h (575 Bytes)

ESP8266.cpp (16.4 KB)

ESP8266.h (14.4 KB)

Remove the ‘&’.

Also the constructor only accepts a HardwareSerial object. ESP8266::ESP8266(HardwareSerial&, uint32_t)

Your object would be declared like this: ESP8266 wifi( Serial, ESP_RST );

This probably means you’ll have to use SoftwareSerial for debugging as Serial is used for talking to the ESP8266.

Use a mega if you have one, then you can use Serial1 for the ESP8266 and Serial for debugging. Once working you can port it back to the Uno.

OK I will get a Mega and go from there. Thanks for the help.

While i must wait to get a MEGA I started looking at the details of the 3 ESP8266 libraries I have found, and began a process to align my sketch code (being used with an UNO) with the well-documented ITEADLIB_Arduino_WeeESP8266 library.

refer to: http://docs.iteadstudio.com/ITEADLIB_Arduino_WeeESP8266/index.html

I made great headway with this, being able to compile deeper and deeper into my sketch before an error would be thrown.

I commented out a couple of problem areas to circle back to later, wanting to focus on the CIPSEND steps in my sketch and the respective code in the ESP8266 library.

I found that he .cpp file has a CIPSEND entry, but the .h file has no API definition that uses it. But looking in the .h file I found “send” entries and attempted to use this to see where that might lead me.

There were errors with this starting at line 169. Here is the first set thrown:
ESP8266sendEMAILwithUNO20150405-2000.ino: In function ‘boolean do_next()’:
ESP8266sendEMAILwithUNO20150405-2000.ino:169: error: invalid conversion from ‘const char*’ to ‘const uint8_t*’
ESP8266sendEMAILwithUNO20150405-2000.ino:169: error: initializing argument 1 of ‘bool ESP8266::send(const uint8_t*, uint32_t)’
ESP8266sendEMAILwithUNO20150405-2000.ino:169: error: invalid conversion from ‘const __FlashStringHelper*’ to ‘uint32_t’
ESP8266sendEMAILwithUNO20150405-2000.ino:169: error: initializing argument 2 of ‘bool ESP8266::send(const uint8_t*, uint32_t)’

I have attached the .cpp and .h files, and my sketch as modified to this point (.txt and redacted the sensitive login creds, etc.)

The original sketch had cipSend and I changed these to wifi.send since the library has 2 send entries in the .h file that I thought might give some more clues when compiling the sketch.

I would like any input around adding cipSend functionality to the library. Perhaps this is too ambitious, so if you have thoughts otherwise on a workaround that will enable me to get this sketch to compile and function I would be ecstatic.

ESP8266.cpp (16.4 KB)

ESP8266.h (14.4 KB)

ESP8266sketchWIP20150405-2200.txt (9.37 KB)

wifi.send in the function you are calling requires a unsigned character (byte) pointer and a 32 bit (long) length. This compiles.

       return wifi.send((byte*)"HELO computer.com",17);

'class Adafruit_ESP8266' has no member named 'httpPort' I am finding this type of error please help me how to fix it

Anyone who got the code worked?