Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj151 committed Feb 6, 2020
1 parent 2df7e9a commit aea725b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
Ewings Framework is cover all essential things to build ESP8266 IoT applications easily.
Basically it is designed on the top of arduino-esp8266 layer to make things easy to understand for developers.


**Ewings Esp8266 Framework Structure**


![Ewings Esp8266 Framework Structure](doc/ewings_stack.jpg)

ESP8266 Wi-Fi SoC offers a complete and self-contained Wi-Fi networking solution. When the ESP8266 hosts application, it boots up directly from an external flash.
Expand All @@ -25,9 +23,10 @@ Ewings framework sits on the top of these Arduino libraries. So the whole struct
## Usage

clone or download source, copy folder to esp8266 libraries path ( in windows 10 generally path is like ==> C:\Users\suraj\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries...) and restart the arduino ide. now in arduino ide navigate to File->Examples->EwingsEsp8266Stack->testing example compile and upload.
**Note** that installed version of esp8266 should be > 2.6.x. 2.6.2 or greater is recommended. you can check your installed esp8266 version in tools->boards->board manager.

**for now** : if you are uploading it first time in device then press flash key on nodemcu board for upto 10 seconds after 18-20 seconds from device initialize to load first default settings. device will get reset to default settings and restart.
**Note** that installed version of esp8266 should be > 2.6.x. 2.6.2 or greater is recommended. you can check your installed esp8266 version in tools->boards->board manager (type "esp" in top search bar).

**for now** : if you are uploading it first time in device then wait for 5 seconds(default station connect timeout on start) and then press flash key on nodemcu board for upto 6-7 seconds to load first default settings. device will get reset to default settings and restart.

* after initialing device completely check in pc/mobile wifi list if **esp8266Stack** name appear.
* select it and enter default password **espStack@8266**.
Expand All @@ -36,9 +35,8 @@ clone or download source, copy folder to esp8266 libraries path ( in windows 10
* now you will able to see below menu options

![Local Portal](doc/portal_home_menu.jpg)
you can play with all settings. you can make custom default configs by making changes in files of src/config folder.

got to wifi settings and change the default station ssid, password to connect to your station. you can also change ssid and password for access point. device will reset once after you submit wifi settings, i.e. you have to reconnect device.
you can play with all settings. you can modify configs by making changes in files of src/config folder. Go to wifi settings and change the default station ssid, password to connect to your station. you can also change ssid and password for access point. device will reset once after you submit wifi settings, i.e. you have to reconnect device.

**Note** that by default session will active for 300 seconds once login, you can change its timeout in server config file.

Expand Down
4 changes: 4 additions & 0 deletions examples/testing/testing.ino → examples/EwStack/EwStack.ino
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* stack initialize the services in setup and
* should serve in loop continueously
*/

#include <EwingsEsp8266Stack.h>

void setup() {
Expand Down
10 changes: 5 additions & 5 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=EwingsEsp8266Stack
name=esp8266-framework
version=1.0
author=Suraj I.
maintainer=Suraj I.
sentence=testing [project]
paragraph=
maintainer=Suraj I. <[email protected]>
sentence=esp8266 framework stack for easy configurable applications
paragraph=esp8266 framework stack for easy configurable applications
category=Communication
url=
url=https://github.com/Suraj151/esp8266-framework
architectures=esp8266
dot_a_linkage=true
3 changes: 2 additions & 1 deletion src/config/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extern "C" {
/**
* @define wifi & internet connectivity check cycle durations
*/
#define WIFI_STATION_CONNECT_ATTEMPT_TIMEOUT 5 // will try to connect within this seconds
#define WIFI_CONNECTIVITY_CHECK_DURATION 10000
#define INTERNET_CONNECTIVITY_CHECK_DURATION WIFI_CONNECTIVITY_CHECK_DURATION

Expand Down Expand Up @@ -96,7 +97,7 @@ extern "C" {
#define MAX_EVENT_CALLBACK_TASKS MAX_SCHEDULABLE_TASKS

/**
* callback type
* Define required callback type
*/
typedef std::function<void(int)> CallBackIntArgFn;
typedef std::function<void(void)> CallBackVoidArgFn;
Expand Down
4 changes: 2 additions & 2 deletions src/service_provider/WiFiServiceProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool WiFiServiceProvider::configure_wifi_station( wifi_config_table* _wifi_crede
while ( ! this->wifi->isConnected() ) {

delay(999);
if( _wait%8 == 0 ){
if( _wait%7 == 0 ){
#ifdef EW_SERIAL_LOG
Log(F("\ntrying reconnect"));
#endif
Expand Down Expand Up @@ -209,7 +209,7 @@ bool WiFiServiceProvider::configure_wifi_station( wifi_config_table* _wifi_crede
}else if( this->wifi->status() == WL_NO_SSID_AVAIL ){
#ifdef EW_SERIAL_LOG
Log(_wifi_credentials->sta_ssid);
Logln(F(" Not Found/reachable. Make sure it's availability in range."));
Logln(F(" Not Found/reachable. Make sure it's availability."));
#endif
}else if( this->wifi->status() == WL_CONNECT_FAILED ){
#ifdef EW_SERIAL_LOG
Expand Down
4 changes: 2 additions & 2 deletions src/service_provider/WiFiServiceProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class WiFiServiceProvider : public ServiceProvider {
}

/**
* @var uint8_t|16 wifi_connection_timeout
* @var uint8_t wifi_connection_timeout
*/
uint8_t wifi_connection_timeout=14;
uint8_t wifi_connection_timeout = WIFI_STATION_CONNECT_ATTEMPT_TIMEOUT;

/**
* @var uint8_t array temperory mac buffer
Expand Down
14 changes: 7 additions & 7 deletions src/utility/TaskScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void TaskScheduler::handle_tasks(){
for (uint16_t i = 0; i < _task_count; i++) _priority_indices[i] = i;
for (uint16_t i = 0; i < _task_count; i++) {
for (uint16_t j = i + 1; j < _task_count; j++) {
if ( this->_tasks[i]._task_priority < this->_tasks[i]._task_priority ) {
if ( this->_tasks[i]._task_priority < this->_tasks[j]._task_priority ) {
std::swap(_priority_indices[i], _priority_indices[j]);
}
}
Expand Down Expand Up @@ -231,12 +231,12 @@ int TaskScheduler::get_unique_task_id( ){
void TaskScheduler::printTaskSchedulerLogs(){

Logln(F("\nTasks : "));
Log(F("id"));Log("\t");
Log(F("priority"));Log("\t");
Log(F("duration"));Log("\t");
Log(F("last_ms"));Log("\t\t");
Log(F("execute_ms"));Log("\t");
Log(F("max_attempts"));Logln();
Log(F("id\t"));
Log(F("priority\t"));
Log(F("duration\t"));
Log(F("last_ms\t\t"));
Log(F("execute_ms\t"));
Log(F("max_attempts\n"));
for ( int i = 0; i < this->_tasks.size(); i++) {

Log(this->_tasks[i]._task_id);Log("\t");
Expand Down

0 comments on commit aea725b

Please sign in to comment.