Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamnowy.zielony.pczątku wrote:.Code: C / C++Log in, to see the code
nowy.zielony.pczątku wrote:.Code: C / C++Log in, to see the code
nowy.zielony.pczątku wrote:..Code: C / C++Log in, to see the code
nowy.zielony.pczątku wrote:and there isconst char* host = "api.coindesk.com";
nowy.zielony.pczątku wrote:There wasconst char* host = "bitbay.net";
nowy.zielony.pczątku wrote:and it isString url = "/v1/bpi/currentprice.json";
nowy.zielony.pczątku wrote:.String url = "/API/Public/BTCPLN/ticker.json";
nowy.zielony.pczątku wrote:.Arduino reboots every now and then after showing IP or after showing the course, this is the first problem, is this indicative of a faulty arduino?
nowy.zielony.pczątku wrote:.The second is that after connecting to the local internet it crashes on showing the IP address and does nothing further
khoam wrote:.I tested the program for several tens of minutes, but without the LCD display. There were no reboots. Try testing my version of the program from post #8 and write if there are reboots too. If there are none, then the problem may lie, somewhere in the handling of the display.
khoam wrote:.Do you power the LCD module from +5V?
khoam wrote:.If so, did you forget the level converters on the I2C bus between the Wemos and the display?
nowy.zielony.pczątku wrote:.Displays such bushes:
nowy.zielony.pczątku wrote:.What is that?
nowy.zielony.pczątku wrote:.The ESP8266 version is: 2.6.0
nowy.zielony.pczątku wrote:.The second thing is that I would like the display backlight to turn on after a "swipe" of the hand and that works only problem is that there are delay-e and other fucktions that delay.
khoam wrote:Maybe a better solution to start with would be to retrieve this data without validating the site certificate or fingerprint. The main change is to replace the following line of code:
Code: c Expand Select all
client.setFingerprint(fingerprint);
By the following:
Code: c Expand Select All
client.setInsecure();
Check if this will work with the "api.bitbay.net" website.
khoam wrote:.new.green.start wrote:
The other thing is I'd like the display backlight to turn on when the hand is "swiped", and that works only problem is there are delay-e and other fuctions that delay.
I understand that on any of the ports the logic state changes due to a "swipe" of the hand? If so, the easiest way would be to connect an interrupt to that pin and set the display to brighten up in the interrupt handler - then it would happen immediately regardless of the delays in loop(). Turning off the backlight would have to happen already in loop() after the specified time.
https://randomnerdtutorials.com/interrupts-timers-esp8266-arduino-ide-nodemcu/
https://arduino-esp8266.readthedocs.io/en/latest/reference.html#interrupts
nowy.zielony.pczątku wrote:.Does esp32 need to be used or is it enough to tweak the code somehow? I tried to solve this problem with the millis() function but failed.
JanuszKornas wrote:.As you understand this code, you will grasp what you want and be able to do not such things....
JanuszKornas wrote:Generally the principle of using millis() instead of delay() is that the processor flies through the loop as fast as the timer allows it, and will only perform your task (changing the state of the LED or whatever) when the time comes. This is a different way of solving your probem than interrupts.
TL;DR: In 100 % of reported tests, downgrading the ESP8266 Arduino core from v2.6.0 to v2.5.2 stopped random reboots; “My bet is on the stack size being too small” [Elektroda, khoam, post #18518691]
Why it matters: stable firmware keeps the crypto-price display online.
• Default I2C address for most 20 × 4 LCD backpacks: 0x27 [Elektroda, nowy.zielony.pczątku, post #18252056] • HTTPS port used by BitBay API: 443 [Elektroda, khoam, post #18266789] • Valid SHA-1 fingerprint (to 14-08-2020): 88 66 2B 6B E8 69 7C 4D FD A4 91 30 A7 2C 5C 82 0D D7 F3 FB [Elektroda, khoam, post #18452278] • Suggested FreeRTOS task stack on ESP32: 4 096–10 000 B [Elektroda, khoam, post #18518691] • Typical refresh gap between API calls: 5 s [Elektroda, nowy.zielony.pczątku, post #18252056]