Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: no matching function for call to 'Web3::Web3(const char [18], const char [36])' #16

Open
Alenius opened this issue Nov 15, 2018 · 10 comments

Comments

@Alenius
Copy link

Alenius commented Nov 15, 2018

Hello.

I am interested in getting this library up and running for my nodemcu. I however fall short pretty much immediately. When I use the example code I get an error code at:

Web3 web3(INFURA_HOST, INFURA_PATH);

and my defines are:

#define INFURA_HOST "rinkeby.infura.io"
#define INFURA_PATH "/mypath"

Where of course the path is really my infura path.

The error is:

SMART-:14:35: error: no matching function for call to 'Web3::Web3(const char [18], const char [36])'
 Web3 web3(INFURA_HOST, INFURA_PATH);
                                   ^

/Users/project.ino:14:35: note: candidates are:
In file included from /Users/project.ino:3:0:
/Users/mypath/Documents/Arduino/libraries/web3-arduino-master/src/Web3.h:15:5: note: Web3::Web3(const string*, const string*)
     Web3(const string* _host, const string* _path);

It feels weird since I've copy pasted the example code from the repo.

@hikaman
Copy link

hikaman commented Nov 15, 2018

Hey,

you must generate your own path on on infura.
Create an account on https://infura.io/ and you will get your path/key via email.

Please note that there are flaws in the main repo. If you want to call smart contracts or send ERC20 Token check the PRs or the repo from https://github.com/TbLtzk/web3-arduino

@Alenius
Copy link
Author

Alenius commented Nov 15, 2018

Yes, I have already done that. I just substituted my address above.

@swapnilbaad
Copy link

I am also getting same error. Did you solve the problem??

@Alenius
Copy link
Author

Alenius commented Mar 22, 2019

Sorry I do not remember exactly but I think I solved this some other way and did not get this to work.

@swapnilbaad
Copy link

Did you come up with another solution on how to call functions of smart contract through arduino ??

@Yago-Caetano
Copy link

For solve this problem, You need to put this code, on PlatformIO

Web3 web3((string*)INFURA_HOST, (string*)INFURA_PATH);

@toutou8148
Copy link

Sorry I do not remember exactly but I think I solved this some other way and did not get this to work.

Did you successfully connect to infura using nodeMCU esp32?

@uskhalil
Copy link

uskhalil commented Mar 5, 2023

@Yago-Caetano: It doesn't work either.
Web3 web3((string*)INFURA_HOST, (string*)INFURA_PATH);
OR
Web3 web3(new string(INFURA_HOST), new string(INFURA_PATH));

Since the library is not maintained a long ago, and there are broken links to the related libraries, I tried to figure out the issues however I am still getting the instantiation issue with the Web3 class in the main.cpp

Please share if anyone managed to deploy it on ESP32

@CaioTurnes
Copy link

Hello, did you figure out how to make it work?

@CaioTurnes
Copy link

@uskhalil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants