internetofhomethings / ESP8266-Triple-Server

HTPP, MQTT and CoAP Server
14 stars 7 forks source link

coap.h missing #1

Open Santosh1971 opened 8 years ago

Santosh1971 commented 8 years ago

Dear Dave, on compilation I get following message!

endpoints.c:3:18: fatal error: coap.h: No such file or directory

include "coap.h"

              ^

compilation terminated. Error compiling.

also I think it is typo error

  1. Change the following in the sketch.h file to match your network settings: ( instead of sketch.h it should be http_coap_mqtt_server).
internetofhomethings commented 8 years ago

Oops...I forgot to include coap.h, c. I'll put it up on Github later today when I return home. If you really want it NOW, just click on the microcoap link in my post and put the coap.h,.c files (but none of the other files in this Github repository) in a folder called coap under your Arduino libraries folder.

Sketch.h is correct. It is located in the sketch folder.

internetofhomethings commented 8 years ago

Well, I see that the ssid/password is in the sketch file as you have noted. Must be slipping up! Thanks for finding that error in the readme.md file

internetofhomethings commented 8 years ago

I have now updated the readme.md and GitHub repository to include the missing "coap.h,c" files. Thanks again for finding this omission Santosh.

Santosh1971 commented 8 years ago

it is working now! Great! I could test all 3 server. I am now in search of source code of Android apps through which I can connect to these server( using any type,HTTP/MQTT/CoAP) and make appropriate GUI and application. I know App Inventor and just started Android studio. Are you aware of any sample code for such program.? Thanks Dave ,once again. Regards, Santosh

On Mon, Dec 21, 2015 at 6:44 AM, Dave notifications@github.com wrote:

I have now updated the readme.md and GitHub repository to include the missing "coap.h,c" files. Thanks again for finding this omission Santosh.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-166170342 .

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

Dear Dave,

I found following link to convert any HTML page to Native android app. http://www.appsgeyser.com/create-text-app/ it works! I will try to convert your html page which interacts with ESP8266 server over http as well as MQTT into android app.

this is for your information Regards, Santosh

On Mon, Dec 21, 2015 at 12:25 PM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

it is working now! Great! I could test all 3 server. I am now in search of source code of Android apps through which I can connect to these server( using any type,HTTP/MQTT/CoAP) and make appropriate GUI and application. I know App Inventor and just started Android studio. Are you aware of any sample code for such program.? Thanks Dave ,once again. Regards, Santosh

On Mon, Dec 21, 2015 at 6:44 AM, Dave notifications@github.com wrote:

I have now updated the readme.md and GitHub repository to include the missing "coap.h,c" files. Thanks again for finding this omission Santosh.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-166170342 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

Thanks for the info Santosh. I was not aware of App Inventor or appsgeyser. They definitely deserve a closer look. I am somewhat hesitant in exposing my device credentials in the source code used in these cloud solutions however. While there may be more advanced options for the appgeyser, the basic FREE interface appeared to require the entire webpage flattened into a single paste-able text file. For all but the simplest pages, you would want to separate (sometimes that is the only way it is available) the css and javascript/jquery into individual files.

Personally, I have been using the Eclipse IDE for Android App development. You can develop natively or convert web pages like appgeyser. Here is how I set up the environment: http://wp.me/p5NRQ8-aH

And here is an example Android App developed using Eclipse. The source code is exclusively an html web page, css, and javascript.

http://wp.me/p5NRQ8-b9

Santosh1971 commented 8 years ago

Dear Dave, I again came back to App inventor where I am able to send " http://192.168.0.132:9701/?arduino=SetDigital&chan=11&state=0" or " http://192.168.0.132:9701/?arduino=GetDigital&chan=11" through its "Webviewer" component. we can see the reply"Digital Channel 11 is LO" in the webviewer field also. Here I want to compare the text "Digital Channel 11 is LO" or "Digital Channel 11 is HI" and accordingly will change the state of switch. There is an option of webviewstring through which we can communicate between html page and app inventor ,pl. check this. https://puravidaapps.com/snippets.php#2webviewstring

I am unable to understand it. looks like we need to do something in our ESP program Can you pl. guide me.? Regards, Santosh

On Mon, Dec 21, 2015 at 8:23 PM, Dave notifications@github.com wrote:

