text:
CUT HERE FOR EXCEPTION DECODER --------------- Exception (0): esp8266
Why does my program end up with CUT HERE FOR EXCEPTION DECODER for esp8266?
I am triying to integrate gps and accelerometers with a website. integrating gps is the hardest one since it always refuse to be connected. gps.location.isValid() and gps.location.isUpdated() not working when all of them combined, but every one of them can work fine on their own.
#include <Wire.h>
#include <MPU6050.h>
#include <WiFiClientSecure.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
#include <SoftwareSerial.h>
#include <TinyGPS++.h>

bool zz = false;
int sensor = 1;
float bujur = 1.123456, lintang = 6.654321, maxG_Total_decrement, maxG_Total = 0.0;
#define wifi_ssid "raiden"
#define wifi_pass "12341234"
#define RXPin 14 // sambungkan TX gps ke rx 14
#define TXPin 12 // sambungkan RX gps ke tx 12

MPU6050 mpu;
TinyGPSPlus gps;
StaticJsonDocument<2000> json_web;
SoftwareSerial ss(RXPin, TXPin);

void kirim_data() {
  if (WiFi.status() == WL_CONNECTED) {
    WiFiClientSecure client;
    client.setInsecure(); // Tidak aman, hanya untuk testing, gunakan sertifikat CA yang valid untuk produksi
    HTTPClient https;

    if (https.begin(client, "https://EXAMPLE.com/submit_data.php")) {
      https.addHeader("Content-Type", "application/json");

      // Update nilai latitude dan longitude di dalam JSON
      json_web["latitude"] = String(lintang, 6); // Konversi float ke string dengan 6 desimal
      json_web["longitude"] = String(bujur, 6);

      // Tambahkan data sensor ke JSON
      json_web["sensor"] = String(sensor);

      String jsonData;
      serializeJson(json_web, jsonData);

      Serial.println("Start POST...");
      Serial.println(jsonData);

      int httpCode = https.POST(jsonData);

      if (httpCode > 0) {
        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_CREATED) {
          Serial.println("Data sent! Code: " + String(httpCode));
        } else {
          Serial.println("POST failed! Code: " + String(httpCode));
        }
      } else {
        Serial.println("HTTP POST failed! Error: " + https.errorToString(httpCode));
      }

      https.end();
    } else {
      Serial.println("Unable to connect to the server.");
    }
  } else {
    Serial.println("WiFi not connected!");
  }
  json_web.clear();
}

void updateVariables() {
  int16_t ax, ay, az, gx, gy, gz;
  maxG_Total = 0.0; // Reset maxG_Total ke 0 setiap update iterasi
  mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); // mengambil nilai akselerasi dengan library mpu
  float accelScale = 32768.0 / 16; // Accelerometer sensitivity scale factor (LSB/g)
  float ax_g = ax / accelScale;
  float ay_g = ay / accelScale;
  float az_g = az / accelScale;
  float G_begin = sqrt(ax_g * ax_g + ay_g * ay_g + az_g * az_g);

  unsigned long startMillis = millis();
  while (millis() - startMillis < 150 && (G_begin > 2.4)) {
    mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
    ax_g = ax / accelScale;
    ay_g = ay / accelScale;
    az_g = az / accelScale;
    float G_Total = sqrt(ax_g * ax_g + ay_g * ay_g + az_g * az_g);

    if (G_Total > maxG_Total) {
      maxG_Total = G_Total;
    }
  }

  if (maxG_Total > 13) {
    zz = true;
    float maxG_Total_decrement = maxG_Total;
    Serial.println("sensor mengirim zz");
  }

  maxG_Total_decrement = 0.0;
}

void setup() {
  Serial.begin(9600);
  ss.begin(9600);

  delay(300);
  Wire.begin();
  delay(300);

  WiFi.begin(wifi_ssid, wifi_pass);
  delay(5000);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.println("Mencoba terhubung ke WiFi...");
    delay(2000);
  }

  mpu.initialize();
  mpu.setFullScaleAccelRange(MPU6050_ACCEL_FS_16);
  delay(300);

  Serial.print("Connecting to: ");
  Serial.println(wifi_ssid);
  Serial.println("\nConnected to WiFi!");
}

void loop() {
  // Debugging untuk memastikan loop utama berjalan

  while (ss.available() > 0) {
    Serial.println("SS start");
    delay(500);
    if (gps.encode(ss.read())){
      Serial.println("encode start");
      delay(500);

         if (gps.location.isUpdated()) {
      Serial.println("Location update:");
      lintang = gps.location.lat();
      bujur = gps.location.lng();
      Serial.print("Latitude: ");
      Serial.println(lintang, 6);
      Serial.println(gps.location.lat());
      Serial.print("Longitude: ");
      Serial.println(bujur, 6);
      Serial.println(gps.location.lng());
    } else {
      Serial.println("Tidak ada update dari GPS");
    }

    if (gps.location.isValid()) {
      Serial.println("Location Valid:");
      lintang = gps.location.lat();
      bujur = gps.location.lng();
      Serial.print("Latitude: ");
      Serial.println(lintang, 6);
      Serial.println(gps.location.lat());
      Serial.print("Longitude: ");
      Serial.println(bujur, 6);
      Serial.println(gps.location.lng());

    } else {
      Serial.println("Tidak ada valid data dari GPS");
    }

    }

  }

  updateVariables();

  if (zz) {
    kirim_data();
    zz = false; // Reset zz for nextdata
  }

  delay(1000);
}

and this is the eror message

 --------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (0):
