Skocz do zawartości

ESP problem z odpaleniem serwera + NTP


Mrpatryk

Pomocna odpowiedź

Witam, pomału robię obsługę zasilacza atx z 2 przetwornicami, pomiar natężenia + napięcia + pomiary 3.3/5/12V wraz z czujnikami temperatury na radiatorach przetwornic, wyświetlacz ST7735. Napotkałem problem z postawieniem serwera " fajnie by było wrzucać sobie wyniki na kompa w tabelce pod Excela ". Wyrzuca mi taki błąd po wyrzuceniu błędu łączy się z wifi ale niestety strona nie startuje wyrzuca błąd " Nie znaleziono strony internetowej pod adresem http://192.168.0.150/ HTTP ERROR 404 ",

Ktoś w temacie ? Mógłby pomóc ? jeśli trzeba to wrzucę kod, ostrzegam jest "rozesrany jak na razie" 🙂

Brownout detector was triggered
21:22:53.545 -> 
21:22:53.545 -> ets Jun  8 2016 00:22:57
21:22:53.545 -> 
21:22:53.590 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
21:22:53.590 -> configsip: 0, SPIWP:0xee
21:22:53.590 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
21:22:53.590 -> mode:DIO, clock div:1
21:22:53.590 -> load:0x3fff0030,len:1184
21:22:53.590 -> load:0x40078000,len:13132
21:22:53.590 -> load:0x40080400,len:3036
21:22:53.590 -> entry 0x400805e4
21:22:53.873 -> E (326) esp_core_dump_flash4�ɕ�dump data check failed:
21:22:53.921 -> Calculated checksum='a570bf2a'
21:22:53.921 -> Image checksum='ffffffff'

 

Edytowano przez Mrpatryk
Link do komentarza
Share on other sites

1 godzinę temu, Mrpatryk napisał:
Brownout detector was triggered

Jak dostajemy taki komunikat to dokładnie sprawdzamy zasilanie ESP32. Spróbuj zasilić z innego źródła.

  • Lubię! 2
Link do komentarza
Share on other sites

17 minut temu, jand napisał:

Jak dostajemy taki komunikat to dokładnie sprawdzamy zasilanie ESP32. Spróbuj zasilić z innego źródła.

Właśnie gdzieś wyczytałem ze to błąd zasilania, jak na cpu esp32 spadnie zasilanie poniżej 2.44V , aktualnie zasilam go z USB - po odłączeniu reszty peryferii taki sam efekt .

Link do komentarza
Share on other sites

24 minuty temu, jand napisał:

Jak dostajemy taki komunikat to dokładnie sprawdzamy zasilanie ESP32. Spróbuj zasilić z innego źródła.

Wrzuciłem mu +5V na wejście VIN i znikł ten komunikat , niestety reszta śmieci dalej aktualna ;/ No i brak serwera ... 

23:49:34.002 -> ets Jun  8 2016 00:22:57
23:49:34.002 -> 
23:49:34.002 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
23:49:34.046 -> configsip: 0, SPIWP:0xee
23:49:34.046 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
23:49:34.046 -> mode:DIO, clock div:1
23:49:34.046 -> load:0x3fff0030,len:1184
23:49:34.046 -> load:0x40078000,len:13132
23:49:34.046 -> load:0x40080400,len:3036
23:49:34.046 -> entry 0x400805e4
23:49:34.358 -> E (326) esp_core_dump_flashh����dump data check failed:
23:49:34.358 -> Calculated checksum='a570bf2a'
23:49:34.358 -> Image checksum='ffffffff'
23:49:38.530 -> .....................................................................................................................................................................................................................................................
23:49:40.988 -> Adres IP:192.168.0.150

 

Link do komentarza
Share on other sites

Zarejestruj się lub zaloguj, aby ukryć tę reklamę.
Zarejestruj się lub zaloguj, aby ukryć tę reklamę.

jlcpcb.jpg

jlcpcb.jpg

Produkcja i montaż PCB - wybierz sprawdzone PCBWay!
   • Darmowe płytki dla studentów i projektów non-profit
   • Tylko 5$ za 10 prototypów PCB w 24 godziny
   • Usługa projektowania PCB na zlecenie
   • Montaż PCB od 30$ + bezpłatna dostawa i szablony
   • Darmowe narzędzie do podglądu plików Gerber
Zobacz również » Film z fabryki PCBWay

To nie są śmieci tylko normalne komunikaty bootowania, oprócz linijek:

7 minut temu, Mrpatryk napisał:
23:49:34.358 -> E (326) esp_core_dump_flashh����dump data check failed:
23:49:34.358 -> Calculated checksum='a570bf2a'
23:49:34.358 -> Image checksum='ffffffff'

które sugerują, że program nie załadował się prawidłowo.

Link do komentarza
Share on other sites

Przed chwilą, jand napisał:

To nie są śmieci tylko normalne komunikaty bootowania, oprócz linijek:

które sugerują, że program nie załadował się prawidłowo.

Próbowałem szukać tych błędów w wujku google ale bez skutecznie niestety . Dzieje się tak gdy próbuje odpalić właśnie prosty serwer HTTP szczerze mówiąc właśnie jeden z przykładów na Frobocie.  

Link do komentarza
Share on other sites

4 minuty temu, jand napisał:

To nie są śmieci tylko normalne komunikaty bootowania, oprócz linijek:

które sugerują, że program nie załadował się prawidłowo.

Teraz nawet jak usunę linijki odpowiadające za stworzenie serwera to dalej wali tym błędem ;/

Link do komentarza
Share on other sites

1 minutę temu, jand napisał:

A jakikolwiek inny program (choćby mruganie diodą) wykonuje się poprawnie?

tak ogolnie każdy program dziala poprawnie, nawet postawienie " samego serwera "- bez mojego kodu i NTP działa- tylko aktualnie teraz dalej wali tym błędem .

Link do komentarza
Share on other sites

3 minuty temu, jand napisał:

A jakikolwiek inny program (choćby mruganie diodą) wykonuje się poprawnie?

Po wgraniu " mrugania diody" zero błędów. 

Link do komentarza
Share on other sites

3 minuty temu, Mrpatryk napisał:

tak ogolnie każdy program dziala poprawnie, nawet postawienie " samego serwera "- bez mojego kodu i NTP działa- tylko aktualnie teraz dalej wali tym błędem .

Wrzucę tu kod, jak byś dał rade rzucić okiem co może bruździć ze wyrzuca takie błędy ? 🙂

Link do komentarza
Share on other sites

#include <SPI.h>
#include "Ucglib.h"
#include <WiFi.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <time.h>
#include <SPIFFS.h> 
#include <ESPAsyncWebServer.h>
#include <Arduino.h>

#ifdef CREDENTIALS
const char* ssid = ******;
const char* password = ******;
#else
const char* ssid = "******";
const char* password = "******";
#endif
float sealevelPressure;
const char* NTP_SERVER = "ch.pool.ntp.org";
const char* TZ_INFO = "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00"; 
AsyncWebServer serwer(80);
Ucglib_ST7735_18x128x160_HWSPI ucg(/*cd=*/ 2, /*cs=*/ 5, /*reset=*/ 4);
#define T 4000
#define DLY() delay(2000)
uint8_t z = 127;	
int d;
int b;
int encoderPos = 0;
int lastEncoderPos = 0;
#define image_HEIGHT   128
#define image_WIDTH    160
uint32_t lcg_rnd(void) {
  z = (uint8_t)((uint16_t)65*(uint16_t)z + (uint16_t)17);
  return (uint32_t)z;
}
int a =-80;

tm timeinfo;
time_t now;
long unsigned lastNTPtime;
unsigned long lastEntryTime;


OneWire oneWire(22 );
DallasTemperature sensors(&oneWire);

//kolory temperatury
 int a1=0;
 int b1 = 0;
int c1 =0;
int a2=0;
 int b2 = 0;
int c2 =0;
int a3=0;
 int b3 = 0;
int c3 =0;

float t1;
float t2;
float t3;
int t = -127;
unsigned long aktualnyCzas = 0;
unsigned long zapamietanyCzas = 0;
unsigned long zapamietanyCzas1 = 0;
unsigned long zapamietanyCzas2 = 0;
unsigned long zapamietanyCzas3= 0;
unsigned long czas = 100;
unsigned long czas1 = 500;
unsigned long czas2 = 1000;
unsigned long czas3 = 10000;
int PRZEKAZNIK = 1;
int PWM = 15;
int SILNIK1 = 19;
int SILNIK2 = 21;
int w =0;
int i=0;


float P33;
float P5;
float P12;
float P212;
float ZP212 = P212;
float A1;
float A2;
float ZA1= A1;
float ZA2;
float W1 = A1 * P212;
float ZW1 = W1;