Thanks for the info Santosh. I was not aware of App Inventor or appsgeyser. They definitely deserve a closer look. I am somewhat hesitant in exposing my device credentials in the source code used in these cloud solutions however. While there may be more advanced options for the appgeyser, the basic FREE interface appeared to require the entire webpage flattened into a single paste-able text file. For all but the simplest pages, you would want to separate (sometimes that is the only way it is available) the css and javascript/jquery into individual files.

Personally, I have been using the Eclipse IDE for Android App development. You can develop natively or convert web pages like appgeyser. Here is how I set up the environment: http://wp.me/p5NRQ8-aH

And here is an example Android App developed using Eclipse. The source code is exclusively an html web page, css, and javascript.

http://wp.me/p5NRQ8-b9

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-166323077 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

I found App Inventor intriguing.

There is one incompatibility I found with web_server. To make it work with App inventor, change one line in the SdkWebServer_parse_url_params function:

//pbuffer = (char *)os_strstr(precv, "Host:");
//pbuffer = (char *)os_strstr(precv, "Accept:");
pbuffer = (char *)os_strstr(precv, "Connection:");

The last line above is what you need.

On2Off.zip

Attached is an example App inventor project I made to demonstrate how to read the ESP response and compare the string and do something if the string matches.

You will need to unzip the project and import it into App inventor. Very easy to do from the Projects menu.

The demo project should show what you want to do. It assumes there is an LED connected to the ESP. But is you are using the Arduino Mega, just change the text to look for in the project. In this example:

Click on the LED Off button and the ESP returns "LED is now OFF"

Click on the LED On button and the ESP returns "LED is now ON" And then it check for "LED is now ON". since it is true, it sends the request to the ESP to turn off the LED and "LED is now OFF" is returned.

This example uses the "web" object, not the "Webviewer/webviewstring". While that might work with the ESP, it makes things a bit more complicated because Javascript in the ESP is needed. I'll let you know if/when I get that working but it is not needed for what you want to do.

Hope this is clear enough for you to proceed. I'm sure you will let me know if something is unclear.

Dave

internetofhomethings commented 8 years ago

Santosh, FYI, I had to change the IP in the app inventor example to match the LAN I am at today. You will need to change it back to 192.168.0.132 for things to work.

internetofhomethings commented 8 years ago

DemoCompare.zip

Santosh,

I played a bit more with App Inventor. The attached project should be a better example for you to use. It uses channel 11 and IP 192.168.0.132. It should work with your setup. This demo has 3 buttons and an input box.

  1. Button 1 turns LED Off
  2. Button 2 turns LED On
  3. Button 3 blinks LED the number of times entered in the input box

The blocks (code) has comparison examples with the return string.

Dave

Santosh1971 commented 8 years ago

It is great to see this example Dave! I will try it and will respond. I was just wondering if we can implement MQTT also in App inventor.it will be then like IOT ,which can be accessed and controlled even if we are in different network. And I think you will implement webconfig also to enter SSID and PASSWORD on the fly in ESP. I am becoming greedy.. :) !! Thanks and regards Santosh On 28 Dec 2015 03:40, "Dave" notifications@github.com wrote:

DemoCompare.zip https://github.com/internetofhomethings/ESP8266-Triple-Server/files/72823/DemoCompare.zip

Santosh,

I played a bit more with App Inventor. The attached project should be a better example for you to use. It uses channel 11 and IP 192.168.0.132. It should work with your setup. This demo has 3 buttons and an input box.

  1. Button 1 turns LED Off
  2. Button 2 turns LED On
  3. Button 3 blinks LED the number of times entered in the input box

The blocks (code) has comparison examples with the return string.

Dave

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-167444556 .

internetofhomethings commented 8 years ago

Santosh,

Are you familiar with port forwarding your IoT things, micro-controllers, IP cameras, etc.? That will allow you to access your devices anywhere....without MQTT.

Here is my pitch (post): http://wp.me/p5NRQ8-7U

Having said that, it is most likely possible to develop some App Inventor code to interface with MQTT. But, for me, it would take some time and effort as I have very limited App Inventor experience. Since the same result can be achieved using the App Inventor Web component, it is not my intention or ambition to pursue it at this time. Too many other irons in the fire.

Santosh1971 commented 8 years ago