epc1=0x4020cec8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: sys
sp: 3fffeb80 end: 3fffffb0 offset: 0190
3fffed10:  00000014 00000028 00000003 00000003
3fffed20:  00000000 000000dd 00000000 3ffedd3b
3fffed30:  00000000 00000000 00004000 40100600
3fffed40:  03ac0f00 3fffee15 3fffc228 c0033035
3fffed50:  00000000 00000001 0000000e 40100b3c
3fffed60:  00000020 00000030 00000012 ffffffe0
3fffed70:  40000fb0 00000010 00000521 00000022
3fffed80:  3fffc200 40100a78 3fffc258 4000050c
3fffed90:  400046a4 00000030 00000020 ffffffff
3fffeda0:  40105c7b 00000000 00000000 00000001
3fffedb0:  04000002 fffffeff 3feffe00 00000100
3fffedc0:  e690a568 00000001 04000002 00000008
3fffedd0:  00000000 00000000 60000600 00000030
3fffede0:  3ffed750 3fffee90 3ffedde0 00000016
3fffedf0:  402397d8 3fffee90 3ffedc88 3ffed614
3fffee00:  40239839 3fffee90 3fffee90 ffffff80
3fffee10:  0000025f 0000024d 00004000 00000100
3fffee20:  3ffe9ba0 7fffffff 00000000 c0037035
3fffee30:  00000000 00000001 0000000e 40100b3c
3fffee40:  00000000 00000000 0000001f 40100600
3fffee50:  3ffee4c0 3ffef90c 3fffc228 401064a1
3fffee60:  4000050c 40100a78 3fffc258 4000050c
3fffee70:  40000f68 00000030 00000010 ffffffff
3fffee80:  40000f58 00000000 00000020 00000000
3fffee90:  401021be 4024a954 3ffee498 00000000
3fffeea0:  40247621 3ffe9104 00000000 3fffdab0
3fffeeb0:  00000000 3fffdcb0 3ffee4e0 00000030
3fffeec0:  000000b0 00000016 3ffe85f8 40242994
3fffeed0:  00000008 00000000 f7ffffff 60000600
3fffeee0:  00000008 00000000 f7ffffff 40219c45
3fffeef0:  4024a488 00000008 3ffee4c0 0101f2d2
3fffef00:  4024a8a2 00505ac6 60000600 60000600
3fffef10:  0101adff 3ffee4c0 4024a967 3ffe904c
3fffef20:  3ffee4c0 00507048 3ffee4c0 60000600
3fffef30:  40251b75 3ffe904c 3ffee4c0 0101adff
3fffef40:  40251bba 3fffdab0 00000000 3fffdcb0
3fffef50:  3ffee4e8 40000f65 3fffdab0 00000000
3fffef60:  40000f49 3ffe9420 3fffdab0 40000f49
3fffef70:  40000e19 00063cab bff00000 0000bfff
3fffef80:  00000005 aa55aa55 000000ed 40105d09
3fffef90:  40105d0f bff00000 0000bfff 1200004b
3fffefa0:  4010000d bff00000 00063cab 401000ab
3fffefb0:  40241e44 3fffef4c 40241dfd 3fffff28
3fffefc0:  3fffffd0 00000000 00000000 feefeffe
3fffefd0:  feefeffe feefeffe feefeffe feefeffe
3fffefe0:  feefeffe feefeffe feefeffe feefeffe
3fffeff0:  feefeffe feefeffe feefeffe feefeffe
3ffff000:  feefeffe feefeffe feefeffe feefeffe
3ffff010:  feefeffe feefeffe feefeffe feefeffe
3ffff020:  feefeffe feefeffe feefeffe feefeffe
3ffff030:  feefeffe feefeffe feefeffe feefeffe
3ffff040:  feefeffe feefeffe feefeffe feefeffe
3ffff050:  feefeffe feefeffe feefeffe feefeffe
3ffff060:  feefeffe feefeffe feefeffe feefeffe
3ffff070:  feefeffe feefeffe feefeffe feefeffe
3ffff080:  feefeffe feefeffe feefeffe feefeffe
3ffff090:  feefeffe feefeffe feefeffe feefeffe
3ffff0a0:  feefeffe feefeffe feefeffe feefeffe
3ffff0b0:  feefeffe feefeffe feefeffe feefeffe
3ffff0c0:  feefeffe feefeffe feefeffe feefeffe
3ffff0d0:  feefeffe feefeffe feefeffe feefeffe
3ffff0e0:  feefeffe feefeffe feefeffe feefeffe
3ffff0f0:  feefeffe feefeffe feefeffe feefeffe
3ffff100:  feefeffe feefeffe feefeffe feefeffe
3ffff110:  feefeffe feefeffe feefeffe feefeffe
3ffff120:  feefeffe feefeffe feefeffe feefeffe
3ffff130:  feefeffe feefeffe feefeffe feefeffe
3ffff140:  feefeffe feefeffe feefeffe feefeffe
3ffff150:  feefeffe feefeffe feefeffe feefeffe
3ffff160:  feefeffe feefeffe feefeffe feefeffe
3ffff170:  feefeffe feefeffe feefeffe feefeffe
3ffff180:  feefeffe feefeffe feefeffe feefeffe
3ffff190:  feefeffe feefeffe feefeffe feefeffe
3ffff1a0:  feefeffe feefeffe feefeffe feefeffe
3ffff1b0:  feefeffe feefeffe feefeffe feefeffe
3ffff1c0:  feefeffe feefeffe feefeffe feefeffe
3ffff1d0:  feefeffe feefeffe feefeffe feefeffe
3ffff1e0:  feefeffe feefeffe feefeffe feefeffe
3ffff1f0:  feefeffe feefeffe feefeffe feefeffe
3ffff200:  feefeffe feefeffe feefeffe feefeffe
3ffff210:  feefeffe feefeffe feefeffe feefeffe
3ffff220:  feefeffe feefeffe feefeffe feefeffe
3ffff230:  feefeffe feefeffe feefeffe feefeffe
3ffff240:  feefeffe feefeffe feefeffe feefeffe
3ffff250:  feefeffe feefeffe feefeffe feefeffe
3ffff260:  feefeffe feefeffe feefeffe feefeffe
3ffff270:  feefeffe feefeffe feefeffe feefeffe
3ffff280:  feefeffe feefeffe feefeffe feefeffe
3ffff290:  feefeffe feefeffe feefeffe feefeffe
3ffff2a0:  feefeffe feefeffe feefeffe feefeffe
3ffff2b0:  feefeffe feefeffe feefeffe feefeffe
3ffff2c0:  feefeffe feefeffe feefeffe feefeffe
3ffff2d0:  feefeffe feefeffe feefeffe feefeffe
3ffff2e0:  feefeffe feefeffe feefeffe feefeffe
3ffff2f0:  feefeffe feefeffe feefeffe feefeffe
3ffff300:  feefeffe feefeffe feefeffe feefeffe
3ffff310:  feefeffe feefeffe feefeffe feefeffe
3ffff320:  feefeffe feefeffe feefeffe feefeffe
3ffff330:  feefeffe feefeffe feefeffe feefeffe
3ffff340:  feefeffe feefeffe feefeffe feefeffe
3ffff350:  feefeffe feefeffe feefeffe feefeffe
3ffff360:  feefeffe feefeffe feefeffe feefeffe
3ffff370:  feefeffe feefeffe feefeffe feefeffe
3ffff380:  feefeffe feefeffe feefeffe feefeffe
3ffff390:  feefeffe feefeffe feefeffe feefeffe
3ffff3a0:  feefeffe feefeffe feefeffe feefeffe
3ffff3b0:  feefeffe feefeffe feefeffe feefeffe
3ffff3c0:  feefeffe feefeffe feefeffe feefeffe
3ffff3d0:  feefeffe feefeffe feefeffe feefeffe
3ffff3e0:  feefeffe feefeffe feefeffe feefeffe
3ffff3f0:  feefeffe feefeffe feefeffe feefeffe
3ffff400:  feefeffe feefeffe feefeffe feefeffe
3ffff410:  feefeffe feefeffe feefeffe feefeffe
3ffff420:  feefeffe feefeffe feefeffe feefeffe
3ffff430:  feefeffe feefeffe feefeffe feefeffe
3ffff440:  feefeffe feefeffe feefeffe feefeffe
3ffff450:  feefeffe feefeffe feefeffe feefeffe
3ffff460:  feefeffe feefeffe feefeffe feefeffe
3ffff470:  feefeffe feefeffe feefeffe feefeffe
3ffff480:  feefeffe feefeffe feefeffe feefeffe
3ffff490:  feefeffe feefeffe feefeffe feefeffe
3ffff4a0:  feefeffe feefeffe feefeffe feefeffe
3ffff4b0:  feefeffe feefeffe feefeffe feefeffe
3ffff4c0:  feefeffe feefeffe feefeffe feefeffe
3ffff4d0:  feefeffe feefeffe feefeffe feefeffe
3ffff4e0:  feefeffe feefeffe feefeffe feefeffe
3ffff4f0:  feefeffe feefeffe feefeffe feefeffe
3ffff500:  feefeffe feefeffe feefeffe feefeffe
3ffff510:  feefeffe feefeffe feefeffe feefeffe
3ffff520:  feefeffe feefeffe feefeffe feefeffe
3ffff530:  feefeffe feefeffe feefeffe feefeffe
3ffff540:  feefeffe feefeffe feefeffe feefeffe
3ffff550:  feefeffe feefeffe feefeffe feefeffe
3ffff560:  feefeffe feefeffe feefeffe feefeffe
3ffff570:  feefeffe feefeffe feefeffe feefeffe
3ffff580:  feefeffe feefeffe feefeffe feefeffe
3ffff590:  feefeffe feefeffe feefeffe feefeffe
3ffff5a0:  feefeffe feefeffe feefeffe feefeffe
3ffff5b0:  feefeffe feefeffe feefeffe feefeffe
3ffff5c0:  feefeffe feefeffe feefeffe feefeffe
3ffff5d0:  feefeffe feefeffe feefeffe feefeffe
3ffff5e0:  feefeffe feefeffe feefeffe feefeffe
3ffff5f0:  feefeffe feefeffe feefeffe feefeffe
3ffff600:  feefeffe feefeffe feefeffe feefeffe
3ffff610:  feefeffe feefeffe feefeffe feefeffe
3ffff620:  feefeffe feefeffe feefeffe feefeffe
3ffff630:  feefeffe feefeffe feefeffe feefeffe
3ffff640:  feefeffe feefeffe feefeffe feefeffe
3ffff650:  feefeffe feefeffe feefeffe feefeffe
3ffff660:  feefeffe feefeffe feefeffe feefeffe
3ffff670:  feefeffe feefeffe feefeffe feefeffe
3ffff680:  feefeffe feefeffe feefeffe feefeffe
3ffff690:  feefeffe feefeffe feefeffe feefeffe
3ffff6a0:  feefeffe feefeffe feefeffe feefeffe
3ffff6b0:  feefeffe feefeffe feefeffe feefeffe
3ffff6c0:  feefeffe feefeffe feefeffe feefeffe
3ffff6d0:  feefeffe feefeffe feefeffe feefeffe
3ffff6e0:  feefeffe feefeffe feefeffe feefeffe
3ffff6f0:  feefeffe feefeffe feefeffe feefeffe
3ffff700:  feefeffe feefeffe feefeffe feefeffe
3ffff710:  feefeffe feefeffe feefeffe feefeffe
3ffff720:  feefeffe feefeffe feefeffe feefeffe
3ffff730:  feefeffe feefeffe feefeffe feefeffe
3ffff740:  feefeffe feefeffe feefeffe feefeffe
3ffff750:  feefeffe feefeffe feefeffe feefeffe
3ffff760:  feefeffe feefeffe feefeffe feefeffe
3ffff770:  feefeffe feefeffe feefeffe feefeffe
3ffff780:  feefeffe feefeffe feefeffe feefeffe
3ffff790:  feefeffe feefeffe feefeffe feefeffe
3ffff7a0:  feefeffe feefeffe feefeffe feefeffe
3ffff7b0:  feefeffe feefeffe feefeffe feefeffe
3ffff7c0:  feefeffe feefeffe feefeffe feefeffe
3ffff7d0:  feefeffe feefeffe feefeffe feefeffe
3ffff7e0:  feefeffe feefeffe feefeffe feefeffe
3ffff7f0:  feefeffe feefeffe feefeffe feefeffe
3ffff800:  feefeffe feefeffe feefeffe feefeffe
3ffff810:  feefeffe feefeffe feefeffe feefeffe
3ffff820:  feefeffe feefeffe feefeffe feefeffe
3ffff830:  feefeffe feefeffe feefeffe feefeffe
3ffff840:  feefeffe feefeffe feefeffe feefeffe
3ffff850:  feefeffe feefeffe feefeffe feefeffe
3ffff860:  feefeffe feefeffe feefeffe feefeffe
3ffff870:  feefeffe feefeffe feefeffe feefeffe
3ffff880:  feefeffe feefeffe feefeffe feefeffe
3ffff890:  feefeffe feefeffe feefeffe feefeffe
3ffff8a0:  feefeffe feefeffe feefeffe feefeffe
3ffff8b0:  feefeffe feefeffe feefeffe feefeffe
3ffff8c0:  feefeffe feefeffe feefeffe feefeffe
3ffff8d0:  feefeffe feefeffe feefeffe feefeffe
3ffff8e0:  feefeffe feefeffe feefeffe feefeffe
3ffff8f0:  feefeffe feefeffe feefeffe feefeffe
3ffff900:  feefeffe feefeffe feefeffe feefeffe
3ffff910:  feefeffe feefeffe feefeffe feefeffe
3ffff920:  feefeffe feefeffe feefeffe feefeffe
3ffff930:  feefeffe feefeffe feefeffe feefeffe
3ffff940:  feefeffe feefeffe feefeffe feefeffe
3ffff950:  feefeffe feefeffe feefeffe feefeffe
3ffff960:  feefeffe feefeffe feefeffe feefeffe
3ffff970:  feefeffe feefeffe feefeffe feefeffe
3ffff980:  feefeffe feefeffe feefeffe feefeffe
3ffff990:  feefeffe feefeffe feefeffe feefeffe
3ffff9a0:  feefeffe feefeffe feefeffe feefeffe
3ffff9b0:  feefeffe feefeffe feefeffe feefeffe
3ffff9c0:  feefeffe feefeffe feefeffe feefeffe
3ffff9d0:  feefeffe feefeffe feefeffe feefeffe
3ffff9e0:  feefeffe feefeffe feefeffe feefeffe
3ffff9f0:  feefeffe feefeffe feefeffe feefeffe
3ffffa00:  feefeffe feefeffe feefeffe feefeffe
3ffffa10:  feefeffe feefeffe feefeffe feefeffe
3ffffa20:  feefeffe feefeffe feefeffe feefeffe
3ffffa30:  feefeffe feefeffe feefeffe feefeffe
3ffffa40:  feefeffe feefeffe feefeffe feefeffe
3ffffa50:  feefeffe feefeffe feefeffe feefeffe
3ffffa60:  feefeffe feefeffe feefeffe feefeffe
3ffffa70:  feefeffe feefeffe feefeffe feefeffe
3ffffa80:  feefeffe feefeffe feefeffe feefeffe
3ffffa90:  feefeffe feefeffe feefeffe feefeffe
3ffffaa0:  feefeffe feefeffe feefeffe feefeffe
3ffffab0:  feefeffe feefeffe feefeffe feefeffe
3ffffac0:  feefeffe feefeffe feefeffe feefeffe
3ffffad0:  feefeffe feefeffe feefeffe feefeffe
3ffffae0:  feefeffe feefeffe feefeffe feefeffe
3ffffaf0:  feefeffe feefeffe feefeffe feefeffe
3ffffb00:  feefeffe feefeffe feefeffe feefeffe
3ffffb10:  feefeffe feefeffe feefeffe feefeffe
3ffffb20:  feefeffe feefeffe feefeffe feefeffe
3ffffb30:  feefeffe feefeffe feefeffe feefeffe
3ffffb40:  feefeffe feefeffe feefeffe feefeffe
3ffffb50:  feefeffe feefeffe feefeffe feefeffe
3ffffb60:  feefeffe feefeffe feefeffe feefeffe
3ffffb70:  feefeffe feefeffe feefeffe feefeffe
3ffffb80:  feefeffe feefeffe feefeffe feefeffe
3ffffb90:  feefeffe feefeffe feefeffe feefeffe
3ffffba0:  feefeffe feefeffe feefeffe feefeffe
3ffffbb0:  feefeffe feefeffe feefeffe feefeffe
3ffffbc0:  feefeffe feefeffe feefeffe feefeffe
3ffffbd0:  feefeffe feefeffe feefeffe feefeffe
3ffffbe0:  feefeffe feefeffe feefeffe feefeffe
3ffffbf0:  feefeffe feefeffe feefeffe feefeffe
3ffffc00:  feefeffe feefeffe feefeffe feefeffe
3ffffc10:  feefeffe feefeffe feefeffe feefeffe
3ffffc20:  3ffffc64 3ffffc68 3ffef2dc 40214bc4
3ffffc30:  4025341e 3ffef2dc 00000000 00000001
3ffffc40:  40254700 feefeffe feefeffe 00000000
3ffffc50:  3ffef2dc 00000000 3ffef2dc 40214cac
3ffffc60:  00000000 00000000 00000000 feefeffe
3ffffc70:  00000000 00000000 000005dc 00000000
3ffffc80:  00000004 00000000 00000041 3ffffda0
3ffffc90:  3ffffda8 3ffffda4 3ffefb9c 402503bc
3ffffca0:  000005dc 00000000 00000010 3fffd85c
3ffffcb0:  00000000 00000000 00000000 42d60000
3ffffcc0:  3ffefb9c 00000017 00000018 3ffffd30
3ffffcd0:  3ffffd30 402516c6 3ffef8f4 3ffffda0
3ffffce0:  3ffffda8 00000000 4024e077 00000001
3ffffcf0:  ffffffff 00000000 3ffe9441 00000008
3ffffd00:  4024e0c6 3fff07cc 3fff07cc 00000000
3ffffd10:  00000000 00000000 00000020 40100600
3ffffd20:  000000c0 3fff07cc 00000000 40102970
3ffffd30:  3ffe92f0 4024d187 3fff07cc 3ffed590
3ffffd40:  00000000 40237187 3ffed590 3fff07cc
3ffffd50:  3ffe8ba3 00000000 3ffefb9c 40250410
3ffffd60:  3fff0864 3ffef8f4 00000006 3ffedcd4
3ffffd70:  3ffe8ba3 3ffe8ba3 3ffefbcf 40238fc3
3ffffd80:  3ffedc88 40238b94 4023b204 3ffedc88
3ffffd90:  401065e5 000417c3 3ffeddb8 00000000
3ffffda0:  3ffee4c0 3ffeddb8 3ffe85f4 3ffeed24
3ffffdb0:  0000003a 00000278 00004000 3ffedd80
3ffffdc0:  3ffeddb8 4023b204 3ffedc88 c0033035
3ffffdd0:  00000000 00000001 0000000e 40100b3c
3ffffde0:  0000000b 0000027b 00004000 00000012
3ffffdf0:  00000280 00000270 00004000 c0037035
3ffffe00:  00000000 00000001 0000000e 40100b3c
3ffffe10:  00000000 00000000 0000001f 40100600
3ffffe20:  402064c0 000000cf 3fffc228 401064a1
3ffffe30:  4000050c 40100a78 3fffc258 4000050c
3ffffe40:  4020678a 00000030 00000002 ffffffff
3ffffe50:  40206785 00000002 00000281 00000008
3ffffe60:  00000007 00000008 00000000 00000008
3ffffe70:  000000ff ffffffff 00000000 3ffee97c
3ffffe80:  3ffefdac 000000dc 0000026f 00000030
3ffffe90:  00000016 00000008 00000000 00000008
3ffffea0:  40207848 ffffffff 00000000 3ffe8958
3ffffeb0:  7ffffffc 3ffe8955 3ffeed4c 00000030
3ffffec0:  3ffee9f8 3fffdad0 3ffeed4c 00000030
3ffffed0:  3ffee9f8 3fffdad0 3ffeed4c 00000030
3ffffee0:  60000314 00000001 3ffeed94 40209ce1
3ffffef0:  401065e5 00265b82 3ffeed24 00000000
3fffff00:  3ffee4c0 3ffeed24 3ffe85f4 3ffeed24
3fffff10:  401065e5 00516f00 3ffeed24 00000000
3fffff20:  3ffee4c0 3ffeed24 3ffe85f4 3ffeed24
3fffff30:  000040e5 000001f4 40209124 3fffefb0
3fffff40:  3ffeed24 000040e5 000001f4 40209279
3fffff50:  000040e5 000001f4 000040e5 402092ee
3fffff60:  00000000 000040e5 8b020c49 004b0968
3fffff70:  402075fc 3ffe8a76 3ffeec94 3ffeed4c
3fffff80:  3fffdad0 000040e5 000001f4 4020a1f8
3fffff90:  402075fc 3ffee9f8 3ffeec94 40202606
3fffffa0:  3fffdad0 00000013 3ffeec94 3ffeed4c
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