void setup() {
Serial.begin(115200);
sensors.begin();
sensors.setResolution(9);
ucg.begin(UCG_FONT_MODE_TRANSPARENT);
ucg.setFont(ucg_font_helvB08_hr);
pinMode(PWM, OUTPUT);
pinMode(SILNIK1, OUTPUT);
pinMode(SILNIK2, OUTPUT);
ucg.clearScreen();
ucg.setRotate90();
ucg.setFontPosBaseline();  ucg.setColor(255, 255, 255); ucg.setPrintPos(24,75); ucg.setPrintDir(0); ucg.print(" W I F I  C O N N E C T");
ucg.setFontPosBaseline();  ucg.setColor(255, 255, 255); ucg.setPrintPos(24,40); ucg.setPrintDir(0); ucg.print(" S O F T  L O A D I N G");
//system
ucg.setColor(255, 255, 255); ucg.drawRFrame(10, 50, 8, 8,2);
delay(200);
ucg.setColor(255, 255,220); ucg.drawRFrame(20, 50, 8, 8,2);
delay(200);
ucg.setColor(255, 255, 190); ucg.drawRFrame(30, 50, 8, 8,2);
delay(200);
ucg.setColor(255, 255, 160); ucg.drawRFrame(40, 50, 8, 8,2);
delay(200);
ucg.setColor(255, 255, 130); ucg.drawRFrame(50, 50, 8, 8,2);
delay(200);
ucg.setColor(255, 255, 100); ucg.drawRFrame(60, 50, 8, 8,2);
delay(200);
ucg.setColor(255, 255, 70); ucg.drawRFrame(70, 50, 8, 8,2);
delay(200);
ucg.setColor(220, 255, 35); ucg.drawRFrame(80, 50, 8, 8,2);
delay(200);
ucg.setColor(190, 255, 0); ucg.drawRFrame(90, 50, 8, 8,2);
delay(200);
ucg.setColor(150, 255, 0); ucg.drawRFrame(100, 50, 8, 8,2);
delay(200);
ucg.setColor(120, 255,0); ucg.drawRFrame(110, 50, 8, 8,2);
delay(200);
ucg.setColor(90, 255, 0); ucg.drawRFrame(120, 50, 8, 8,2);
delay(200);
ucg.setColor(60, 255, 0); ucg.drawRFrame(130, 50, 8, 8,2);
delay(200);
ucg.setColor(30, 255, 0); ucg.drawRFrame(140, 50, 8, 8,2);
delay(1000);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
int counter = 0;
while (WiFi.status() != WL_CONNECTED) {    
delay(200);
if (++counter > 100) ESP.restart();
delay(10); }
configTime(0, 0, NTP_SERVER);  
setenv("TZ", TZ_INFO, 1);
if (getNTPtime(10)) {  
} else {
ESP.restart();
}
Serial.printf("\nAdres IP:");
  Serial.println(WiFi.localIP());          

//wifi
ucg.setColor(255, 255, 255); ucg.drawRFrame(10, 85, 8, 8,2);
delay(200);
ucg.setColor(220, 255,255); ucg.drawRFrame(20, 85, 8, 8,2);
delay(200);
ucg.setColor(190, 255, 255); ucg.drawRFrame(30, 85, 8, 8,2);
delay(200);
ucg.setColor(160, 255, 255); ucg.drawRFrame(40, 85, 8, 8,2);
delay(200);
ucg.setColor(130, 230, 255); ucg.drawRFrame(50, 85, 8, 8,2);
delay(200);
ucg.setColor(100, 200, 255); ucg.drawRFrame(60, 85, 8, 8,2);
delay(200);
ucg.setColor(70, 170, 255); ucg.drawRFrame(70, 85, 8, 8,2);
delay(200);
ucg.setColor(35, 150, 255); ucg.drawRFrame(80, 85, 8, 8,2);
delay(200);
ucg.setColor(0, 120, 255); ucg.drawRFrame(90, 85, 8, 8,2);
delay(200);
ucg.setColor(0, 100, 255); ucg.drawRFrame(100, 85, 8, 8,2);
delay(200);
ucg.setColor(0, 80,255); ucg.drawRFrame(110, 85, 8, 8,2);
delay(200);
ucg.setColor(0, 60, 255); ucg.drawRFrame(120, 85, 8, 8,2);
delay(200);
ucg.setColor(0, 40, 255); ucg.drawRFrame(130, 85, 8, 8,2);
delay(200);
ucg.setColor(0, 20, 255); ucg.drawRFrame(140, 85, 8, 8,2);
delay(1000);




ucg.clearScreen();
showTime(timeinfo);
WIFI();

 serwer.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ //na otrzymane od klienta zapytania pod adresem "/" typu GET, 
   request->send(SPIFFS, "/index.html", "text/html");         //odpowiedz plikiem index.html z SPIFFS (można to zmienić na kartę SD) 
                                                               //zawierającym naszą stronę będącą plikem tekstowym HTML
 });
  serwer.begin(); 
}