Dear Dave, I am able to make my Android app (using App inventor ) to control the electrical appliance using your web_server. I did the same changes in your webandmqtt_server also and able to control using my Mobile in http mode. when I try using html based mqtt request, the esp says invalid request. looks like esp in mqtt mode can recognise only LED ON/OFF and get sensors. is it possible to integrate the arduino code in mqtt request also( like it is working in http)? regards, santosh

On Mon, Dec 28, 2015 at 7:06 AM, Dave notifications@github.com wrote:

Santosh,

Are you familiar with port forwarding your IoT things, micro-controllers, IP cameras, etc.? That will allow you to access your devices anywhere....without MQTT.

Here is my pitch (post): http://wp.me/p5NRQ8-7U

Having said that, it is most likely possible to develop some App Inventor code to interface with MQTT. But, for me, it would take some time and effort as I have very limited App Inventor experience. Since the same result can be achieved using the App Inventor Web component, it is not my intention or ambition to pursue it at this time. Too many other irons in the fire.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-167453768 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

Hi Santosh, That is also on my "todo" list. Unfortunately, the webandmqtt_server (Arduino lib http & mqtt) uses different web parameter decoding routines than the http SDK.

The routines were merged in the triple server sketch (http_coap_mqtt_server), That is the sketch I am planning to update to support communication with a genuine Arduino board, including mqtt.

They all now use the same scheme, like the ones used in the web_server sketch.

I'll probably get to it next week, I am currently finishing up the webconfig update.

But if you are in a hurry, please feel free to try updating the triple server yourself.

Dave

Santosh1971 commented 8 years ago

Thanks for your direction Dave.I will wait for your webconfig and mqtt arduino . Meanwhile I will finish my hardware portion of it. Thanks again Dave. Regards Santosh On 29 Dec 2015 09:22, "Dave" notifications@github.com wrote:

Hi Santosh, That is also on my "todo" list. Unfortunately, the webandmqtt_server (Arduino lib http & mqtt) uses different web parameter decoding routines than the http SDK.

The routines were merged in the triple server sketch (http_coap_mqtt_server), That is the sketch I am planning to update to support communication with a genuine Arduino board, including mqtt.

They all now use the same scheme, like the ones used in the web_server sketch.

I'll probably get to it next week, I am currently finishing up the webconfig update.

But if you are in a hurry, please feel free to try updating the triple server yourself.

Dave

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-167712328 .

Santosh1971 commented 8 years ago

Wish you a happy and prosperous new year 2016 Dave!

Thanks for your direction Dave.I will wait for your webconfig and mqtt arduino . Meanwhile I will finish my hardware portion of it. Thanks again Dave. Regards Santosh On 29 Dec 2015 09:22, "Dave" notifications@github.com wrote:

Hi Santosh, That is also on my "todo" list. Unfortunately, the webandmqtt_server (Arduino lib http & mqtt) uses different web parameter decoding routines than the http SDK.

The routines were merged in the triple server sketch (http_coap_mqtt_server), That is the sketch I am planning to update to support communication with a genuine Arduino board, including mqtt.

They all now use the same scheme, like the ones used in the web_server sketch.

I'll probably get to it next week, I am currently finishing up the webconfig update.

But if you are in a hurry, please feel free to try updating the triple server yourself.

Dave

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-167712328 .

internetofhomethings commented 8 years ago

Thanks Santosh! A new year is like a blank book, and the pen is in your hands. It is your chance to write a beautiful story for yourself. Happy New Year. -Dave

internetofhomethings commented 8 years ago

Okay Santosh,

Here is the Mqtt/Http server with Arduino Serial Port interface and Web Configuration:

https://github.com/internetofhomethings/Configurable-Web-Server

I'll be posting a couple of articles on my blog regarding this soon.

Dave

Santosh1971 commented 8 years ago

Thanks Dave, I was eagerly waiting for this... Will implement and revert. Just wondering if mqqt can be implemented in App inventor also? Thanks again. Santosh On 8 Jan 2016 02:06, "Dave" notifications@github.com wrote:

Okay Santosh,

Here is the Mqtt/Http server with Arduino Serial Port interface and Web Configuration:

https://github.com/internetofhomethings/Configurable-Web-Server

I'll be posting a couple of articles on my blog regarding this soon.

Dave

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-169797908 .

internetofhomethings commented 8 years ago

App Inventor does not appear to support a Web socket component which is needed to keep a tcp connection open, which is needed with a mqtt client.

It looks to me that the best possible solution is to use a Webview component to open a file on the android device that contains the Java script code that supports mqtt. Like the example file mqtt_server.html from my prior mqtt/http post. WebViewString would be used to communicate between the mqtt javascript code and app creator.

Santosh1971 commented 8 years ago

thanks for your advise Dave, I will try to do the same.

in the program you sent earlier I see following error when I change :

define EEPROM_INIT 1 To: define EEPROM_INIT 0 to use webconfig.

http_mqttserver.ino: In function 'void GetEepromVal(String, int, int)': http_mqtt_server:403: error: duplicate case value http_mqtt_server:397: error: previously used here http_mqttserver.ino: In function 'void SetEepromVal(char, int, int)': http_mqtt_server:435: error: duplicate case value http_mqtt_server:429: error: previously used here Exception in thread "Thread-1012" java.lang.Error: Error: could not match input

pl. advise! regards Santosh

On Fri, Jan 8, 2016 at 12:29 PM, Dave notifications@github.com wrote:

App Inventor does not appear to support a Web socket component which is needed to keep a tcp connection open, which is needed with a mqtt client.

It looks to me that the best possible solution is to use a Webview component to open a file on the android device that contains the Java script code that supports mqtt. Like the example file mqtt_server.html from my prior mqtt/http post. WebViewString would be used to communicate between the mqtt javascript code and app creator.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-169912490 .

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

also http://192.168.4.1:9701/config is not opening any page under ESP network

On Fri, Jan 8, 2016 at 9:26 PM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

thanks for your advise Dave, I will try to do the same.

in the program you sent earlier I see following error when I change :

define EEPROM_INIT 1 To: define EEPROM_INIT 0 to use webconfig.

http_mqttserver.ino: In function 'void GetEepromVal(String, int, int)': http_mqtt_server:403: error: duplicate case value http_mqtt_server:397: error: previously used here http_mqttserver.ino: In function 'void SetEepromVal(char, int, int)': http_mqtt_server:435: error: duplicate case value http_mqtt_server:429: error: previously used here Exception in thread "Thread-1012" java.lang.Error: Error: could not match input

pl. advise! regards Santosh

On Fri, Jan 8, 2016 at 12:29 PM, Dave notifications@github.com wrote:

App Inventor does not appear to support a Web socket component which is needed to keep a tcp connection open, which is needed with a mqtt client.

It looks to me that the best possible solution is to use a Webview component to open a file on the android device that contains the Java script code that supports mqtt. Like the example file mqtt_server.html from my prior mqtt/http post. WebViewString would be used to communicate between the mqtt javascript code and app creator.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-169912490 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

even http://192.168.0.135:9701/config

shows the blank page.

On Fri, Jan 8, 2016 at 9:43 PM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

also http://192.168.4.1:9701/config is not opening any page under ESP network

On Fri, Jan 8, 2016 at 9:26 PM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

thanks for your advise Dave, I will try to do the same.

in the program you sent earlier I see following error when I change :

define EEPROM_INIT 1 To: define EEPROM_INIT 0 to use webconfig.

http_mqttserver.ino: In function 'void GetEepromVal(String, int, int)': http_mqtt_server:403: error: duplicate case value http_mqtt_server:397: error: previously used here http_mqttserver.ino: In function 'void SetEepromVal(char, int, int)': http_mqtt_server:435: error: duplicate case value http_mqtt_server:429: error: previously used here Exception in thread "Thread-1012" java.lang.Error: Error: could not match input

pl. advise! regards Santosh

On Fri, Jan 8, 2016 at 12:29 PM, Dave notifications@github.com wrote:

App Inventor does not appear to support a Web socket component which is needed to keep a tcp connection open, which is needed with a mqtt client.

It looks to me that the best possible solution is to use a Webview component to open a file on the android device that contains the Java script code that supports mqtt. Like the example file mqtt_server.html from my prior mqtt/http post. WebViewString would be used to communicate between the mqtt javascript code and app creator.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-169912490 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

pl. note i have done following

//const char* init_ip3 = "132"; const char* init_ip3 = "135";

On Fri, Jan 8, 2016 at 9:53 PM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

