From v4.4 to v4.5

Template Streams

The TemplateStream class has been updated to improve tag recognition (Pull Request #2400). This means regular {varname} tags are sufficient for most purposes, including JSON templates.

The IFS::JsonDirectoryTemplate previously used double-brace tags such as {{varname}}. It now uses regular tags by default, so if you use this class either:

  1. Add a call to TemplateStream::setDoubleBraces() in your code, or

  2. Update your templates to use single braces

Eclipse Project Files

Starting with version 4.5.x we don’t provide Eclipse meta files in our samples. These can be generated using the ide-eclipse makefile target. For more information read the updated Using with Eclipse CDT.

Esp8266 toolchain

Sming now requires the ESP Quick Toolchain for building.

Support for the old legacy toolchains (ESP open SDK, UDK) have been dropped. They may still work but are no longer tested.

user_config.h

This header file is part of the original ESP8266 SDK code and is now deprecated. Libraries should use only the necessary headers. Applications do not require it.

Breaking Changes

Undeprecated HttpRequest::getQueryParameter() and removed a lot of old deprecated code.

  • Removed WebsocketClient::disconnect(). Use WebsocketClient::close() instead.

  • Removed TimerDelegateStdFunction. Use TimerDelegate instead.

  • Removed class URL. Use class Url instead.

  • Removed TemplateVariables. Use TemplateStream::Variables instead.

  • Removed StreamTransformer::transformCallback. Create inherited class and override StreamTransformer::transform() method instead.

  • Removed StreamTransformer::StreamTransformer(IDataSourceStream* stream, const StreamTransformerCallback& callback, size_t resultSize, size_t blockSize). Instead, create inherited class, override StreamTransformer::transform() method and use alternative constructor.

  • Removed SslValidatorCallback. Use Ssl::ValidatorCallback instead.

  • Removed SslSessionId and SSLSessionId. Use Ssl::SessionId instead.

  • Removed SslKeyCertPair and SSLKeyCertPair. Use Ssl::KeyCertPair instead.

  • Removed SslCertificate. Use Ssl::Certificate instead.

  • Removed SeekOriginFlags. Use SeekOrigin instead.

  • Removed eSO_FileStart. Use SeekOrigin::Start instead.

  • Removed eSO_CurrentPos. Use SeekOrigin::Current instead.

  • Removed eSO_FileEnd. Use SeekOrigin::End instead.

  • Removed OtaUpgrade::BasicStream::errorToString(). Use toString() instead.

  • Removed deprecated stuff in Mqtt, including MQTT_MAX_BUFFER_SIZE and MQTT_MSG_PUBREC.

  • Removed MqttClient::publishWithQoS(const String& topic, const String& message, int QoS, bool retained, MqttMessageDeliveredCallback onDelivery). Use bool MqttClient::publish(const String& topic, const String& message, uint8_t flags) instead. If you want to have a callback that should be triggered on successful delivery of messages, use MqttClient::setEventHandler().

  • Removed MqttClient::setCallback(MqttStringSubscriptionCallback subscriptionCallback). Use MqttClient::setEventHandler() instead.

  • Removed MqttClient::setWill (const String& topic, const String& message, int QoS, bool retained). Use MqttClient::setWill() instead.

  • Removed MqttMessageDeliveredCallback and MqttStringSubscriptionCallback. Use MqttDelegate instead.

  • Removed IDataSourceStream::length(). Use IDataSourceStream::available() instead.

  • Removed HttpServer::setDefaultResource(HttpResource* resource). Use paths.setDefault() instead.

  • Removed HttpServer::addPath(String path, const HttpPathDelegate& callback), HttpServer::addPath (const String& path, const HttpResourceDelegate& onRequestComplete) and HttpServer::addPath (const String& path, HttpResource* resource). Use paths.set() instead.

  • Removed HttpResponse::toString(const HttpResponse& res). Use :HttpResponse::toString() method or toString() global function instead.

  • Removed HttpResponse::sendTemplate(IDataSourceStream* newTemplateInstance). Use HttpResponse::sendNamedStream() instead.

  • Renamed commandFunctionDelegate to CommandFunctionDelegate.

  • Removed DateTime::convertFromUnixTime(time_t timep, int8_t* psec, int8_t* pmin, int8_t* phour, int8_t* pday, int8_t* pwday, int8_t* pmonth, int16_t* pyear). Use DateTime::fromUnixTime() instead.

  • Removed DateTime::convertToUnixTime (uint8_t sec, uint8_t min, uint8_t hour, uint8_t day, uint8_t month, uint16_t year). Use DateTime::toUnixTime() instead.

  • Removed DateTime::fromUnixTime(time_t timep, int8_t* psec, int8_t* pmin, int8_t* phour, int8_t* pday, int8_t* pwday, int8_t* pmonth, int16_t* pyear). Use unsigned version instead void DateTime::fromUnixTime(time_t, uint8_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*, uint16_t*).

  • Removed DateTime::parseHttpDate(const String& httpDate). Use DateTime::fromHttpDate() instead.

  • Renamed DNSServer class to DnsServer.

  • Removed eFO_Append. Use File::Append instead.

  • Removed eFO_CreateIfNotExist. Use File::Create instead.

  • Removed eFO_CreateNewAlways. Use File::CreateNewAlways instead.

  • Removed eFO_ReadOnly. Use File::ReadOnly instead.

  • Removed eFO_ReadWrite. Use File::ReadWrite instead.

  • Removed eFO_Truncate. Use File::Truncate instead.

  • Removed eFO_WriteOnly. Use File::WriteOnly instead.

  • Removed eSO_FileStart. Use SeekOrigin::Start instead.

  • Removed eSO_CurrentPos. Use SeekOrigin::Current instead.

  • Removed eSO_FileEnd. Use SeekOrigin::End instead.

  • Removed fileList() function. Use Directory object, or fileOpenDir() / fileReadDir() / fileCloseDir() functions.

  • Removed FileStream::attach(const String& fileName, FileOpenFlags openFlags=File::ReadOnly). Use FileStream::open() instead.

  • Removed FTPServer. Use FtpServer instead.

  • Removed FtpServer::checkUser(const String& login, const String& pass). Use FtpServer::validateUser() instead

  • Renamed Hardware_Timer to HardwareTimer.

  • Renamed HardwareSerial::setCallback(StreamDataReceivedDelegate dataReceivedDelegate) to HardwareSerial::onDataReceived().

  • Removed HttpClient::request(const String& url). Use HttpClient::createRequest() instead.

  • Removed HttpConnection::getLastModifiedDate(). Use getResponse()->headers.getLastModifiedDate() instead.

  • Removed HttpConnection::getResponseCode(). Use getResponse()->code instead.

  • Removed HttpConnection::getResponseHeader(const String& headerName, const String& defaultValue). Use getResponse()->headers[] instead.

  • Removed HttpConnection::getResponseHeaders(). Use getResponse()->headers instead.

  • Removed HttpConnection::getResponseString (). Use ``getResponse()->getBody() instead.

  • Removed HttpConnection::getServerDate (). Use ``getResponse()->headers.getServerDate() instead.

  • Removed httpGetErrorName (HttpError err). Use toString() instead.

  • Renamed HttpPartProducerDelegate type to MultipartStream::Producer.

  • Renamed HttpPartResult type to MultipartStream::BodyPart.

  • Removed HttpRequest::getPath(). Use request.uri.Path instead.

  • Removed HttpRequest::operator=(const HttpRequest& rhs). Use HttpRequest::clone() instead.

  • Removed HttpRequest::setPostParameters(const HttpParams& params). Use request.postParams = params instead.

  • Removed HttpResponse::hasHeader(const String& name). Use headers.contains() instead.

  • Removed HttpResponse::forbidden(). Use response.code = HTTP_STATUS_FORBIDDEN instead.

  • Removed HttpResponse::notFound(). Use response.code = HTTP_STATUS_NOT_FOUND instead.

  • Removed HttpResponse::redirect(const String& location). Use headers[HTTP_HEADER_LOCATION] instead.