void loop() {

  aktualnyCzas = millis();
  
 
if (aktualnyCzas - zapamietanyCzas >= czas) {
 // IKONA();
//WENTYLATOR();

i++;
if (i==7){i=0;}
zapamietanyCzas= aktualnyCzas;
}
  if (aktualnyCzas - zapamietanyCzas1 >= czas1) {
    POMIARY();
  
    //if ( P212 != ZP212 ){ucg.setColor(0, 0, 0);  ucg.drawRBox(20,51, 30,10, 1); ucg.setPrintPos(21,60); ucg.setColor(255, 255, 255); ucg.print(P212); } else {
      ucg.setColor(0, 0, 0);  ucg.drawRBox(20,51, 32,10, 1); ucg.setPrintPos(21,60); ucg.setColor(255, 255, 255); ucg.print(P212,1);
//if ( A1 != ZA1 ){ucg.setColor(0, 0, 0); ucg.drawRBox(20,61, 30,10, 1); ucg.setPrintPos(21,70);ucg.setColor(255, 255, 255); ucg.print(A1); } else {
  ucg.setColor(0, 0, 0); ucg.drawRBox(20,61, 32,10, 1); ucg.setPrintPos(21,70);ucg.setColor(255, 255, 255); ucg.print(A1,1); 
//if ( W1 != ZW1 ){ucg.setColor(0, 0, 0); ucg.drawRBox(20,71, 30,10, 1); ucg.setPrintPos(21,80);ucg.setColor(255, 255, 255); ucg.print(W1); } else {
 ucg.setColor(0, 0, 0); ucg.drawRBox(20,71, 32,10, 1); ucg.setPrintPos(21,80);ucg.setColor(255, 255, 255); ucg.print(W1,0); 
  
ERROR1();


      zapamietanyCzas1= aktualnyCzas;
}
 if (aktualnyCzas - zapamietanyCzas2>=czas2) {
   NAPIECIA();
   ERROR();
   MOTOR();
  sensors.requestTemperatures();
  TEMPERATURY();
      zapamietanyCzas2= aktualnyCzas;
}
 
if (aktualnyCzas - zapamietanyCzas3 >= czas3) {
    getTimeReducedTraffic(3600);
  getNTPtime(5);
   showTime(timeinfo);

 
 WIFI();
    zapamietanyCzas3 = aktualnyCzas;
 
}

}
void NAPIECIA(){
  P33 = analogRead(36);
P5 = analogRead(39);
P12 = analogRead(34);
 P5 = P5 * (5.0/4095.0);
 P33 = P33 * (3.3/4095.0);
 P12 = P12 * (12.3/4095.0);
if (P33 >= 3){ucg.setColor(0, 200, 0); }  if(P33 <3) {ucg.setColor(0, 50, 200);} if (P33 <=0.2){ucg.setColor(255, 0, 0);}
ucg.drawRBox(3,109, 48,18, 4);
ucg.setColor(255, 255, 255); ucg.drawRFrame(2, 108, 50, 20,4);
ucg.setFontPosBaseline();  ucg.setColor(0, 0, 0); ucg.setPrintPos(15,122); ucg.setPrintDir(0); ucg.print(P33);ucg.print("V");
if (P5 >= 5){ucg.setColor(0, 200, 0); }  if(P5 <5) {ucg.setColor(0, 50, 200);} if (P5 <=0.2){ucg.setColor(255, 0, 0);}
ucg.drawRBox(56,109, 48,18, 4);
ucg.setColor(255, 255, 255); ucg.drawRFrame(55, 108, 50, 20,4);
ucg.setFontPosBaseline();  ucg.setColor(0, 0, 0); ucg.setPrintPos(68,122); ucg.setPrintDir(0); ucg.print(P5);ucg.print("V");
if (P12 >= 12){ucg.setColor(0, 200, 0); }  if(P12 <12) {ucg.setColor(0, 50, 200);} if (P12 <=0.2){ucg.setColor(255, 0, 0);}
ucg.drawRBox(109,109, 48,18, 4);
ucg.setColor(255, 255, 255); ucg.drawRFrame(108, 108, 50, 20,4);
ucg.setFontPosBaseline();  ucg.setColor(0, 0, 0); ucg.setPrintPos(120,122); ucg.setPrintDir(0); ucg.print(P12);ucg.print("V");}