https://github.com/me-no-dev/EspExceptionDecoder

Your ESP8266 crashed. Exception Decoder (see link by @Juraj) can help you find out what went wrong and at which point in your code this happened.

can you tell me how to use that link sent by him? @StarCat

Just read the "installation" part of the link that jsotola sent you. That explains clearly how to install and use the tool.


text:
How to connect an Arduino Uno with an ESP-01 to the Arduino IoT cloud?
I have been trying to connect to the Arduino IoT cloud using my Arduino Uno and an ESP-01.
The Arduino IoT cloud does not recognize my device as genuine. Hence, I've been trying to create a thing and connecting it as a third-party device. I have an ESP-01 WiFi module that I want to use to connect to the IoT cloud.
I tried the following connection:

Arduino ----> ESP-01
3.3V  ------> 3v3
3.3V  ------> EN(CH_PD)
TX(1) ------> TX
RX(0) ------> RX
GND   ------> GND

I also tried to reverse the connections of the RX and TX pins. Still no success. I want to connect to the cloud and use some sensors to update the cloud variables. How do I do it? Any kind of help is highly appreciated.
Edit: I tried to upload the code that thd cloud editor provided and it throws and error saying:
fatal error: list: No such file or directory
 #include <list>

Arduino IoT Cloud doesn't support Arduino Uno, but it does support esp8266.
You have to do the communication with the IoT Cloud from a ESP-01 sketch with esp8266 Arduino Core. Then you can pass the values from/to a sketch in Uno over Serial.
There are ESP8266 development boards which can replace the Uno in many projects. Search for "Wemos D1 mini" or "NodeMCU" ESP8266 modules.
The ESP32 is even more capable MCU with WiFi and Arduino Core is available. It is too supported in Arduino Cloud and Arduino even has a new Nano ESP32 board.

I was able to connect to Blynk using the same devices. It turns out that it is low-code platform and since I have a programming background, I was looking for a way to connect to the IoT cloud with the same configurations so that I could have more customization and flexibility. Thank you for your kind response. I will though give it a try with NodeMCU sometime soon.

@SauravGhimire Blynk has binary protocol and allows unsecure access

Can you suggest me with a better alternative? I am actually thinking of using the ESP 32 in my final project but till then, I will be using this setup with blynk(while learning and as a hobby). Thankyou!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Can't exit while loop
I made code to make 2 servos work. the sequence of working is to make the servo 1 start rotate 2 cycles then stop and the second servo start rotate for another 2 cycles then detach both of them.
I tried so hard to stop the loop, but it stuck inside and didn't get out. It continued to rotate the first, then the second, then back to the first, and so on.
void loop() {

  const int totalLoopTime = 32001; // Time in milliseconds for the entire loop (adjust as needed)

  // Control variables
  bool enterServo1Loop = true;
  bool enterServo2Loop = false;
  int currentCycle1 = 0;
  int currentCycle2 = 0;

  // Target cycles
  const int cycles = 2; // Adjust this value as needed

  // Servo control parameters
  const int servoPin1 = 9;    // Adjust pin numbers as necessary
  const int servoPin2 = 6;
  const int openPosition = 45; // Adjust for your servo's open position
  const int closePosition = 135;  // Adjust for your servo's closed position
  const int openTime = 4000;   // Adjust open time in milliseconds
  const int closeTime = 4000;  // Adjust close time in milliseconds

  while (enterServo1Loop || enterServo2Loop) {

    // Control Servo 1
    if (enterServo1Loop && currentCycle1 < cycles) {
      servo1.attach(servoPin1);
      servo1.write(openPosition);
      delay(openTime);
      servo1.write(closePosition);
      delay(closeTime);
      currentCycle1++;
    } else if (enterServo1Loop) { // Detach after finishing cycles
      servo1.detach();
      enterServo1Loop = false;
      enterServo2Loop = true; // Start Servo 2 loop after finishing Servo 1
      Serial.print("Time servo 1: ");  // Add space after colon for readability
      Serial.println(millis());

    }

    // Control Servo 2
    if (enterServo2Loop && currentCycle2 < cycles) {
      servo2.attach(servoPin2);
      servo2.write(openPosition);
      delay(openTime);
      servo2.write(closePosition);
      delay(closeTime);
      currentCycle2++;
    } else if (enterServo2Loop) { // Detach after finishing cycles
      servo2.detach();
      enterServo2Loop = false;
      enterServo1Loop = false;
      servo1.detach();

      Serial.print("Time servo 2: ");  // Add space after colon for readability
      Serial.println(millis());

    }

   // if(millis()>=50000)  {
     //   servo1.detach();
       // servo2.detach();  }
  }

  if (millis() >= loopStartTime + totalLoopTime) {
    servo1.detach();  // Detach both servos when time limit is reached
    servo2.detach();
    bool enterServo1Loop = false;
    bool enterServo2Loop = false;
      Serial.print("Time last: ");  // Add space after colon for readability
      Serial.println(millis());

    return;  // Exit the loop immediately
  }

  servo1.detach();
  servo2.detach();
}

It would be good @Salma if you accepted an answer that works for your question. To let others know which answer solved your problem.  Thanks.

You have all your code inside the loop() function. This function - as its name suggests - gets called over and over again in a loop. When you call return inside this function, you leave the function. But almost immediately the function loop() is called again, starting your code all over.
You have two options:

Replace the return statement with an infinite loop, which does nothing. Something like:
  while(true);

Move all your code into the function setup(). This function is only called by the Arduino core once at startup. Leave the loop() function empty.

Both options are effectively the same: Executing your code after startup and then do an infinite empty loop. The first option is how people do it outside of the Arduino framework. The second option is the Arduino way of doing this. For readability I would suggest the second option.

In normal C programming the entry point is main(). That is, main() is called once and execution continues from there. If your program was renamed main() and dropped into a normal C programming environment it has a good chance to work as expected.
In the Arduino paradigm there are 2 entry points. A function called setup() which is called once. And a function called loop() which is called repetitively. The assumption is that the latter method is easier for beginner programmers to understand.
What you have done is created and initialized your key variables which track the state of your program in the Arduino loop() function.  This function will be called over and over again by the included Arduino software uploaded each time with your software to the processor. This causes your key variables to be recreated and reinitialized each time the function loop() is called.
Consider moving the creation and initialization of your key variables to the setup() function. In this way they will only be created and initialized once.
setup()
{
  // Move your one time initialization code here from your
  // existing loop() function,
  //
  // like this:

  const int totalLoopTime = 32001; // Time in milliseconds for the entire loop (adjust as needed)

  // Control variables
  bool enterServo1Loop = true;
  bool enterServo2Loop = false;
  int currentCycle1 = 0;
  int currentCycle2 = 0;

  // Target cycles
  const int cycles = 2; // Adjust this value as needed

  // Servo control parameters
  const int servoPin1 = 9;    // Adjust pin numbers as necessary
  const int servoPin2 = 6;
  const int openPosition = 45; // Adjust for your servo's open position
  const int closePosition = 135;  // Adjust for your servo's closed position
  const int openTime = 4000;   // Adjust open time in milliseconds
  const int closeTime = 4000;  // Adjust close time in milliseconds
}