even http://192.168.0.135:9701/config

shows the blank page.

On Fri, Jan 8, 2016 at 9:43 PM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

also http://192.168.4.1:9701/config is not opening any page under ESP network

On Fri, Jan 8, 2016 at 9:26 PM, Santosh Kr. jha <jha.santosh.kr@gmail.com

wrote:

thanks for your advise Dave, I will try to do the same.

in the program you sent earlier I see following error when I change :

define EEPROM_INIT 1 To: define EEPROM_INIT 0 to use webconfig.

http_mqttserver.ino: In function 'void GetEepromVal(String, int, int)': http_mqtt_server:403: error: duplicate case value http_mqtt_server:397: error: previously used here http_mqttserver.ino: In function 'void SetEepromVal(char, int, int)': http_mqtt_server:435: error: duplicate case value http_mqtt_server:429: error: previously used here Exception in thread "Thread-1012" java.lang.Error: Error: could not match input

pl. advise! regards Santosh

On Fri, Jan 8, 2016 at 12:29 PM, Dave notifications@github.com wrote:

App Inventor does not appear to support a Web socket component which is needed to keep a tcp connection open, which is needed with a mqtt client.

It looks to me that the best possible solution is to use a Webview component to open a file on the android device that contains the Java script code that supports mqtt. Like the example file mqtt_server.html from my prior mqtt/http post. WebViewString would be used to communicate between the mqtt javascript code and app creator.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-169912490 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

Santosh,

please try opening http://192.168.0.135:9701/config from your android device after it is connected to the same Wifi network & let me know if that worked or not. Also, try it with the Mozillo Firefox browser.This looks like it could be a problem with the Chrome browser. Thanks.

FYI, I was successful in communicating with the MQTT broker from App Inventor using the method I had noted. It needs some cleanup before sharing it.

internetofhomethings commented 8 years ago

Santosh,

pls zip up your sketch and attach it to a comment. I will see if I can duplicate the errors you are getting.:

" define EEPROM_INIT 1 To: define EEPROM_INIT 0 to use webconfig.

http_mqttserver.ino: In function 'void GetEepromVal(String, int, int)': http_mqtt_server:403: error: duplicate case value http_mqtt_server:397: error: previously used here http_mqttserver.ino: In function 'void SetEepromVal(char, int, int)':

"

internetofhomethings commented 8 years ago

Hi Santosh,

I found out why Chrome is rendering a blank page. My error. I was trying to manage the tcp packet size to keep it under the 1500 byte maximum. But it is not necessary as it is already taken care of in the library code. Other browsers seem to be more forgiving, but the page was loading way too slow. The update seems to have corrected it. Please monitor this for stability as only limited testing has been done. That is, take note if the ESP code crashes or resets. Just in case...

You can update your sketch to fix this by replacing the function SdkWebServer_senddata_html.That is the only code effected. The updated sketch is now on github at the same location.

I installed my demo App Inventor Application on my phone and verified the mqtt is working over 4G, no wifi connected. But you need to get the webconfig code working first before trying that.

Santosh1971 commented 8 years ago

[image: Inline image 1] I tried in Mozila , crome and in mobile also.. same result.. page is not opening..

It is great that I can now do MQTT in App inventor also.

This should be communicated to App inventor community also as many people wished to have this.

thanks regards, Santosh

On Fri, Jan 8, 2016 at 11:59 PM, Dave notifications@github.com wrote:

Santosh,

please try opening http://192.168.0.135:9701/config from your android device after it is connected to the same Wifi network & let me know if that worked or not. Also, try it with the Mozillo Firefox browser.This looks like it could be a problem with the Chrome browser. Thanks.

FYI, I was successful in communicating with the MQTT broker from App Inventor using the method I had noted. It needs some cleanup before sharing it.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170083030 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

MQTT using App Inventor

I'll need to do yet another post to explain how it is done. Not that complicated once you figure out how to put all the pieces together.

Santosh1971 commented 8 years ago

when we make #define EEPROM_INT 0

define EEPROM_CHR 0

define EEPROM_INT 1

//#define EEPROM_INT 0

define EEPROM_INT16 2

define EEPROM_INT24 3

then two cases ( EEPROM_CHR and EEPROM_INT )becomes equal ( =0)and this is a problem.. I think