void TEMPERATURY () {

if (t1 != sensors.getTempCByIndex(0)) {t1 = sensors.getTempCByIndex(0);}
if (t2 != sensors.getTempCByIndex(1)) {t2 = sensors.getTempCByIndex(1);}
if (t3 != sensors.getTempCByIndex(2)) {t3 = sensors.getTempCByIndex(2);}




if (t1 <= 30){ a1=0; b1=255; c1=0;}
else if  (t1 ==31){ a1=50; b1=255; c1=0;}
else if (t1 ==32){ a1=70; b1=255; c1=0;}
else if  (t1 ==33){ a1=100; b1=255; c1=0;}
else if  (t1 ==34){ a1=130; b1=255; c1=0;}
else if  (t1 ==35){ a1=160; b1=255; c1=0;}
else if  (t1 ==36){ a1=170; b1=200; c1=0;}
else if  (t1 ==37){ a1=180; b1=180; c1=0;}
else if  (t1 ==38){ a1=200; b1=160; c1=0;}
else if  (t1 ==39){ a1=220; b1=140; c1=0;}
else if  (t1 ==40){ a1=255; b1=120; c1=0;}
else if  (t1 ==41){ a1=255; b1=100; c1=0;}
else if  (t1 ==42){ a1=255; b1=80; c1=0;}
else if  (t1 ==43){ a1=255; b1=60; c1=0;}
else if  (t1 ==44){ a1=255; b1=40; c1=0;}
else if  (t1 >=45){ a1=255; b1=0; c1=0;}

if (t2 <= 30){ a2=0; b2=255; c2=0;}
else if  (t2 ==31){ a2=50; b2=255; c2=0;}
else if (t2 ==32){ a2=70; b2=255; c2=0;}
else if  (t2 ==33){ a2=100; b2=255; c2=0;}
else if  (t2 ==34){ a2=130; b2=255; c2=0;}
else if  (t2 ==35){ a2=160; b2=255; c2=0;}
else if  (t2==36){ a2=170; b2=200; c2=0;}
else if  (t2 ==37){ a2=180; b2=180; c2=0;}
else if  (t2 ==38){ a2=200; b2=160; c2=0;}
else if  (t2 ==39){ a2=220; b2=140; c2=0;}
else if  (t2 ==40){ a2=255; b2=120; c2=0;}
else if  (t2 ==41){ a2=255; b2=100; c2=0;}
else if  (t2 ==42){ a2=255; b2=80; c2=0;}
else if  (t2 ==43){ a2=255; b2=60; c2=0;}
else if  (t2 ==44){ a2=255; b2=40; c2=0;}
else if  (t2 >=45){ a2=255; b2=0; c2=0;}

if (t3 <= 30){ a3=0; b3=255; c3=0;}
else if  (t3 ==31){ a3=50; b3=255; c3=0;}
else if (t3 ==32){ a3=70; b3=255; c3=0;}
else if  (t3 ==33){ a3=100; b3=255; c3=0;}
else if  (t3 ==34){ a3=130; b3=255; c3=0;}
else if  (t3 ==35){ a3=160; b3=255; c3=0;}
else if  (t3 ==36){ a3=170; b3=200; c3=0;}
else if  (t3 ==37){ a3=180; b3=180; c3=0;}
else if  (t3 ==38){ a3=200; b3=160; c3=0;}
else if  (t3 ==39){ a3=220; b3=140; c3=0;}
else if  (t3 ==40){ a3=255; b3=120; c3=0;}
else if  (t3 ==41){ a3=255; b3=100; c3=0;}
else if  (t3 ==42){ a3=255; b3=80; c3=0;}
else if  (t3 ==43){ a3=255; b3=60; c3=0;}
else if  (t3 ==44){ a3=255; b3=40; c3=0;}
else if  (t3 >=45){ a3=255; b3=0; c3=0;}


ucg.setColor(255, 255, 255); ucg.drawRFrame(108, 20, 50, 20,4);
ucg.setColor(a1, b1, c1);
ucg.drawRBox(109,21, 48,18, 4);
 
ucg.setFontPosBaseline();  if ( t1>= 45) {ucg.setColor(255, 255, 255);} else{ucg.setColor(0, 0, 0);} ucg.setPrintPos(111,35); ucg.setPrintDir(0); ucg.print(" Z:   "); if (t1 == -127 ) { ucg.print("###");}else {;ucg.print(t1,0);ucg.print("'c");}

ucg.setColor(255, 255, 255); ucg.drawRFrame(108, 42, 50, 20,4);
ucg.setColor(a2, b2, c2);
ucg.drawRBox(109,43, 48,18, 4);
ucg.setFontPosBaseline();  if ( t2 >= 45) {ucg.setColor(255, 255, 255);} else{ucg.setColor(0, 0, 0);} ucg.setPrintPos(111,55); ucg.setPrintDir(0); ucg.print("P1:  "); if (t2 == -127 ) { ucg.print("###");}else {;ucg.print(t2,0);ucg.print("'c");}

 ucg.setColor(255, 255, 255); ucg.drawRFrame(108, 64, 50, 20,4);
ucg.setColor(a3, b3, c3);
ucg.drawRBox(109,65, 48,18, 4);
ucg.setFontPosBaseline();  if ( t3 >= 45) {ucg.setColor(255, 255, 255);} else{ucg.setColor(0, 0, 0);}  ucg.setPrintPos(111,77); ucg.setPrintDir(0); ucg.print("P2:  "); if (t3 == -127 ) { ucg.print("###");}else {;ucg.print(t3,0);ucg.print("'c");}




}