loop()
{
  // Leave the remainder of your code in the loop() function:

  while (enterServo1Loop || enterServo2Loop) {

   // Control Servo 1
   if (enterServo1Loop && currentCycle1 < cycles) {
   // ... rest of your code.
}

I corrected the answer WRT what you said @thebusybee.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
MAX30102 doesnt show data when it's interfacing with other sensors MLX90614 and MPU6050
The hardware I am using is ESP32 with MAX30102, MLX90614 and MPU6050 sensors and Using Blynk to show my data from the sensors. The issue I am facing is when I ran the code with all three sensors only the MAX30102 sensor doesn't show data.
I tried troubleshooting with only two sensors at a time and when the MAX30102 sensor is involve I only can get the other sensors data.
I tried troubleshooting with only the MAX30102 sensor only and it works I don't understand what is going on.
#include <WiFi.h>                   // include the Arduino WiFi library
#include <Wire.h>
#include <math.h>
#include <MAX30105.h>
#include <heartRate.h>
#include <Adafruit_MLX90614.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Blynk.h>
#include <BlynkSimpleEsp32.h>

#define BLYNK_PRINT Serial

Adafruit_MLX90614 mlx = Adafruit_MLX90614(); //0x5A
MAX30105 particleSensor;

char auth[] = "0GUsnEJQJCDHF2HsLzYscYcDgXoe4KFg";  // Blynk code
const char *ssid = "Get your own Wifi";            // WiFi access name
const char *pass = "w1frjoyf00bar";                // WiFi password

const byte RATE_SIZE = 4; // Settings for Max 30102
byte rates[RATE_SIZE];
byte rateSpot = 0;
long lastBeat = 0;
float beatsPerMinute = 0;
float beatAvg = 0;

const int MPU_addr = 0x68; // I2C address of the MPU-6050
int16_t AcX, AcY, AcZ, Tmp, GyX, GyY, GyZ;
float ax = 0, ay = 0, az = 0, gx = 0, gy = 0, gz = 0;

void setup() {
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  particleSensor.begin(Wire, I2C_SPEED_FAST);
  particleSensor.setup();
  particleSensor.setPulseAmplitudeRed(0x0A);   // Turn Red LED to low to indicate sensor is running
  mlx.begin();  // Start MLX sensor
  Wire.begin();
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x6B);  // PWR_MGMT_1 register
  Wire.write(0);     // set to zero (wakes up the MPU-6050)
  Wire.endTransmission(true);
  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");              // print … till not connected
  }
  Serial.println("");
  Serial.println("WiFi connected");
}

void mpu_read() {
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr, 14, true); // request a total of 14 registers
  AcX = Wire.read() << 8 | Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)
  AcY = Wire.read() << 8 | Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  AcZ = Wire.read() << 8 | Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp = Wire.read() << 8 | Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GyX = Wire.read() << 8 | Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GyY = Wire.read() << 8 | Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GyZ = Wire.read() << 8 | Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
}

void loop() {
  Blynk.run();

  long irValue = particleSensor.getIR();

   if (checkForBeat(irValue) == true)                    //If a heart beat is detected
  {
    Serial.println("BPM");
    Serial.println(beatAvg);
    Serial.println();
    delay(100);
    long delta = millis() - lastBeat;                   //Measure duration between two beats
    lastBeat = millis();
    beatsPerMinute = 60 / (delta / 1000.0);             //Calculating the BPM
    if (beatsPerMinute < 255 && beatsPerMinute > 20)    //To calculate the average we strore some values (4) then do some math to calculate the average
    {
      rates[rateSpot++] = (byte)beatsPerMinute;         //Store this reading in the array
      rateSpot %= RATE_SIZE;                            //Wrap variable
      beatAvg = 0;                                      //Take average of readings
      for (byte x = 0 ; x < RATE_SIZE ; x++)
        beatAvg += rates[x];
      beatAvg /= RATE_SIZE;
    }
//    Serial.println("");
//    Serial.println("BPM: ");
//    Serial.println(beatAvg);
  }

  delay(100);

  mpu_read();
  ax = (AcX + 1704) / 16384.00;
  ay = (AcY - 412) / 16384.00;
  az = (AcZ + 1765) / 16384.00;
  gx = (GyX + 82) / 131.07;
  gy = (GyY + 6) / 131.07;
  gz = (GyZ + 32) / 131.07;
  // calculating Amplitute vactor for 3 axis
  float Raw_Amp = pow(pow(ax, 2) + pow(ay, 2) + pow(az, 2), 0.5);
  int Amp = Raw_Amp * 10;  // Mulitiplied by 10 bcz values are between 0 to 1
  float roll = 57.2883514 * atan(ay / sqrt(ax * ax + az * az));

  Serial.print("\nAMP:");
  Serial.print(Amp);
  Serial.print("      ");
  Serial.print(", Roll:");
  Serial.println(roll);

  Serial.print("BPM = ");
  Serial.print(beatsPerMinute);
  Serial.print(", Avg BPM = ");
  Serial.print(beatAvg);
  Serial.println();

  Serial.print("Ambient Temp = ");
  Serial.print(mlx.readAmbientTempC());
  Serial.print("\n Object Temp = ");
  Serial.print(mlx.readObjectTempC());
  Serial.print("      ");

  Serial.print("      ");
  alertBPM();
  Serial.print("      ");
  alertTemp();

  Serial.print("\n-----------------------------------------------------------------");
  Blynk.virtualWrite(V1, beatAvg);
  Blynk.virtualWrite(V2, mlx.readObjectTempC());

}

void alertBPM() {                                 // Alert Trigger for Heart rate
  // BPM alert
  if (beatAvg >= 60 && beatAvg <= 110) {
    Serial.println("Heart rate normal");
  }

  if (beatAvg < 60 && beatAvg > 110) {
    Serial.println("Heart Rate Abnormal");        // Need to change the HR to hhr
    Blynk.logEvent("HR", "Heart Rate Abnormal");
  }
}

void alertTemp() {                                  // Alert Trigger for Body Temp
  // Body and ambient temp alert
  if (mlx.readObjectTempC() >= 35 && mlx.readObjectTempC() <= 39) {
    Serial.println("Body temp normal");
  }

  if (mlx.readObjectTempC() < 35 && mlx.readObjectTempC() > 39 ) {
    Serial.println("Body temp Abnormal");
    Blynk.logEvent("BT", "Body temp Abnormal");   // Need to change BT to hbt
  }
}

The output is this
-----------------------------------------------------------------
AMP:11      , Roll:-2.12
BPM = 0.00, Avg BPM = 0.00
Ambient Temp = 30.75
 Object Temp = 36.07                  Body temp normal

-----------------------------------------------------------------
AMP:10      , Roll:3.90
BPM = 0.00, Avg BPM = 0.00
Ambient Temp = 30.77
 Object Temp = 36.07                  Body temp normal

-----------------------------------------------------------------
AMP:11      , Roll:-0.15
BPM = 0.00, Avg BPM = 0.00
Ambient Temp = 30.79
 Object Temp = 35.99                  Body temp normal

-----------------------------------------------------------------

what do you want to know? ... please add a clear, answerable question to your post

if you want to know where to start debugging, then start by running an I2C scanner sketch

is Blynk somehow involved in the problem?

@Juraj blynk is not the issue in this.

try to create a minimal reproducible example

@Juraj what is a reproducible example

https://en.wikipedia.org/wiki/Minimal_reproducible_example

@jsotola i used it and got this
Scanning...
I2C device found at address 0x57
I2C device found at address 0x5A
I2C device found at address 0x68
done


text:
How can i separate values from the full string, incoming string always changes its positions?
String str = {"timestamp": "2023-02-08 16-37-31" ,"cpcb_device": [{"Station" : "832","Para": [{"tag_name": "COD","tag_value": "35.5","tag_unit": "mg/l"},{"tag_name": "BOD","tag_value": "13.7","tag_unit": "mg/l"},{"tag_name": "TSS","tag_value": "24.8","tag_unit": "mg/l"},{"tag_name": "pH","tag_value": "6.5","tag_unit": "pH"}]}]}

it looks like JSON format. try the ArduinoJson library

Using json, it shows derealization error., because string is changed every time from its position

what is " changed every time from its position"?

Input string is changed as POST / HTTP/1.1
Host: 192.168.0.197
User-Agent: libcurl-agent/1.0
Accept: /
Content-Length: 144
Content-Type: application/x-www-form-urlencoded
{"timestamp": "2023-02-08 16-37-33" ,"cpcb_device": [{"Station" : "833","Para": [{"tag_name": "Flow","tag_value": "2.0","tag_unit": "m3/hr"}]}]}

use the HTTPClient library for the POST request

Please some one tell me, how to deserialize this json data, i want only values, so how to separate values from this incoming string

the HTTPClient library will do it

String str = {"timestamp": "2023-02-08 16-37-31" }; returns error: expected ',' or ';' before ':' token please fix.

You can use substring() and indexOf() to get parts of the string at certain positions. for example:
String test = "timestamp: 123 value: test";

int val = test.indexOf("timestamp:"); //gives you the index for the beginning of "timestamp:"
int start = test.indexOf(" ", val)+1; //get index of the space starting at our 'val' index
int end = test.indexOf(" ", start); //get index of the next space, we added 1 to the previous value so it doesn't pick up the first space
timestamp = test.substring(start, end); //get the characters between these two index values

Try it out and see how it works for you, obviously getting the index of separating characters that make more sense, such as a comma or colon rather than a space.
Also you could do it like this:
String search = "timestamp:";
int start = test.indexOf(search)+search.length();
//etc...


text:
Using RDM6300 and RC522 at once
I want to use both RDM6300 and RC522 at a single .ino code at once. But whenever I try them both, only one of them works. How to get the both working?
[Dev envt. ESP32 Dev module]

// LIBRARY ADDITION HERE
#include <SPI.h>
#include <rdm6300.h>
#include <MFRC522.h>

// PIN DEFINITIONS HERE
#define RC522_RST_PIN        22
#define RC522_SS_PIN          21
#define RDM6300_RX_PIN        5

// PIN DEFINITIONS
MFRC522 mfrc522(RC522_SS_PIN, RC522_RST_PIN);
Rdm6300 rdm6300;

void setup() {

  // LIBRARY INITIALTIONS
  Serial.begin(115200);
  SPI.begin();
  mfrc522.PCD_Init();
  delay(4);               // added this delay cus mc is slower than we expected. It takes some time to start the initiation
  rdm6300.begin(RDM6300_RX_PIN);
  delay(5);
}

unsigned long getID522() {

  if ( ! mfrc522.PICC_ReadCardSerial()) {
    return 0;
  }
  unsigned long hex_num;
  hex_num =  mfrc522.uid.uidByte[0] << 24;
  hex_num += mfrc522.uid.uidByte[1] << 16;
  hex_num += mfrc522.uid.uidByte[2] <<  8;
  hex_num += mfrc522.uid.uidByte[3];
  mfrc522.PICC_HaltA();
  return hex_num;
}

void loop() {

  if(mfrc522.PICC_IsNewCardPresent()) {
    unsigned long uid = getID522();
    if(uid != 0){
      Serial.println(uid);
    }
  }

  Serial.println("aaaaaaaaa");

  if (rdm6300.get_new_tag_id()) {
    Serial.println(rdm6300.get_tag_id(), HEX);
    Serial.println("ydfutfcfygfigi");
    Serial.println(rdm6300.get_new_tag_id());
  }

  delay(100);
}

please copy and paste the content of the serial monitor into your question

read the answer here https://arduino.stackexchange.com/questions/92291/using-mfrc522-along-with-other-inputsbluetooth-keypad


