Giter VIP home page Giter VIP logo

harestapi's Issues

Error 'sendGetHA' was not declared in this scope

Hello,

great work and thanks a lot for that!

i have this error 'sendGetHA' was not declared in this scope

and dont understand what is wrong...the 'sendGetHA' is red, like recognize as a function,

what i am doing wrong please? i just call the function like
sendGetHA(URL, messageURL);

where URL and messageURL as define as String in global variable at the beginning of the skecth..;

If you could help,

thanks

Verify error

when compiling the code i got this error

C:\Users\yoann\Documents\Arduino\libraries\HARestAPI-0.3\src\HARestAPI.cpp: In member function 'String HARestAPI::sendGetHA(String)': C:\Users\yoann\Documents\Arduino\libraries\HARestAPI-0.3\src\HARestAPI.cpp:103:21: error: 'class BearSSL::WiFiClientSecure' has no member named 'verify' 103 | if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str())) | ^~~~~~ C:\Users\yoann\Documents\Arduino\libraries\HARestAPI-0.3\src\HARestAPI.cpp: In member function 'bool HARestAPI::sendPostHA(String, String)': C:\Users\yoann\Documents\Arduino\libraries\HARestAPI-0.3\src\HARestAPI.cpp:200:21: error: 'class BearSSL::WiFiClientSecure' has no member named 'verify' 200 | if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str())) | ^~~~~~ exit status 1 Erreur de compilation pour la carte LOLIN(WEMOS) D1 mini (clone)

connection failed

Hey @debsahu,
I would really like to use this library in a project i;m working on but i'm having no luck getting it to connect to my home assistant install.

I'm trying to run the example sketch you have and ii have filled in everything needed, WIFI details and password, Home Assistant long lived token, fingerprint, port etc, but ultimately i get a connection failed message

Here is the output in the serial console:

connecting to SKYA92CD
.......
WiFi connected
IP address:
192.168.86.19
Requesting URL: /api/services/light/toggle
Sending:
POST /api/services/light/toggle HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.*********************************************
Content-Type: application/json
Content-Length: 26

{"entity_id":"light.lamp"}
Connecting to b4zm62u2sem***************.ui.nabu.casa
connection failed
`
I'm using nabu casa, but I'm not sure that matter as I have used the same details in https://reqbin.com/ and that triggers fine

Any help you can offer here would be great.

Please let me know if you need anything further

Thank you
Joe

Memory leak

When uses sendCustomHAData every request couses heap corruption. It present in 0.3, but 0.2 ok,

WiFiClientSecure' has no member named 'verify'

Sadly the lib is broken :-(

.pio\libdeps\nodemcuv2\HARestAPI\src\HARestAPI.cpp: In member function 'String HARestAPI::sendGetHA(String)':
.pio\libdeps\nodemcuv2\HARestAPI\src\HARestAPI.cpp:102:21: error: 'class BearSSL::WiFiClientSecure' has no member named 'verify'
102 | if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str()))
| ^~~~~~
.pio\libdeps\nodemcuv2\HARestAPI\src\HARestAPI.cpp: In member function 'bool HARestAPI::sendPostHA(String, String)':
.pio\libdeps\nodemcuv2\HARestAPI\src\HARestAPI.cpp:201:21: error: 'class BearSSL::WiFiClientSecure' has no member named 'verify'
201 | if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str()))
| ^~~~~~
Compiling .pio\build\nodemcuv2\libc1a\ESP8266mDNS\LEAmDNS_Structs.cpp.o
*** [.pio\build\nodemcuv2\lib17d\HARestAPI\HARestAPI.cpp.o] Error 1

Release v0.3.2 bugs/typos?

I am a fan of using releases instead of master, but realised there are some typos?

Compile errors:

...\HARestAPI.cpp:102:53: error: expected ';' before '}' token
102 |       wsclient->setFingerprint(_fingerprint.c_str())
|                                                     ^
|                                                     ;
103 |     }
|     ~
...\HARestAPI.cpp: In member function 'bool HARestAPI::sendPostHA(String, String)':
...\HARestAPI.cpp:191:54: error: expected ';' before '}' token
191 |       wsclient-> setFingerprint(_fingerprint.c_str())
|                                                      ^
|                                                      ;
192 |     }
|     ~

After fixing those manually, everything worked fine.

i have error

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp: In member function 'String HARestAPI::sendGetHA(String, String)':

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp:82:15: error: expected primary-expression before '=' token

 posturl + = "Authorization: Bearer " + _password + "\r\n";  //long-lived password

           ^

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp:83:13: error: expected primary-expression before '=' token

posturl + = "Content-Type: application/json" + "\r\n" +

         ^

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp:83:52: error: invalid operands of types 'const char [31]' and 'const char [3]' to binary 'operator+'

posturl + = "Content-Type: application/json" + "\r\n" +

                                                ^

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp: In member function 'bool HARestAPI::sendPostHA(String, String)':

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp:158:15: error: expected primary-expression before '=' token

 posturl + = "Authorization: Bearer " + _password + "\r\n";  //long-lived password

           ^

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp:159:13: error: expected primary-expression before '=' token

posturl + = "Content-Type: application/json" + "\r\n" +

         ^

C:\Users\conkhidan\Documents\Arduino\libraries\HARestAPI-master\src\HARestAPI.cpp:159:52: error: invalid operands of types 'const char [31]' and 'const char [3]' to binary 'operator+'

posturl + = "Content-Type: application/json" + "\r\n" +

                                                ^

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

Content-Length ignored

For reading the payload, it is necessary to read the content-length header to know the length of the payload.
The payload does not necessarily end with \r\n so you cannot read it with readString().
If the payload ist not terminated with \r\n, the program hangs at
replystr = wclient->readString();
until it gets a timeout after 1000s.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.