kopanitsa / web3-arduino

an Arduino (or ESP32) library to use web3 on Ethereum platform.
MIT License
105 stars 45 forks source link

Can not connect to infura. abort() was called at pc 0x401627c3 on core 1? #19

Closed toutou8148 closed 3 years ago

toutou8148 commented 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: error

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: }`

simonerom commented 3 years ago

string INFURA_HOST = new string("mainnet.infura.io"); string INFURA_PATH = new string("/");

toutou8148 commented 3 years ago

string INFURA_HOST = new string("mainnet.infura.io"); string INFURA_PATH = new string("/");

Thanks. It works well.