Closed toutou8148 closed 3 years ago
Hello, I ma trying to communicate my NODEMCU ESP32 to Ethereum network through infura. However, I got an error when starting connection to server. The image below show the error:
this is my code: `#include
Web3 web3((string)INFURA_HOST, (string)INFURA_PATH);
void setup() { Serial.begin(115200); for(uint8_t t = 4; t > 0; t--) { Serial.printf("[SETUP] WAIT %d...\n", t); Serial.flush(); delay(1000); } WiFi.begin(ENV_SSID, ENV_WIFI_KEY); // attempt to connect to Wifi network: while (WiFi.status() != WL_CONNECTED) { Serial.print("."); // wait 1 second for re-trying delay(1000); } Serial.println("Connected"); string result = web3.Web3ClientVersion(); }
void loop() { // put your main code here, to run repeatedly: }`
string INFURA_HOST = new string("mainnet.infura.io"); string INFURA_PATH = new string("/");
Thanks. It works well.
Hello, I ma trying to communicate my NODEMCU ESP32 to Ethereum network through infura. However, I got an error when starting connection to server. The image below show the error:![error](https://user-images.githubusercontent.com/15029785/100086549-dbcdf700-2e4d-11eb-82a7-8285f31ab607.png)
this is my code: `#include
include
define ENV_SSID "dlink"
define ENV_WIFI_KEY ""
define INFURA_HOST "mainnet.infura.io"
define INFURA_PATH "ee31c1d4946c4dbb89debb7d4af08cf3"
Web3 web3((string)INFURA_HOST, (string)INFURA_PATH);
void setup() { Serial.begin(115200); for(uint8_t t = 4; t > 0; t--) { Serial.printf("[SETUP] WAIT %d...\n", t); Serial.flush(); delay(1000); } WiFi.begin(ENV_SSID, ENV_WIFI_KEY); // attempt to connect to Wifi network: while (WiFi.status() != WL_CONNECTED) { Serial.print("."); // wait 1 second for re-trying delay(1000); } Serial.println("Connected"); string result = web3.Web3ClientVersion(); }
void loop() { // put your main code here, to run repeatedly: }`