void SetEepromVal(char *val,int offset, int fmt) { int i; switch(fmt) { case EEPROM_CHR: for(i=0;i<os_strlen(val);i++) { EEPROM.write(offset+i, val[i]); } EEPROM.write(offset+os_strlen(val),(uint8_t) 0); break; case EEPROM_INT: EEPROM.write(offset, atoi(val)); break; case EEPROM_INT16: EEPROM.write(offset+1, atoi(val)&0xFF); EEPROM.write(offset, (atoi(val)&0xFF00)>>8); break; case EEPROM_INT24: EEPROM.write(offset+2, atoi(val)&0xFF); EEPROM.write(offset+1, (atoi(val)&0xFF00)>>8); EEPROM.write(offset+0, (atoi(val)&0xFF0000)>>16); break; } }

On Sat, Jan 9, 2016 at 7:31 AM, Dave notifications@github.com wrote:

MQTT using App Inventor

I'll need to do yet another post to explain how it is done. Not that complicated once you figure out how to put all the pieces together.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170178519 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

I think you have revealed the problem:

To use the webconfig,

change #define EEPROM_INIT 1 to #define EEPROM_INIT 0

NOT

define EEPROM_INT 1

Santosh1971 commented 8 years ago

but when I change #define EEPROM_INIT 1 to #define EEPROM_INIT 0 I get error!!!

On Sat, Jan 9, 2016 at 7:40 AM, Dave notifications@github.com wrote:

I think you have revealed the problem:

To use the webconfig,

change #define EEPROM_INIT 1 to #define EEPROM_INIT 0

NOT

define EEPROM_INT 1

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170180496 .

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

here is the error

http_mqttserver.ino: In function 'void GetEepromVal(String, int, int)': http_mqtt_server:404: error: duplicate case value http_mqtt_server:398: error: previously used here http_mqttserver.ino: In function 'void SetEepromVal(char, int, int)': http_mqtt_server:436: error: duplicate case value http_mqtt_server:430: error: previously used here Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

On Sat, Jan 9, 2016 at 7:43 AM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

but when I change #define EEPROM_INIT 1 to #define EEPROM_INIT 0 I get error!!!

On Sat, Jan 9, 2016 at 7:40 AM, Dave notifications@github.com wrote:

I think you have revealed the problem:

To use the webconfig,

change #define EEPROM_INIT 1 to #define EEPROM_INIT 0

NOT

define EEPROM_INT 1

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170180496 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

can you drag & drop your http_mqtt_server.ion and sketch.h files here (see bottom of comment box) & perhaps I might be able to help you solve this by looking at the code.

internetofhomethings commented 8 years ago

Just downloaded the GitHub sketch and changed it to #define EEPROM_INIT 0

It compiled with no errors. This is a mystery. Something must be different. I am using Arduino 1.6.5 as I believe you are.

Santosh1971 commented 8 years ago

yes... webconfig started...

On Sat, Jan 9, 2016 at 7:50 AM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

On Sat, Jan 9, 2016 at 7:48 AM, Dave notifications@github.com wrote:

can you drag & drop your http_mqtt_server.ion and sketch.h files here (see bottom of comment box) & perhaps I might be able to help you solve this by looking at the code.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170181739 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

it will be good if you display the existing config data on this page..even after save so that we are sure that it has been saved

On Sat, Jan 9, 2016 at 7:59 AM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

yes... webconfig started...

On Sat, Jan 9, 2016 at 7:50 AM, Santosh Kr. jha jha.santosh.kr@gmail.com wrote:

On Sat, Jan 9, 2016 at 7:48 AM, Dave notifications@github.com wrote:

can you drag & drop your http_mqtt_server.ion and sketch.h files here (see bottom of comment box) & perhaps I might be able to help you solve this by looking at the code.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170181739 .

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

yaa i also use 1.6.5

but the error showing is justified for duplicate case vale .. in function 'void GetEepromVal(String*, int, int)':

when we make #define EEPROM_INIT 0

On Sat, Jan 9, 2016 at 7:57 AM, Dave notifications@github.com wrote:

Just downloaded the GitHub sketch and changed it to #define EEPROM_INIT 0

It compiled with no errors. This is a mystery. Something must be different. I am using Arduino 1.6.5 as I believe you are.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170182365 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