void ERROR() {
  ucg.setColor(255, 255, 255); ucg.drawRFrame(2, 86, 156, 20,4);
if (t1 == -127 || t2 == -127 || t3 == -127){
  ucg.setColor(255, 0, 0);
  
  ucg.drawRBox(3,87, 154,18, 4);
  ucg.setColor(255, 0, 0);
  ucg.setPrintPos(35,100); ucg.setPrintDir(0); ucg.print("ERROR SENSOR !!!");}
 else if (t1 >= 35 || t2 >= 35 || t3 >= 35 ){ ucg.setColor(255, 0, 0);
  
  ucg.drawRBox(3,87, 154,18, 4);
  ucg.setColor(255, 0, 0);
  ucg.setPrintPos(4,100); ucg.setPrintDir(0); ucg.print("WYSOKA TEMPERATURA !!!");
  
  
  
  } else if (P33 == 3.3 || P5 == 5.0 || P12 == 12.3 && t1 <= 35 && t2 <= 35 && t3 <= 35 && t1 != -127 && t2 != -127 && t3 != -127) {ucg.setColor(0, 255, 0);
  
  ucg.drawRBox(3,87, 154,18, 4);
  ucg.setColor(0, 0,0);ucg.setPrintPos(61,100); ucg.setPrintDir(0); ucg.print("POWER");
  }
  
   else { ucg.setColor(255, 0, 0);
  ucg.drawRBox(3,87, 154,18, 4);
   ucg.setColor(255, 255,255);ucg.setPrintPos(45,100); ucg.setPrintDir(0); ucg.print("BRAK NAPIEC");
  }
  


  
  }
void ERROR1(){

if (t1 == -127 || t2 == -127 || t3 == -127){
 ucg.setPrintPos(35,100); ucg.setPrintDir(0); 
 
  ucg.setColor(255, 255, 255);
  ucg.print("ERROR SENSOR !!!");}

 else if (t1 > 35 || t2 > 35 || t3 > 35 ){ 
  
  
  ucg.setColor(255, 255, 255);
  ucg.setPrintPos(6,100); ucg.setPrintDir(0); ucg.print("WYSOKA TEMPERATURA !!!");
  
  
  }


}

void MOTOR()
{
  if (t1 >= 32 || t2 >= 32 || t3 >= 32){
  analogWrite(PWM, 255);
  digitalWrite(SILNIK1, LOW);
  digitalWrite(SILNIK2, HIGH);} else { analogWrite(PWM, 0);
  digitalWrite(SILNIK1, LOW);
  digitalWrite(SILNIK2, LOW);}
}
void WENTYLATOR(){

}

void IKONA(){
  if (P33 == 3.3 || P5 == 5.0 || P12 == 12.3 && t1 <= 35 && t2 <= 35 && t3 <= 35 && t1 != -127 && t2 != -127 && t3 != -127) {


if (i==0){ ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 6, UCG_DRAW_ALL); ucg.setColor(0, 255, 0); ucg.drawCircle(55, 8, 1, UCG_DRAW_ALL);
}

if (i==1){ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 5, UCG_DRAW_ALL); ucg.setColor(0, 255, 0); ucg.drawCircle(55, 8, 2, UCG_DRAW_ALL);
}

