spareleg / bitcoin-ticker

Uses SPI TFT display ILI9341 and NodeMCU to display current Bitcoin price, candle chart and time. Binance REST API + Binance Web Sockets API
21 stars 8 forks source link

"Internet connection lost. Check the Wi-Fi source." Error message #4

Closed guiguijke closed 2 years ago

guiguijke commented 3 years ago

Hello , I've built your bitcoin ticker, and I'm working on it at this moment. I used the libs exactly on the versions you are mentionning but it wasn't working, I had this error msg after getting the time from internet.

Solution : add "client.setInsecure();" after line 214 WiFiClientSecure client;

guiguijke commented 3 years ago

Hello,

I tried again, but without this line, my device is just black, showing nothing at all.

Anyway, did you find a way to have the last price + last cande redrawn between each timeframe change ?

Regards

Le ven. 8 janv. 2021 à 08:27, frittna notifications@github.com a écrit :

hi, well, i admit i have no clue why this message comes as all my 3 identical devices are working without that line. Maybe there was a problem or changing in the binance api. I have only noticed a lost connection for some minutes some days ago, but we are in the middle of a crazy cryüto bull run so maybe it was just a server problem?.. have you tried it without this line any time later?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olbed/bitcoin-ticker/issues/4#issuecomment-756598135, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUIMMZDFBDJC6YH52XEZKTSY2XWPANCNFSM4VZJGTGA .

spareleg commented 3 years ago

Hi, Last candle is always redrawn on new price that comes through websockets, and if that price is higher than chart high or lower than chart low then all candles are redrawn. All my devices work without .setInsecure(), maybe Binance filters secure connections somehow or your router.

guiguijke commented 3 years ago

Thanks for your answer. For an unknown reason, on my side , the price is updated only when timeframe is changing. There are no changes in between... Regards

Le sam. 9 janv. 2021 à 08:58, Olbed notifications@github.com a écrit :

Hi, Last candle is always redrawn on new price that comes through websockets, and if that price is higher than chart high or lower than chart low then all candles are redrawn. All my devices work without .setInsecure(), maybe Binance filters secure connections somehow or your router.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olbed/bitcoin-ticker/issues/4#issuecomment-757113309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUIMM76BW6L7H4VAP4HYD3SZAEBZANCNFSM4VZJGTGA .

spareleg commented 3 years ago

Maybe it's the same problem as with REST API connection and you need to switch websockets connection to insecure mode too

guiguijke commented 3 years ago

Do you have any idea on how to do this ? This is over my arduino's coding skills ... Thanks a lot.

Le sam. 9 janv. 2021 à 09:05, Olbed notifications@github.com a écrit :

Maybe it's the same problem as with REST API connection and you need to switch websockets connection to insecure mode too

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olbed/bitcoin-ticker/issues/4#issuecomment-757113922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUIMM72KOLSEXCJXOBINCLSZAE23ANCNFSM4VZJGTGA .

spareleg commented 3 years ago

First that I would try is to replace webSocket.beginSSL with webSocket.begin in both places

spareleg commented 3 years ago

But I'm not sure if Binance supports not secure websockets connections

guiguijke commented 3 years ago

Well , 1-> if I don't put client.setInsecure(); for the api -> the board reboots , and no price / candle is shown 2-> if I put client.setInsecure(); for the api -> price + candles are drawing on the screen , then error msg " WS Disconnected" . In both cases webSocket.beginSSL or webSocket.begin ---> weirdest thing is that for a timeframe update, everything works well ...

spareleg commented 3 years ago

https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md Seems like Binance only supports wss (secure ws), and the reason secure ws doesn't work is likely the same as why secure rest api doesn't work. Can you test if it works with another router?