text:
fatal error: avr/io.h: No such file or directory (on Windows 11)
So I'm using arduino 1.8.18 installed on zip file. I am using the HardWire library. The project is the STM32 quadcopter by joop brokking. http://www.brokking.net/ymfc-32_downloads.html
complete error -
Arduino: 1.8.18 (Windows 10), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), Serial, 72Mhz (Normal), Smallest (default)"

C:\Users\ishaa\Documents\Arduino\libraries\HardWire\src\utility\twi.c:26:20: fatal error: avr/io.h: No such file or directory

Multiple libraries were found for "Wire.h"

 #include <avr/io.h>

 Used: C:\Users\ishaa\Desktop\arduino-1.8.18\hardware\Arduino_STM32-master\STM32F1\libraries\Wire
                    ^
 Not used: C:\Users\ishaa\Desktop\arduino-1.8.18\hardware\Arduino_STM32-master\STM32F1\libraries\WireSlave

compilation terminated.

exit status 1

Error compiling for board Generic STM32F103C series.

As you can see I'm using the stm32 lib by roger clark. The ide is unable to detect any of the avr/.h files. I tried replacing the path in twi.c, but then the other avr files start giving errors.
Why is this happening?

For this arduino ide you can add  portable  directory (arduino-1.8.18\portable) and add only cores/libraries you want to use for STM32. Or just delete all colliding libraries


text:
Serial problem after implementing data structures
Context
I first ran a sketch (on Arduino Uno) without any custom data structure and list, so I was using a bunch of arrays, methods and other primitive variables. And it worked perfectly.
My program acts like a menu which takes serial user input to perform actions. So you could have serial input "man r+(100,0,345)". Or just "man" to set this mode active, and later "r+(100,0,345)" to actualize the data in the "r" field in the "man" instance. I use a custom data structure to manage the input (class called Mode), and a linked list (class called ModeList).
Problem
I implemented some data structures (an object and a list) to manage incoming serial data, without modifying the rest of the program. But now, serial communication is not working properly: If I add Serial.print("Allo") anywhere in the sketch, it will print spaces for a while and stop, before I send any serial data. If it is in the setup() function, it prints spaces continuously with some characters from "Allo" from time to time. There's always a different problem along those lines, depending on where I put that simple print statement.
Here follows the sketch, the header files of the Mode and ModeList classes... By the way, I suspect a memory management problem.
The sketch
#include "Mode.h"
#include "ModeList.h"

const int inputSize=12;
const int nbModes=4;
int input;
int toSet[inputSize];
int i;

char manName[3]={'m','a','n'};
char cutName[3]={'c','u','t'};
char levName[3]={'l','e','v'};
char autName[3]={'a','u','t'};

Mode m=Mode(0,manName);
Mode c=Mode(1,cutName);
Mode l=Mode(2,levName);
Mode a=Mode(3,autName);
Mode* man=&m;
Mode* cut=&c;
Mode* lev=&l;
Mode* aut=&a;
ModeList modeList=ModeList();

void setup() {
  Serial.begin(115200);
  Serial.print("Allo");
  modeList.add(man);
  modeList.add(cut);
  modeList.add(lev);
  modeList.add(aut);
  }

void loop() {
  for(int j=0;j<inputSize;j++)
  {
    toSet[j]=NULL;
  }
  i=0;
  if(Serial.available()>0)
  {
    while(Serial.available())
    {
      if(i<inputSize)
      {
        input=Serial.read();
        if(input!=' ' && input!='(' && input !=')' && input!=',' && input!='\n')
        {
          toSet[i]=input;
          i++;
        }
      }
    }
  }

  if(serialMode(man)||man->getStatus())
  {
    //Set man on
    modeList.setMode(man);

    if(toSet[3]=='r')
    {
      if(toSet[4]=='+')
      {
        //Set ypr rate
        Serial.println("Set ypr rate +");
      }
      else if(toSet[4]=='-')
      {
        //Set ypr rate
        Serial.println("Set ypr rate -");
      }
      else
      {
        //Set ypr rate
        Serial.println("Set ypr rate");
      }
    }
    else if(toSet[3]=='a')
    {
      if(toSet[4]=='+')
      {
        //Set ypr angle
        Serial.println("Set ypr angle +");
      }
      else if(toSet[4]=='-')
      {
        //Set ypr angle
        Serial.println("Set ypr angle -");
      }
      else
      {
        //Set ypr angle
        Serial.println("Set ypr angle");
      }
    }
    else if(toSet[3]=='t')
    {
      if(toSet[4]=='+')
      {
        //Set thrust
        Serial.println("Set thrust +");
      }
      else if(toSet[4]=='-')
      {
        //Set thrust
        Serial.println("Set thrust -");
      }
      else
      {
        //Set thrust
        Serial.println("Set thrust");
      }
    }
  }
  if(serialMode(cut)||cut->getStatus())
  {
    //Cut engines
    modeList.setMode(cut);
    if(serialMode(cut))
      Serial.println("Cut");
  }
  if(serialMode(lev)||lev->getStatus())
  {
    //Stabilize axes
    modeList.setMode(lev);
    if(serialMode(lev))
      Serial.println("Level");
  }
  if(serialMode(aut)||aut->getStatus())
  {
    //Set aut on
    modeList.setMode(aut);
    if(serialMode(aut))
      Serial.println("Set aut on");
    if(toSet[3]=='s')
    {
      if(toSet[4]=='+')
      {
        //Set ypr angle
        Serial.println("Set ypr angle +");
      }
      else if(toSet[4]=='-')
      {
        //Set ypr angle
        Serial.println("Set ypr angle -");
      }
      else
      {
        //Set ypr angle
        Serial.println("Set ypr angle");
      }
    }
    else if(toSet[3]=='A')
    {
      if(toSet[4]=='+')
      {
        //Set altitude
        Serial.println("Set altitude +");
      }
      else if(toSet[4]=='-')
      {
        //Set altitude
        Serial.println("Set altitude -");
      }
      else
      {
        //Set altitude
        Serial.println("Set altitude");
      }
    }
  }
  delay(10);
}

bool serialMode(Mode* inputMode)
{
  char* modeName;
  modeName=inputMode->getName();
  Serial.print("ALLO");
  if(toSet[0]==*modeName&&toSet[1]==*(modeName+1)&&toSet[2]==*(modeName+2))
  {
    Serial.print("Set ");
    for(int i=0;i<3;i++)
    {
      Serial.print(*(modeName+i));
    }
    Serial.println(" on");
    return true;
  }
  else
    return false;
}

The Mode class header
#include "Arduino.h"

class Mode
{
    public:
        Mode(int id, char* name);
        int getId();
        Mode* getNext();
        void setNext(Mode m);
        void setStatus(bool status);
        bool getStatus();
        char* getName();
    private:
        char *_name;
        int _id;
        Mode* _next;
        bool _status;
};

The ModeList class header
class ModeList
{
    public:
        void add(Mode* input);
        int get(int pos);
        ModeList();
        void setMode(Mode* inputMode);
    private:
        Mode* start;
        Mode* end;
};

If I add Serial.print("Allo") anywhere in the sketch, it will print spaces for a while and stop, before I send any serial data.

Classic symptoms of using up all available RAM.
As a workaround I would use the F() macro.
eg.
    Serial.println(F("Set ypr rate +"));

Do that in all places where you are printing string literals. That would save you a couple of hundred bytes.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
ws2812b NeoPixel - how to address it? How Arduino knows the correct order of LEDS on the stripe?
How to get a One-Wire address of a given WS2812B pixel? I bought several of these, and I cannot make them light. On the other hand, when I connect the addressable LED strip made of these diodes, I have no problem controlling it.
Here is my set-up:

I tried many programs, e.g. AdaFruit_NeoPixel -> simple, setting number of LEDS to 1, but no effect. No blinks, nothing - as if the diodes were dead.
If every One-Wire device is identifiable by 64 bit ID, how does the Arduino know the correct "order" of the LEDS on the ribbon? How to tell the Arduino the new sequence of the LEDS on the strip that would result if I replace one (broken) LED with another?

WS2812B is not a 1wire device.

@IgnacioVazquez-Abrams Thank you! I was so sure it was 1-wire, I skipped that part when I read the data sheet. So, I understand, that each WS2812B is identified by its position within the chain relative to the Arduino? So there should be no problem with replacing the LED, providing that I don't mistake connectors.

The WS2811/2812/2812B is not a 1-Wire device but is in fact a timing-based shift register with 3 LEDs (external in the case of the WS2811) connected to it.
As long as valid bit pulses are sent to the input of one of these devices it will shift the data through it and subsequently out of its data output. Connecting this output to the input of another device will shift data into that device as well, with the latest data sent being transmitted towards the furthest device in the chain.
Provided 24 bits per device are sent before the latch signal, The first 24 bits will be shifted into the first device, the second 24 bits into the second device, and so on until the last 24 bits into the last device in the chain. Once the latch signal is received, the devices will switch to the color indicated by the 24 bits currently shifted into them.
Since all of the devices use the same signaling (the only differences being supply level and the presence of a built-in RGB LED), they can be replaced freely with devices of the same or different make between the three.

Just one correction. The the first 24 bits of the data are shifted into the first WS2812. That device loads those 24 bits into its PWM registers. If more data is transmitted, the first WS2812 shifts that out to the following WS2812. So the first data sent stays in the first WS2812, the 2nd data stays in the 2nd WS2812, and so on. This is explained in the data sheet.
Data-wise, it's a one-wire device. Power connections don't count.

I would be a little more clear abou the difference between a One-Wire (aka 1-Wire) device and a one wire device (a device that only has one data pin). The WS2812s only have one data in pin, but calling it a "one-wire" device is confusing because that is the name of an actual protocol, a protocol that is not implemented in the WS2812s. Everything in your answer is technically correct, I would just re-phrase the last part to be less confusing.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Why do people complain when I call my functions voids?
I have posted questions about "my void loop" or "my void setup" and people complain that they aren't really voids. But they are! See this example code:
void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

Clearly setup and loop are voids because they have the word void right before them!

Note: this is a reference question.

Sorry Nick, but this reference question looks more like a general C++ prgramming question (belonging to StackOverflow then) than an Arduino question, except for the actual functions content. Some members might well vote to close this kind of question as "off topic".

Yes I realize that, but Arduino users tend to be beginners to programming in general and C++ in particular. The constant references to "the Arduino language" makes me think that they might not consider checking StackOverflow for an answer. Indeed, it is addressing a problem that beginners might not even realize exists (terminology). By posting this Q&A I am attempting to provide a reference point for people who talk about their "void loop" problem.

Don't get me wrong, I'm not insulting people who don't know C++. There was a time when I didn't have the faintest idea about C or C++. Previously I had been using Turbo Pascal, and was used to procedure and function declarations, and thought that C had very weird syntax. And before Turbo Pascal, well that's a whole other story. :)

Don't worry Nick, no risk I get you wrong, you are one of my electronics rock stars (I really appreciate your posts about electronics on your site)! I agree with the fact that many Arduino newcomers will first come here for a C++ question. My comment was more about how some Arduino.SE members (including myself) might react on such a question and might consider it off-topic. No hard feelings!

This is an easy mistake for a beginner to C++ to make. Let's look at other languages, like PHP:
function add ($a, $b)
  {
  return $a + $b;
  }

Or Lua:
function add (a, b)
  return a + b
end

Or JavaScript:
function add (a, b)
  {
  return a + b;
  }

Or VBscript:
Function add (a, b)
  add = a + b
