Aypac / Arduino-TR-064-SOAP-Library

Arduino library for the TR-064 protocol, most commonly used by the Fritz!Box router API
Other
63 stars 21 forks source link

Error compiling for board NodeMCU 1.0 (ESP-12E Module). #47

Closed TobiasFitzke01 closed 3 years ago

TobiasFitzke01 commented 3 years ago

Hi, if I try to compile the "caller"-Example I get the following error. What is my mistake?

C:\Users\Tobias\Documents\Arduino\libraries\Arduino-TR-064-SOAP-Library-master\src\tr064.cpp: In member function 'String TR064::httpRequest(String, String, String, bool)':

C:\Users\Tobias\Documents\Arduino\libraries\Arduino-TR-064-SOAP-Library-master\src\tr064.cpp:398:15: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, host, port, uri)

398 | http.begin(_ip, _port, url);

  |     ~~~~~~~~~~^~~~~~~~~~~~~~~~~

exit status 1

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

saak2820 commented 3 years ago

an update on the Arduino library changed the http client class. you can try my fork

TobiasFitzke01 commented 3 years ago

Thanks for your answer. Now I get the following error:

C:\Users\Tobias\Documents\Arduino\libraries\Arduino-TR-064-SOAP-Library-master\src\tr064.cpp: In member function 'bool TR064::httpRequest(const String&, const String&, const String&, bool)':

C:\Users\Tobias\Documents\Arduino\libraries\Arduino-TR-064-SOAP-Library-master\src\tr064.cpp:535:20: error: cannot convert 'String' to 'bool' in return

535 | return _payload;

  |                    ^~~~~~~~

  |                    |

  |                    String

exit status 1

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

saak2820 commented 3 years ago

well there is a bug in my error handling.

before that, there might be something wrong with your configuration. please set debug level up to verbose and post the output.

saak2820 commented 3 years ago

thats not what i ment. sorry. i was writing from my mobile.

first get my last commit.

run your program and read serial output. if you dont find the error go and use VERBOSE Output.

add in your code before connection.init(). like so:

//activate for Debug Output connection.debug_level = connection.DEBUG_VERBOSE;

look at your Serial output and search for the error

Aypac commented 3 years ago

Hi @gsg2820 I've not had the time to fix these issues myself (and little motivation, as my ISP forces me to use a router without TR-064 interface and I switched to using µPython for my ESP projects). Do you think your changes would be ready for a PR?

Also, if you are interested in taking over this repo, we can talk about that as well.

Aypac commented 3 years ago

Oh, I also just want to link this to #40

saak2820 commented 3 years ago

Hi René

im will review my code and make a couple of commits. You will then get a PR from me.

Aypac commented 3 years ago

@TobiasFitzke01, were you able to solve your issue yet?

TobiasFitzke01 commented 3 years ago

Hi, my initial problem is fixed now. But now I get the following Error: [HTTP] Services NOT Loaded. Do you know what's my mistake?

saak2820 commented 3 years ago

Yes. You missing the call to the init method. Please have a look at the example.

TobiasFitzke01 commented 3 years ago

Ah perfect, I accidentally deleted this part. Now everythink is working. Thank for your help