if (i==2){ ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 4, UCG_DRAW_ALL); ucg.setColor(0, 255, 0); ucg.drawCircle(55, 8, 3, UCG_DRAW_ALL);
}

if (i==3){ ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 3, UCG_DRAW_ALL); ucg.setColor(0, 255, 0); ucg.drawCircle(55, 8, 4, UCG_DRAW_ALL);
}

if (i==4){ ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 2, UCG_DRAW_ALL); ucg.setColor(0, 255, 0); ucg.drawCircle(55, 8, 5, UCG_DRAW_ALL);
}

if (i==5){ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 1, UCG_DRAW_ALL); ucg.setColor(0, 255, 0); ucg.drawCircle(55, 8, 6, UCG_DRAW_ALL);
}} else {
ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 1, UCG_DRAW_ALL);
ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 2, UCG_DRAW_ALL);
ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 3, UCG_DRAW_ALL);
ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 4, UCG_DRAW_ALL);
ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 5, UCG_DRAW_ALL);
ucg.setColor(0, 0, 0); ucg.drawCircle(55, 8, 6, UCG_DRAW_ALL);
}


}

void WIFI () {

if (WiFi.status()== WL_CONNECTED){

  ucg.setColor(0, 0, 255); ucg.drawDisc(2, 13, 10,UCG_DRAW_UPPER_RIGHT);
 ucg.setColor(0, 0, 0); ucg.drawDisc(2, 13, 8,UCG_DRAW_UPPER_RIGHT);
 ucg.setColor(0, 0, 255); ucg.drawDisc(2, 13, 6,UCG_DRAW_UPPER_RIGHT);
 ucg.setColor(0, 0, 0); ucg.drawDisc(2, 13, 4,UCG_DRAW_UPPER_RIGHT);
 ucg.setColor(0, 0, 255); ucg.drawDisc(2, 13, 2,UCG_DRAW_UPPER_RIGHT);

 ucg.setFontPosBaseline();  ucg.setColor(255, 255, 0); ucg.setPrintPos(18,13); ucg.setPrintDir(0); ucg.print(WiFi.localIP());
}}





void POMIARY() {
 
A1 = analogRead(32);
P212 = analogRead(35);
A2 = analogRead(33);

P212 = P212 * (12.3/4095.0);
  W1 = A1 * P212;
float P2122 = P212; 
 ucg.setColor(255, 255, 255); ucg.drawRFrame(2, 20, 104, 64,4);
 ucg.drawLine(54, 40, 54, 75);
ucg.setFontPosBaseline();  ucg.setColor(255, 170, 0); ucg.setPrintPos(20,33); ucg.setPrintDir(0); ucg.print("P O M I A R Y");
ucg.setFontPosBaseline();  ucg.setColor(255, 255, 255); ucg.setPrintPos(20,45); ucg.setPrintDir(0); ucg.print("P1");

ucg.setFontPosBaseline();  ucg.setColor(255, 0, 0); ucg.setPrintPos(7,60); ucg.setPrintDir(0); ucg.print("V: "); 
  
ucg.setFontPosBaseline();  ucg.setColor(0, 0, 255); ucg.setPrintPos(7,69); ucg.setPrintDir(0); ucg.print("A: ");
ucg.setFontPosBaseline();  ucg.setColor(125, 125, 125); ucg.setPrintPos(7,80); ucg.setPrintDir(0); ucg.print("W: ");

ucg.setFontPosBaseline();  ucg.setColor(255, 255, 255); ucg.setPrintPos(75,45); ucg.setPrintDir(0); ucg.print("P2");

ucg.setFontPosBaseline();  ucg.setColor(255, 0, 0); ucg.setPrintPos(60,60); ucg.setPrintDir(0); ucg.print("V: ");ucg.setColor(255, 255, 255); ucg.print("----");
ucg.setFontPosBaseline();  ucg.setColor(0, 0, 255); ucg.setPrintPos(60,69); ucg.setPrintDir(0); ucg.print("A: "); ucg.setColor(255, 255, 255);ucg.print("0.00");
ucg.setFontPosBaseline();  ucg.setColor(125, 125, 125); ucg.setPrintPos(60,80); ucg.setPrintDir(0); ucg.print("W: ");ucg.setColor(255, 255, 255);ucg.print("----");

}
bool getNTPtime(int sec) {

  {
    uint32_t start = millis();
    do {
      time(&now);
      localtime_r(&now, &timeinfo);
      Serial.print(".");
      delay(10);
    } while (((millis() - start) <= (1000 * sec)) && (timeinfo.tm_year < (2016 - 1900)));
    if (timeinfo.tm_year <= (2016 - 1900)) return false;  
   // Serial.print("now ");  Serial.println(now);
    char time_output[30];
    strftime(time_output, 30, "%a  %d-%m-%y %T", localtime(&now));
   
  }
  return true;
}


  void getTimeReducedTraffic(int sec) {
  tm *ptm;
  if ((millis() - lastEntryTime) < (1000 * sec)) {
    now = lastNTPtime + (int)(millis() - lastEntryTime) / 1000;
  } else {
    lastEntryTime = millis();
    lastNTPtime = time(&now);
    now = lastNTPtime;
    Serial.println("Get NTP time");
  }
  ptm = localtime(&now);
  timeinfo = *ptm;
}

  void showTime(tm localTime) {
    if ( localTime.tm_hour +1) {ucg.setColor(0, 0, 0);
ucg.drawBox(115,2, 20,18);}
if ( localTime.tm_min +1 ) {ucg.setColor(0, 0, 0);
ucg.drawBox(132,2, 20,18);}
ucg.setFontPosBaseline();  ucg.setColor(255, 255, 255); ucg.setPrintPos(120,13); ucg.setPrintDir(0); 
  if (localTime.tm_hour <= 9) {ucg.print("0");}
 ucg.print(localTime.tm_hour);
ucg.print(':');
if (localTime.tm_min <= 9) {ucg.print("0");}
  ucg.print(localTime.tm_min);
  
}

 