End Function

All those languages have the word "function" there to indicate that you are declaring a function.

So what does C++ look like:
int add (int a, int b)
  {
  return a + b;
  }

So this must be an "int" right? Or what if it doesn't return a value?
void loop ()
  {
  }

Now it's a "void"? Kind of a weird name for a function!
Actually int and void in these examples are not weird names for functions. They are the return types of those functions. int add (int a, int b) is a function that returns an int. And void loop () is a function that returns nothing.
The C++ compiler can deduce when it is seeing a function declaration from some clues:

A return type (eg. int, float, long)
A name (the function name)
Some parentheses (for the function arguments)

Think of the word function as being there in spirit:
int [function] add (int a, int b)
    ^^^^^^^^^^   <-- don't actually type this!
    {
    return a + b;
    }

I think if you use a phrase like " my int a or my CustomType a " people would interpret those phrases to mean that you have a variable a that is an instance of an int or a CustomType.
According to http://en.cppreference.com/w/cpp/language/types you can't have an object or reference of type void.
If you have a phrase like "my void setup", I think most people would try to read that as implying you have a variable setup of type void, which I don't think makes sense, to most people.
What you actually have is this:
void setup() {
...
}

I think most people would phrase this as "my function setup, which takes no arguments are returns nothing".

you missed the "Note"?

I guess I did,  and I later noticed that the same person answered it as asked it, which seemed weird.  I have never seen or heard of such a thing as a "reference question, at least not on stackoverflow,  is it documented somewhere?  I searched the meta site and did not find it.

See Can I answer my own question? and It’s OK to Ask and Answer Your Own Questions. From that: it is not merely OK to ask and answer your own question, it is explicitly encouraged.

Thanks,  I guess I have seen cases were people answer their own question, after the find a solution, but not this type of case.  I can see cases were it would be a value add.   But I guess then I don't see the point of someone pointing out the fact that it is a "reference" question, after all a question is a question and someone could still have a better answer than the person that asked it.


text:
BH1750 Light sensor always giving output as 54612lx
urgently need some inputs,
Connection:
VCC-5v
GND-GND
SCL-SCL(analog pin 5)
SDA-SDA(analog pin 4)
ADD-NC or GND

Code pasted below
used library from GIT : https://github.com/claws/BH1750
#include <BH1750.h>
#include <Wire.h>

BH1750 lightMeter;

void setup(){
    Serial.begin(9600);
    lightMeter.begin();
    Serial.println("Running...");
}

void loop() {
    uint16_t lux = lightMeter.readLightLevel();
    Serial.print("Light: ");
    Serial.print(lux);
    Serial.println(" lx");
    delay(1000);
}

What happens if you disconnect the module? Do you still get 54612lx?

lux/2? check the default configuration (lightMeter.begin(???)).

use this lib = https://github.com/Erriez/ErriezBH1750
its very good to use

There may be a regulator and logic shifter on the board you are using but according to the data sheet the device is a 3V device with 1.8V logic and I2C levels.  So this is the first thing you need to check.
Have you got 4.7K resistors pulling the SDA and SCL lines to Vcc?
Can you change your code to turn the device off and then take a reading?
There is nothing wrong with your code, your wiring looks OK, so that implies that there is something wrong with the device or the Arduino.  Change the device (and code) for another I2C device and see if that works fine.  If it does then it looks like there might be a problem with the BH1750.
Hope that helps.

I bought some "GY-302" modules on ebay, it's a breakout board with the BH1750 sensor on it. I tried one of them and it didn't respond at all, like you I saw 54612 (which is just 65535/1.2). I tried another of these modules and it worked. So, on the one that didn't work, the sensor chip was not well aligned and centered, and the soldering looked ugly on one side, so I used my soldering iron to attempt to reflow and re-align/center it. If you attempt to do that too, clean your soldering tip and do not add any solder! Now the soldering looks even uglier (under microscope..), but the sensor is working well! I don't have any pro equipment, not even a small tip for my crappy soldering iron, so I guess I am lucky that it worked.

Looking at the BH1750.cpp and BH1750.h and I think i've noticed some errors:

Change #include "Wire.h" to #include <Wire.h> in the header file, trivial perhaps but still...
In the method BH1750::readLightLevel in the .cpp, comment out Wire.beginTransmission(BH1750_I2CADDR); and Wire.endTransmission();; they aren't needed for a Read and may be responsible for the wrong value you're getting.
You can also try replacing _delay_ms(10); with delay(10), just in case
You may also try commenting out level = level/1.2; just to see if this division has any adverse effects.

Save the files after making the changes.

I had to connect my SCL and SDA pins to dedicated 20th and 21st pins on Arduino MEGA 2560.

Please check that the OP is using an Arduino UNO as tagged on the question.

i didnt solder my light sensor and it had the same error, as it was just resting on the pins, try pushing it up so the sensor makes contacts with the male headers or just solder them :D


text:
Arduino LED PWM dimmer starts blinking on low PWM values
I'm trying to build a PWM led dimmer with Arduino using this circuit:

simulate this circuit – Schematic created using CircuitLab
Everything works fine until the pin PWM 3 drops below the analog value 50 (more or less) the LEDs starts blinking fast and noticeably. However, if I touch with my finger the metal cup of the BJT transistor the LEDs do not blink anymore and they work as I assumed. The test program is below, and I've tested it with an Arduino UNO and an Arduino MEGA and they both have the same problem. The DC supplier is a transformer I bought from an electronics shop and it works properly if directly attached to the strip.
Test Program:
void setup(){
  pinMode(3, OUTPUT);
}

void loop(){
  for(int i = 0;i<=255;i++){
    analogWrite(3,i);
    delay( i<=40 ? 300 : 50);
  }

  for(int i = 255;i>=0;i--){
    analogWrite(3,i);
    delay( i<=40 ? 300 : 50);
  }
}

I tried searching my problem on the internet and I've found a schematic which uses a P2N2222 transistor in this article, which is equivalent to mine, except for the fact that it uses a P2N2222. I also tried changing the transistor to a new one (in case the one I'm using is broken), but it did not help.
So I don't see what I did wrong, could you please help me in finding it out?

Did you write the program yourself? That is okay. The schematic is wrong, when you connect it that way, the transistor, the arduino board and perhaps the ledstrip as well are blown. When using 24v, you could damage your computer as well via the usb cable. Tell us more about the led strip. Can you give a link to it? How much voltage and current does it need?

The led strip requires 24V and 500mA of current. I have no links for that because I bought it from an electronics store a long time ago. I've already tried the schematic shown and it did not damage anything... why should it damage a component?

Looking at the schematic, it seems like the LED and the transistor are upside down.

Your diagram has the transistor wired backwards. It should not work that way.

You're right. I've corrected it: I just flipped the transistor in the schematic, but the circuit I've designed is the corrected one and it has the aforementioned problem for small analog values of the pin. Thank you.

Can you do a vertical flip of the led as well?

LTL307-EE is a regular red led (2V,  20 mA) Something that survives 24V and consumes 500 mA ( which is a lot for a 2N2222 btw ) and your power source they both must have some electronics inside, which might behave in strange ways when switched by your PWM transistor.

since you are editing your schematic, move the GND on the uno to one of the bottom pins and get rid of the crossover at the transistor base

How many LEDs in this strip? If there were 12 2V 20mA LEDs you could put them in series and drive them with ≈20mA of 24V. 500mA of 24V is a whole bunch of juice for LEDs.

I updated the question with all the details. @DuncanC I don't know how the LEDs are connected to the stripe because I bought the entire stripe from an electronics shop. I can only make hypothesis. I see that those LEDs are connected in series at least every 6 LEDs (the stripe can be cut every six LEDs), but I suppose that the 6 LEDs are connected in parallel because if a LED stops working, the others will work as regular. Anyway, I measured the current of 500mA by connecting the stripe and measuring the current with an amperometer in order to calculate the resistor R1

As DataFiddler says, the LED strip may well have electronics in it that get confused when you feed it pulsed power at too low a duty cycle. Without more info about the LED strip it’s impossible to tell for sure.


text:
Scan multiple ESP8266
I am working on wifi based LED project which involves various ESP to be connected to router. Basically grouping of ESP has to be done. The android app sends HTTP command to IP address which is given by router to the ESPs, the IP are not static and expires after some time. Now my question is how can mobile app can get the IP of all the ESP connected to router?
Does using HTTP protocol complicates the process? Shall I switch to multicast UDP? or use UnPn Protocol for scanning (Sounds complicated though).
Please help!

HTTP is a 1:1 connection. If you want 1:many you need a different protocol. Multicast UDP is possibly the best way to go - then the ESPs subscribe to the multicast address and you don't care what their IPs are.

So how exactly UDP works? The packets sent to multiple ESPs at once reaches at the same time? For example I am sending value of RED led 254 to 6 ESP, all 6 ESP will glow to RED at once?

https://en.wikipedia.org/wiki/IP_multicast

And who creates the multicast address? Router? or A master ESP is needed?

That link tells you.

This may also help: http://www.esp8266.com/viewtopic.php?f=29&t=2464 - it's wonderful what you find on Google...

It is said that UDP is very unreliable protocol. Packets get lost. How can I make sure they are sent and if not sent, receive feedback and retransmit again.

With great difficulty. It is best if you create your system in such a way that it doesn't care if you lose a packet or two.

Anyway, UDP isn't very unreliable. It's "unreliable" in that there is no built in mechanism for guaranteed delivery. It doesn't mean that packets go astray all the time.

Okay, I understand that.

@Majenko Can I use this app for testing multiple ESPs?? https://play.google.com/store/apps/details?id=com.hastarin.android.udpsender&hl=en

Possibly. Try it and see. Personally I use nc on Linux.

Any option to use with Macintosh?

Not from me. nc (NetCat) may be available in homebrew, or it may not. You'll have to look for yourself. Or ask Google, which contrary to popular belief, isn't my name.

Hahaha, Okay!! By the way, you are not any less than Google

I would go with UDP broadcast, since multicast may need to be set up correctly.

@Paul What is the difference between UDP multicast and broadcast? What is the advantage of using it over multicast?

With multicast it'll get switched to specific groups, broadcast will go to every UDP server on the network.

You can go with UDP Multicast.

The best protocol for these kind of applications is MQTT.
Read more here

MQTT has delay. I need instant response within milliseconds

Yes, Multicast is the only option.

Can you back up your answer with some explanations please?


text:
How Do I Power An Arduino Nano Every?
I am pretty new to Arduino and I am making a project with my Uno R4 Wifi, it uses a servo and a motor to push a door closed, and when I power it with a 9v battery it barely moves the door, but when I use 9v wall power, it works very well, maybe better than the USB. But now I'm going to buy a few Nano Everys to make it wirelessly controlled, but the Every doesn't have a barrel jack, so I need to plug + to 5v and - to VIN, I think... but what battery pack should I use that can power the components with enough strength to move the door? I know a traditional 9v is usually horrible, but I was wondering if it's enough for a smaller board like the Nano Every? If not is a pack of 6 1.5 volts better?
I am using a
hobby servo (Hi-tec Hs-645 MG),
a generic dc motor with gearbox,
and a L293D for driving the motor
Thank you!

Do any of these Q+As help? https://arduino.stackexchange.com/questions/tagged/power+servo

Yeah I saw a lot of those, but they all used Arduino Unos, and I was unsure if they need more power than the Every needs.

