-
Notifications
You must be signed in to change notification settings - Fork 15
Service Providers
Service providers provide the required services to the application running over device. for example to build any game application, developer requires system, gpu, internet, display, user-input, etc api's from corresponding os platform. same idea is used here with esp8266. If application require http client then http service is available, if it requires mqtt then mqtt service api's are available.
Framework has designed this service provider layer with bunch of service libraries available in it to provide their service to application layer as per requirements.
-
HTTP Service: The application can use this rest API service to make HTTP requests such as get, post, etc. this service is just extended version of arduino http client for esp8266.
-
NTP Service: This service provides network time to the application.
-
MQTT Service: This lightweight messaging protocol can be used to monitor or operate device itself or sensors that are connected to the device. To configure and test MQTT go on device local server and select MQTT section under main menu.
-
Event Service: This service is introduced to handle specific event tasks that should be executed on event arrival. just register the event listener as task to perticular event and fire it when event happens.
-
OTA Service: Over The Air (OTA) feature has ability to update the device firmware remotely. By default OTA configurations are accessible with local server. OTA service is uses firmware version to decide whether start to update or not. OTA server can be set in OTA configuration which is accesible through local server.
we need to set below route at server
GET route format as ==> http://server.com/ota?mac_id=xx:xx:xx:xx:xx:xx&version=2019041100 --// this link is called by device on every x seconds provided in OTA configuration with its mac_id and current version ( available in global configuration ) as parameters. Response should be in json as ==> { latest : 2019041101 } which returns latest firmware version available on server
by default update start only if device current firmware version is older than received firmware version from server.
when device start the update process after knowing its current firmware version is older it looks for the downloadable file from the same server in format given below
server address / bin / device mac address / latest firmware version .bin file e.g. http://server.com/bin/xx:xx:xx:xx:xx:xx/2019041101.bin
-
ESPNOW Service: This service is extended version of ESPNOW feature available in esp8266 with some easy to use api. with help of this feature we can build mesh networking, broadcasting etc n/w as per requirements. this service is not configurable from server for now. but you can manage it with easily available api of this service.
-
WiFi Service: This is extended version of arduino wifi library. this service provides simplified api's to dynamically interact with wifi devices on practical field. it has internet based connection ability over same network configs devices which are usefull in mesh scenarios. it also has ability to enable dynamic subnetting heiraechy where each individual device sits in different network and knows how far (in hop distance manner) he is from main hub centre.
-
PING Service: As name suggest this service extends basic ping feature of esp8266 sdk api. this service is utilized in wifi service to check active internet.
-
GPIO Service: GPIOs are actually going to interact with sensors. We can read sensor or we can drive appliances with the help of this GPIO services.
-
MAIL Service: MAIL service is uses SMTP driver to connect and send mail to any account. you should have a SMTP server account credentials that device uses to send mail. to set configuration goto local server and select Email section under main menu. you can test it with tick option provided in email section before submit configuration form. the best demo way to test this section is create free mailtrap account where we get configurations. this service should be enabled from common configuration file wherever this service act as dependency service. for example GPIO alert system has alert channel of email. GPIO alerts generated on user selected alert channel.
-
GPIO Alerts: GPIO alerts are provided to get notified on specific condition met. from local server GPIO alert conditions can be set in GPIO alert section which is available under GPIO manage section.