Link do komentarza
Share on other sites

Problem ma dwa aspekty:

1. dlaczego coreDump się nie udaje ? (błąd konfiguracji partycji?)

2. jaki błąd powoduje, że system w ogóle chce zrobić coreDump? (Dzieje się to na samym początku, jeszcze przed nawiązanie połączenia wifi.)

Jak się rozwiąże problem 2, to problem 1 sam zniknie.

Ponieważ istotnie

19 godzin temu, Mrpatryk napisał:

kod, ostrzegam jest "rozesrany jak na razie" 🙂

trudno jest go prześledzić (a trzeba to zrobi w połączeniu z bibliotekami).

Proponuję zacząć od czegoś małego - np. sam pomiar temperatury, a potem dokładać po małym kawałku.

  • Lubię! 1
Link do komentarza
Share on other sites

Dnia 7.02.2023 o 17:19, jand napisał:

Problem ma dwa aspekty:

1. dlaczego coreDump się nie udaje ? (błąd konfiguracji partycji?)

2. jaki błąd powoduje, że system w ogóle chce zrobić coreDump? (Dzieje się to na samym początku, jeszcze przed nawiązanie połączenia wifi.)

Jak się rozwiąże problem 2, to problem 1 sam zniknie.

Ponieważ istotnie

trudno jest go prześledzić (a trzeba to zrobi w połączeniu z bibliotekami).

Proponuję zacząć od czegoś małego - np. sam pomiar temperatury, a potem dokładać po małym kawałku.

Rozwiązałem problem zmieniając biblioteke ekranu tft st7735 . Pies wie co tam krzaczyło.

  • Lubię! 1
Link do komentarza
Share on other sites

Dołącz do dyskusji, napisz odpowiedź!

Jeśli masz już konto to zaloguj się teraz, aby opublikować wiadomość jako Ty. Możesz też napisać teraz i zarejestrować się później.
Uwaga: wgrywanie zdjęć i załączników dostępne jest po zalogowaniu!

Anonim
Dołącz do dyskusji! Kliknij i zacznij pisać...

×   Wklejony jako tekst z formatowaniem.   Przywróć formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Twój link będzie automatycznie osadzony.   Wyświetlać jako link

×   Twoja poprzednia zawartość została przywrócona.   Wyczyść edytor

×   Nie możesz wkleić zdjęć bezpośrednio. Prześlij lub wstaw obrazy z adresu URL.

×
×
  • Utwórz nowe...

Ważne informacje

Ta strona używa ciasteczek (cookies), dzięki którym może działać lepiej. Więcej na ten temat znajdziesz w Polityce Prywatności.