a 9 V block battery contains six AAAA cells connected in series ... it has power to run a smoke detector, not much more ... make the 9 V battery from higher capacity cells

how could I get a higher capacity battery jsotola?

updated the comment ... a battery is just a collection of two or more cells ... there are many examples on the internet ... start doing some research

Would a 6 pack of AA batteries be better for the Nano Every?

try it ........

I just dont want to but all the stuff and then not be able to even power it

Please [edit] your question to add  the technical specification of your servo and especially your motor, optimally measure voltage and current of them. Then we'll be in a better position to answer.

Your question isn't really about how to power the Nano Every, but how to power a servo motor. Microprocessors have a much lower current requirement than motors.
Based on this I see that the HS-645MG High Torque, Metal Gear Premium Sport Servo would require 450 mA of current, even with no load, and 2.5 A at "stall" load.
Browsing for the effective internal series resistance of 9V batteries is a little tricky, but I saw one post suggesting it might be around 1 ohm.
Using Ohm's Law, if you are drawing, say, 2 amps trying to close your door, and the internal resistance is 1 ohm, then the voltage drop over that resistor will be 2V, thus there will only be 7V left to power your motor.
I suggest 6 x 1.5V batteries with a higher current capability (say, AA batteries) would be much more suitable than a tiny 9V battery. They really aren't designed to drive motors.

Would this also be enough to power a NRF24L01, a DC motor, and a H-bridge driver?
https://www.amazon.com/HiLetgo-H-bridge-Stepper-Controller-Arduino/dp/B00M0F243E/ref=sr_1_5?crid=249T4CXS9EL2R&dib=eyJ2IjoiMSJ9.JQyowzzZ9U-FWlJkRjfPJEtXLb66lZaL6yPgtgCjW1rkjOi8y-LnwhkdjYln896-tegrnwCt9B16a26ggE5PYFlAHidUOJNSm9W37zScgwfrz7i_YoYIIRc7j9JBuwtEr1gZGkjsLL5_IEq_ySmDSsQoc2S7xC7tL3vgJL7iCnbsulrBQPYpF4G4Rrmq6AloL_wREqVmYk5gJCP0lavIfw.lIlg0Y8JFX9uORQf7ZDydV7fUU2EobIa0_pVREpdCfM&dib_tag=se&keywords=h+bridge&qid=1725319806&sprefix=h+bridge%2Caps%2C183&sr=8-5

A lot depends on the specs of the motor. The more current it draws the bigger power supply you need. Different battery sizes and types have different capabilities.


text:
"Stack canary watchpoint triggered (loopTask)" when synchronizing with Arduino Cloud IoT (ArduinoCloud.update())
I have created a sketch that updates 195 variables : 16xString variables, 34xfloat, 52xint, 107xbool.
Notice : I'm using the IDE tool instead of the included Cloud IoT compile (because I have a pb with the Arduino Cloud Agent). This is the way I'm usually doing and it is OK for all the other sketchs I have created.
1) The sketch is very simple :
#define WIFI_PASSWORD "xxxxxxxx"
#define SECRET_SSID "freecd9b4box8" // NE PAS MODIFIER
#define SECRET_OPTIONAL_PASS "xxxxxxxx" // NE PAS MODIFIER
#define SECRET_DEVICE_KEY "e!OnTc5aP89imOCWn@ewnhte6" //         <<<<<<<<< A RECOPIER de l'outil de dev Arduino Cloud

#include "thingProperties-Energie-Compute.h"
#include <WiFi.h>

void setup()
// ****************************************************************************************
{
  Serial.begin(115200);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(5000);
  Serial.println("Entree / setup...");
  initProperties();
  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  // Mise en commentaire pour compilation IDE
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();

  Serial.println("Arduino initialisé");
  Serial.println("Sortie / setup");
}

void loop()
// ****************************************************************************************
{
  ArduinoCloud.update();
} // fin de loop

void onSXXORDRECONFIGUREChange(int index_numero_de_capteur_a_traiter)
// ****************************************************************************************
{
  Serial.println("Entrée onSXXORDRECONFIGUREChange pour capteur = " + String(index_numero_de_capteur_a_traiter + 1) + "]");
}

void onSXXTEMPMAXChange(int index_numero_de_capteur_a_traiter)
// ****************************************************************************************
{
}

void onSXXTEMPMINChange(int index_numero_de_capteur_a_traiter)
// ****************************************************************************************
{
}

//!!!!!!!   s01
void onS01ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 0;
    onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS01VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 0;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS01VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 0;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s02
void onS02ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 1;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS02VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 1;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS02VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 1;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s03
void onS03ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 2;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS03VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 2;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS03VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 2;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s04
void onS04ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 3;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS04VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 3;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS04VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 3;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s05
void onS05ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 4;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS05VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 4;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS05VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 4;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s06
void onS06ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 5;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS06VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 5;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS06VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 5;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s07
void onS07ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 6;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS07VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 6;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS07VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 6;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s08
void onS08ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 7;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS08VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 7;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS08VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 7;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s09
void onS09ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 8;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS09VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 8;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS09VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 8;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s10
void onS10ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 9;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS10VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 9;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS10VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 9;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s11
void onS11ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 10;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS11VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 10;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS11VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 10;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s12
void onS12ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 11;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS12VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 11;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS12VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 11;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s13
void onS13ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 12;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS13VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 12;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS13VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 12;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s14
void onS14ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 13;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS14VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 13;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS14VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 13;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s15
void onS15ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 14;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS15VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 14;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS15VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 14;
  onSXXTEMPMINChange(index_ds_tableau);
}

void onGFEdonneeMAJINChange() {
  Serial.println("Entrée onGFEdonneeMAJINChange");
}
void onGFEdonnee1INChange()  {
Serial.println("Entrée onGFEdonnee1INChange");
}
void onGFEdonnee2INChange()  {
Serial.println("Entrée onGFEdonnee2INChange");
}
void onGFEcapteurIDINChange()  {
Serial.println("Entrée GFEcapteurIDINChange");
}
void onGFDdonnee1INChange()  {
}
void onGFDdonnee2INChange()  {
}
void onGFDcapteurIDINChange()  {
}
void onGFDdonneeMAJINChange()  {
}

2) The compilation is OK. Here is the result
Le croquis utilise 1184669 octets (90%) de l'espace de stockage de programmes. Le maximum est de 1310720 octets.
Les variables globales utilisent 49060 octets (16%) de mémoire dynamique, ce qui laisse 245852 octets pour les variables locales. Le maximum est de 294912 octets.
esptool.py v4.6
Serial port COM13
Connecting.....
Chip is ESP32-PICO-D4 (revision v1.1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 10:06:1c:31:01:08
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00132fff...
Compressed 23376 bytes to 15314...
Writing at 0x00001000... (100 %)
Wrote 23376 bytes (15314 compressed) at 0x00001000 in 0.4 seconds (effective 426.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 594.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 772.9 kbit/s)...
Hash of data verified.
Compressed 1191248 bytes to 780549...
Writing at 0x00010000... (2 %)
Writing at 0x000183ac... (4 %)
Writing at 0x0001d0df... (6 %)
Writing at 0x000224d1... (8 %)
Writing at 0x000293f8... (10 %)
Writing at 0x00034cb9... (12 %)
Writing at 0x0003baef... (14 %)
Writing at 0x00041dd7... (16 %)
Writing at 0x0004a782... (18 %)
Writing at 0x0005b774... (20 %)
Writing at 0x000610c8... (22 %)
Writing at 0x0006896f... (25 %)
Writing at 0x0006e058... (27 %)
Writing at 0x0007356e... (29 %)
Writing at 0x00078d5a... (31 %)
Writing at 0x0007deaf... (33 %)
Writing at 0x000835d8... (35 %)
Writing at 0x00088558... (37 %)
Writing at 0x0008d730... (39 %)
Writing at 0x00092b2d... (41 %)
Writing at 0x00097f6c... (43 %)
Writing at 0x0009d6d9... (45 %)
Writing at 0x000a2e5f... (47 %)
Writing at 0x000a7e70... (50 %)
Writing at 0x000ace84... (52 %)
Writing at 0x000b2345... (54 %)
Writing at 0x000b74fe... (56 %)
Writing at 0x000bc510... (58 %)
Writing at 0x000c1ca8... (60 %)
Writing at 0x000c786d... (62 %)
Writing at 0x000cceb0... (64 %)
Writing at 0x000d2016... (66 %)
Writing at 0x000d7624... (68 %)
Writing at 0x000dc8eb... (70 %)
Writing at 0x000e1e31... (72 %)
Writing at 0x000e70e7... (75 %)
Writing at 0x000ec7ee... (77 %)
Writing at 0x000f1e51... (79 %)
Writing at 0x000f7808... (81 %)
Writing at 0x000fd369... (83 %)
Writing at 0x00102bda... (85 %)
Writing at 0x00109536... (87 %)
Writing at 0x00111d62... (89 %)
Writing at 0x00119f5d... (91 %)
Writing at 0x0011f0e7... (93 %)
Writing at 0x00124553... (95 %)
Writing at 0x00129d1a... (97 %)
Writing at 0x0012f1ee... (100 %)
Wrote 1191248 bytes (780549 compressed) at 0x00010000 in 10.7 seconds (effective 892.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

3) Running phase : when synchronising with the Arduino Cloud (ArduinoCloud.update()), the sketch crashes.
When I remove that synchronisation command, it doesn't crashes.
18:06:48.877 -> Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception).
18:06:48.877 -> Debug exception reason: Stack canary watchpoint triggered (loopTask)
18:06:48.909 -> Core  1 register dump:
18:06:48.909 -> PC      : 0x40084198  PS      : 0x00060736  A0      : 0x3ffb03d0  A1      : 0x3ffb0310
18:06:48.909 -> A2      : 0x3ffb9d14  A3      : 0x00000000  A4      : 0x0000001a  A5      : 0x00000000
18:06:48.909 -> A6      : 0x00000017  A7      : 0x00000000  A8      : 0x00001ab7  A9      : 0x3ffd7741
18:06:48.909 -> A10     : 0x00000000  A11     : 0x00000000  A12     : 0x0000001a  A13     : 0x00000000
18:06:48.947 -> A14     : 0x00000017  A15     : 0xb33fffff  SAR     : 0x0000000a  EXCCAUSE: 0x00000001
18:06:48.947 -> EXCVADDR: 0x00000000  LBEG    : 0x4008499d  LEND    : 0x400849a5  LCOUNT  : 0x00000027
18:06:48.947 ->
18:06:48.947 ->
18:06:48.947 -> Backtrace: 0x40084195:0x3ffb0310 0x3ffb03cd:0x3ffb03f0 |<-CORRUPTED
18:06:48.947 ->
18:06:48.947 ->
18:06:48.947 ->
18:06:48.947 ->
18:06:48.947 -> ELF file SHA256: 286b7ae02d7f8073
18:06:48.947 ->
18:06:49.097 -> Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception).
18:06:49.097 -> Debug exception reason: BREAK instr
18:06:49.097 -> Core  1 register dump:
18:06:49.097 -> PC      : 0x40083ee8  PS      : 0x00000016  A0      : 0x40080306  A1      : 0x3ffc6b30
18:06:49.097 -> A2      : 0x00000000  A3      : 0x70000005  A4      : 0x00000000  A5      : 0x00000000
18:06:49.097 -> A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00004000  A9      : 0x3ffb0130
18:06:49.131 -> A10     : 0x00000000  A11     : 0x44175165  A12     : 0x44175165  A13     : 0x00060e24
18:06:49.131 -> A14     : 0xfffbfff0  A15     : 0x00000046  SAR     : 0x00000000  EXCCAUSE: 0x00000001
18:06:49.131 -> EXCVADDR: 0x00000000  LBEG    : 0x40089a70  LEND    : 0x40089a86  LCOUNT  : 0xffffffff
18:06:49.131 ->
18:06:49.131 ->
18:06:49.131 -> Backtrace: 0x40083ee5:0x3ffc6b30 0x40080303:0x3ffc6b60 0x65a5a5a2:0xa5a5a5a5 |<-CORRUPTED
18:06:49.131 ->
18:06:49.165 ->
18:06:49.165 ->
18:06:49.165 ->
18:06:49.165 -> ELF file SHA256: 286b7ae02d7f8073
18:06:49.165 ->
18:06:49.165 -> Re-entered core dump! Exception happened during core dump!
18:06:49.165 -> Re-entered core dump! Exception happened during core dump!