problem is, EEPROM_INIT is not used in GetEepromVal.

It should not be possible to change EEPROM_INT to 0 when EEPROM_INIT is changed.

Here is something to try. In sketch.h, change:

define EEPROM_CHR 0

define EEPROM_INT 1

define EEPROM_INT16 2

define EEPROM_INT24 3

define ADD_CSS 4

to

define EEPROM_CHR 10

define EEPROM_INT 11

define EEPROM_INT16 12

define EEPROM_INT24 13

define ADD_CSS 14

These are just identifiers. The actual values are not important, just that they are unique.

internetofhomethings commented 8 years ago

"it will be good if you display the existing config data on this page..even after save so that we are sure that it has been saved"

I may keep things simple and just add a red text message like: YOU MUST RESET ESP8266 FOR VALUES SHOWN TO BE ACTIVE

after a save is performed

Santosh1971 commented 8 years ago

this is working now.. but ESP is not wsitching to homw network it stays in ESP network after saving config???

On Sat, Jan 9, 2016 at 8:21 AM, Dave notifications@github.com wrote:

problem is, EEPROM_INIT is not used in GetEepromVal.

It should not be possible to change EEPROM_INT to 0 when EEPROM_INIT is changed.

Here is something to try. In sketch.h, change:

define EEPROM_CHR 0

define EEPROM_INT 1

define EEPROM_INT16 2

define EEPROM_INT24 3

define ADD_CSS 4

to

define EEPROM_CHR 10

define EEPROM_INT 11

define EEPROM_INT16 12

define EEPROM_INT24 13

define ADD_CSS 14

These are just identifiers. The actual values are not important, just that they are unique.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170184145 .

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

yes.. this also will work..

On Sat, Jan 9, 2016 at 8:35 AM, Dave notifications@github.com wrote:

"it will be good if you display the existing config data on this page..even after save so that we are sure that it has been saved"

I may keep things simple and just add a red text message like: YOU MUST RESET ESP8266 FOR VALUES SHOWN TO BE ACTIVE

after a save is performed

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170184934 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

You must reset the ESP for the saved values to be effective.

internetofhomethings commented 8 years ago

FYI, the mqtt password is currently ignored.

Santosh1971 commented 8 years ago

sorry i missed this step.. after restart it is working.. great thanks.. i will now do extensive testing and will update you.. regards, Santosh

On Sat, Jan 9, 2016 at 8:37 AM, Dave notifications@github.com wrote:

You must reset the ESP for the saved values to be effective.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170185036 .

Thanks and Regards, Santosh Jha 8197239206

Santosh1971 commented 8 years ago

yaa.. noted.. but in future it should be implemented for security reason.. i think

On Sat, Jan 9, 2016 at 8:40 AM, Dave notifications@github.com wrote:

FYI, the mqtt password is currently ignored.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-170185210 .

Thanks and Regards, Santosh Jha 8197239206

internetofhomethings commented 8 years ago

Santosh,

FYI, I have posted an article with an App Inventor MQTT example.

Santosh1971 commented 8 years ago

It is simply great..let me evaluate it with my gadgets. I will give you my feedback. If you permit, i would like share this in App inventor community. Pl. Advise. Regards Santosh On 14 Jan 2016 07:57, "Dave" notifications@github.com wrote:

Santosh,

FYI, I have posted an article with an App Inventor MQTT example.

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-171510951 .

internetofhomethings commented 8 years ago

Any wider exposure is welcome You are definitely more connected with the AI community than me,

Santosh1971 commented 8 years ago

Hello Dave, Good morning! Here the sketch attached which I modified to include the MAC address with PUB and SUB topic, also I am publishing the topic whenever box is opened. Pl. have a look and suggest if it is right way to do. Still I am facing the problem of entering the special character in Password field of webconfig. instead of' "@" it takes "%40".. and it doesnot connect with the wifi.

pl. do the needful. best regards, Santosh

On Thu, Jan 14, 2016 at 8:50 AM, Dave notifications@github.com wrote:

Any wider exposure is welcome You are definitely more connected with the AI community than me,

— Reply to this email directly or view it on GitHub https://github.com/internetofhomethings/ESP8266-Triple-Server/issues/1#issuecomment-171518091 .

Thanks and Regards, Santosh Jha 8197239206