**4) Hardware I'm using : TTGO LoRa32-OLED
**5) When removing the (ArduinoCloud.update()) command, it works fine :slight_smile:
18:30:16.907 -> Entree / setup...
18:30:17.141 -> ***** Arduino IoT Cloud - configuration info *****
18:30:17.141 -> Device ID: 7751cba4-9904-4afe-8d6e-0fce67c07b2e
18:30:17.141 -> MQTT Broker: iot.arduino.cc:8884
18:30:17.141 -> Arduino initialisé
18:30:17.141 -> Sortie / setup

**6) Increase the stack size : I read that may be I should increase the Increase your stack size...
How to do that ?
Regards.
CH

Look at this example: https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino or Google for "esp32 increase loop task stack size". If it works you can answer your own question with a code sample.

"195 variables : 16xString variables, 34xfloat, 52xint, 107xbool." Check your addition!


text:
how to use Fill solid function to stay on after the other patterns have ran?
I would like the LEDs to stay on solid after the last LED has returned to the beginning of the led strip to start the sequence again. Hopefully my code loads up correctly.
[from the comment:] "return to the begin of the strip of Leds" means, LED0 to LED40 back to the beginning, which would be LED0 starting the pattern again.
My current code:
#include <FastLED.h>

#define NUM_LEDS 40
#define LED_PIN 4

CRGB leds[NUM_LEDS];

void setup() {
  // put your setup code here, to run once:
  FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(20); //0-255 brightness
}

void loop() {
  // put your main code here, to run repeatedly:
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::GhostWhite;
    FastLED.show();
    delay(75);
    leds[i] = CRGB::Black;
    for (int i = NUM_LEDS - 1; i >= 0; i--) {
      leds[i] = CRGB::Black;
      FastLED.show();
      delay(65);
      leds[i] = CRGB::GhostWhite;
      fill_solid(leds, NUM_LEDS, CRGB::GhostWhite);
    }
  }
}

what does this mean? ... after the last led has returned to the beginning ... beginning of what?

full code is up Now  , return to the begin of the strip of Leds ,0-40 back to the beginning  which would be led0 starting the pattern again.

I have formatted your source. Please check it as see if it is what you intended. Currently, it is not compilable because of a missing closing parenthesis at the call of fill_solid(). You might have just a simple typo or logic error.

Oh, and if you have new or additional information, please put it into your question. For your other comment, I did this already.

it makes no sense to have a for block inside another for block ... what are you trying to accomplish?

Maybe it would help to show what each frame of the animation cycle should look like with a small number of LEDs. However many LEDs is enough to make the pattern clear and not so many that you can't easily draw all frames. Perhaps 4 LEDs for illustration purposes.

@jsotola What I’m trying to accomplish is for my lights, at power up that my led strip will light up one after the other from led0 to led40 and back to led0 but on the return to led0 I would like to light the entire strip or addressable leds to stay on till I shut them off.


text:
Telit GPRS Module never returning and never timing out for command AT#FTPOPEN
Howdie!  I trying to run a GPRS modem on an Arduino. My full stack is Nimbelink's NL-SW-GPRS Modem (containing Telit GE910-QUAD GPRS module) with the Nimbelink Arduino Development Shield on an Arduino UNO R3.
My goal is to connect to an FTP server and upload a file. I am following this guide from Nimbelink and section 3.3 from Telit's user guide.
I am stuck because the AT#FTPOPEN command doesn't seem to ever timeout nor does it return any result (ERROR or OKAY).
Here is the AT commands I am running:
AT
> OK

AT+CGREG?
> +CGREG: 0,1
> OK

AT#SIMDET=1
> OK

AT+CGDCONT=1,"IP","internet.com","0.0.0.0",0,0
> OK

AT#SCFG=1,1,300,90,600,200
> OK

AT#SGACTAUTH=0
> OK

AT#SGACT=1,1
> <My IP Address>
> OK

AT#FTPTO=100
> OK

AT#FTPOPEN="209.86.62.76","anonymous","anonymous",0

Where 209.86.62.76 is the IP address of ftp.earthlink.net which I am just using for testing purposes, but I have tried several others. I have tried with FTP mode 0 (active) and 1 (passive) with no change in behavior.
The AT#FTPOPEN just never returns anything (no ERROR and no OK). I've waited up to 5 minutes. The command does returns "ERROR" if I deliberately mess up the syntax of the command (eg. AT#FTPOPEN="") but for any valid format it just seems to hang.
Is this a known problem or something I can easy work around? Am I doing something crazy with my timeout values? Is there an easy way to test the context that I activated with the SGACT?
This is more of a question for an M2M forum, but I'm on an Arduino and it seems like there are many people using GSM modules on Arduino - so I thought I'd post here because I am a bit desperate. Thanks :)

The example in the guide uses the URL and port number like this "ftp.earthlink.net:21". Try that instead of the IP address.

The issues were:

Pin 9 MSM_nRESET should be explicitly set to HIGH.
Pin 10 (DTR) and pin 11 (RTS) should be explicitly set to LOW.
The Nimbelink device requires 5V external power. With USB power, the modem can intermittently reset during period of high activity. If the modem resets, then the command can appear to run forever when nothing is actually running.
Must use FTPOPEN with connection type 1 (passive).


text:
Are sleep and reset on DRV8825 tied up to GND?
I am working on a project that has a servo and a stepper motor, so I build a circuit which have both the driver and lm7805.
The problem is that the regulator overheated very quickly. I traced the wires and noticed that the 5 V ouput of the regulator was shorted to GND.
I desoldered the whole circuit and noticed with my multimeter that sleep and reset pins of the driver were shorted to GND, with only 20 ohms between them.
Is that normal for the driver or is it broken?


text:
Arduino Nano Er.43
I am using an Arduino Nano clone on Windows 10. Worked perfectly fine for a year until I uploaded a code with some Serial functions. After trouble shooting for hours with drivers, and checking all over the internet, I come to the conclusion that the last code uploaded was faulty and corrupted the Serial interface. Every time I plug it in now, Windows gives a popup saying "USB Device Not Recognized."
I have checked for shorts all over the board, but none found, and the indicating lights are working fine. From what I have read, I believe that the board is still recoverable.
How to get it working?
The link to the board purchased: Mini USB Nano V3.0 ATmega328P CH340G 5V 16M Micro-Controller Board for Arduino Nano Micro USB

For whole last year there was many issues with fake CH340G and solution was installing drivers from 2022 at latest (it got broken around jan/feb 23) and disabling auto update for drivers in windows update. It had slightly different symptoms, but it could get another update


text:
Why is my BME280 sensor returning 0 for all data values?
My BME280 is returning 0 for temperature in Celsius, 0% humidity, 0.00 pressure (hPa) and 44330.00m for altitude. I am connecting it with I2C on a Raspberry Pi Pico and everyone on the team has checked the wiring so we are relatively certain that it is not an issue. We are using the test code from the AdaFruit BME280 Page.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#include <SPI.h>
#define BME_SCK 18
#define BME_MISO 19
#define BME_MOSI 23
#define BME_CS 5

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme; // I2C (default pins for Raspberry Pi Pico: GPIO 4 (SDA), GPIO 5(SCL)
/*
Adafruit_BME280 bme(BME_CS); // hardware SPI
Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI
*/
unsigned long delayTime;

void setup() {
  Serial.begin(9600);
  Serial.println("BME280 with Raspberry Pi Pico");

  Wire.setSDA(4);
  Wire.setSCL(5);
  Wire.begin();
  bool status;

  // default settings
  // (you can also pass in a Wire library object like &Wire2)
  status = bme.begin(0x77);  //I have tried using 77, 76(default), 80, and blank
  if (!status) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
  }

  delayTime = 1000;

  Serial.println();
}

void loop() {
  printValues();
  delay(delayTime);
}

void printValues() {
  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println(" *C");

  // Convert temperature to Fahrenheit
  /*Serial.print("Temperature (fahrenheit) = ");
  Serial.print(1.8 * bme.readTemperature() + 32);
  Serial.println(" *F");*/

  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");

  Serial.print("Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println(" m");

  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println(" %");

  Serial.println();
}

In theory this code should work. Is there an issue with our sensor? I also don't really understand where the 44330.00 is coming from with the altitude.
This is what it's returning:
Temperature = 0.00 *C
Pressure = 0.00 hPa
Altitude = 44330.00 m
Humidity = 0.00 %

are you using the correct pins?

If bme.begin() returns false, you should abort() or lock the sketch in an infinite loop, in order to prevent it for ever executing loop(). Otherwise you may miss a “Could not find a valid BME280 sensor” message. As for the altitude, it's just what their atmosphere model outputs for a zero pressure.

By the looks of it you have connected the BME sensor via SPI
#include <SPI.h>
#define BME_SCK 18
#define BME_MISO 19
#define BME_MOSI 23
#define BME_CS 5

but you are trying to use it as an I2C device
Adafruit_BME280 bme; // I2C (default pins for Raspberry Pi Pico: GPIO 4 (SDA), GPIO 5(SCL)
/*
Adafruit_BME280 bme(BME_CS); // hardware SPI
Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI
*/
unsigned long delayTime;

void setup() {
  Serial.begin(9600);
  Serial.println("BME280 with Raspberry Pi Pico");

  Wire.setSDA(4);
  Wire.setSCL(5);

If you want to connect via SPI, comment out
Adafruit_BME280 bme

And uncomment this if BME_MOSI, BME_MISO, BME_SCK are not the boards default SPI Pins:
Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

Otherwise (and preferably because hardware SPI is faster) uncomment:
Adafruit_BME280 bme(BME_CS); // hardware SPI

Note: The altitude reading is likely calculated from the zero pressure reading so you would expect it to be large.

You're currently using 0x77, but many breakout boards use 0x76 by default. Try changing the I2C address to 0x76 in your code:
status = bme.begin(0x76);

If that doesn't work, try using an I2C scanner to check what I2C addresses are detected by your Pico. Here's a simple I2C scanner code to run:
#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  Serial.println("I2C Scanner");

  for (byte address = 1; address < 127; address++) {
    Wire.beginTransmission(address);
    if (Wire.endTransmission() == 0) {
      Serial.print("I2C device found at address 0x");
      Serial.println(address, HEX);
    }
  }
}

void loop() {}

To make the I2C scanning task easier, you can make an I2C scanner shield.
https://www.pcbway.com/project/shareproject/OLED_0_96__I2C_Scanner_Shield.html