Home Forums Search Search Results for 'oled'

Viewing 8 results - 16 through 23 (of 23 total)
  • Author
    Search Results
  • Rix
    Participant

      Yes, I always get this error.

      Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
      Core 1 register dump:
      PC      : 0x4000c2af  PS      : 0x00060730  A0      : 0x800d176c  A1      : 0x3ffb1f20  
      A2      : 0x3ffb1f42  A3      : 0x00000000  A4      : 0x00000006  A5      : 0x3ffb1f42  
      A6      : 0x00000010  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x00000000  
      A10     : 0x00000009  A11     : 0x00000003  A12     : 0x00000064  A13     : 0x00000457  
      A14     : 0x00000011  A15     : 0x00000008  SAR     : 0x0000000a  EXCCAUSE: 0x0000001c  
      EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
      
      ELF file SHA256: 0000000000000000
      
      Backtrace: 0x4000c2af:0x3ffb1f20 0x400d1769:0x3ffb1f30 0x400d1882:0x3ffb1f80 0x400d4912:0x3ffb1fb0 0x40086a75:0x3ffb1fd0

      here is my sketch. it was a long sketch I just make it simple so there is a lot of garbage variable

      Lora 1

      
      // software 2 khusus untuk hardware 2 untuk terhubung ke WiFi dan bot Telegram
      //***************************************************
      //#define FREQUENCY_915 //define frekuensi
      #include <Arduino.h>
      #include <WiFi.h>
      #include <ESP32Ping.h>
      #include <CTBot.h>
      #include <LoRa_E32.h>
      #include <SPI.h>
      #include <Wire.h>
      #include <Adafruit_I2CDevice.h>
      #include <Adafruit_GFX.h>
      #include <Adafruit_SSD1306.h>
      
      #define FPM_SLEEP_MAX_TIME 0xFFFFFFF
      #define AUX 18
      #define M0 19
      #define M1 23
      #define SCREEN_WIDTH 128    // OLED display width, in pixels
      #define SCREEN_HEIGHT 32    // OLED display height, in pixels
      #define OLED_RESET -1       // Reset pin # (or -1 if sharing Arduino reset pin)
      #define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128×64, 0x3C for 128×32
      
      Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
      
      // Variabel global
      unsigned long lastSendTime = 0;
      unsigned long interval = 10000;
      String Data = "";
      String JenisPesanLora = "";
      
      // memulai serial untuk LoRa
      LoRa_E32 e32ttl100(16, 17, &Serial2, AUX, M0, M1, UART_BPS_RATE_9600, SERIAL_8N1); // RX ESP32,TX ESP32, mode Serial, Pin Aux, M0, M1
      // memulai untuk dual core
      TaskHandle_t task0, task1;
      
      //**************************************************************
      // gunakan apabila diperlukan pemasangan wifi manual
      String wifiSSID = "Mi 10T Amien";     // nama wifi anda
      String wifiPassword = "123123456789"; // password wifi
      //*************************************************************
      
      TBMessage tMessage;
      String pingGoogle = "www.google.com";
      String tokenBot = "5397733058:AAHD7UoshanXX-7TIEjPRT02iaCng6qUsso";
      CTBot myBot;
      
      // Deklarasi Fungsi
      void callback();
      void nodeConfig();   // konfigurasi LoRa
      void cekpesanLoRa(); // cek pesan LoRa
      void printParameters(struct Configuration configuration);
      void kirimpesanlora();
      
      void setup()
      {
        // put your setup code here, to run once:
        Serial.begin(9600);
        delay(1000);
        // start LoRa
        e32ttl100.begin();
        nodeConfig(); // konfigurasi LoRa
      
        // start masing masing task di core masing masing
        //  task0 khusus untuk cek LoRa dan task1 untuk bot dan akses WiFi
      }
      
      // LOOP
      //*******************************************************************************
      void loop()
      {
        if (e32ttl100.available() <= 0)
        {
          if (millis() - lastSendTime > interval)
          {
            JenisPesanLora = "GPS";
            lastSendTime = millis();
          }
          else
          {
            JenisPesanLora = "STS";
          }
          kirimpesanlora();
          delay(1500);
        }
        cekpesanLoRa();
        delay(2000);
      }
      //*******************************************************************************
      
      //****————————–Callback Lora————————–****
      void callback()
      {
        Serial.println("Callback");
        Serial.flush();
      }
      
      //****————————–Konfigurasi LoRa————————–****
      void nodeConfig()
      {
        ResponseStructContainer c;
        c = e32ttl100.getConfiguration();
        Configuration configuration = *(Configuration *)c.data;
        configuration.ADDH = 0x0;
        configuration.ADDL = 0x3;
        configuration.CHAN = 0x2;
        configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
        configuration.SPED.uartBaudRate = UART_BPS_9600;
        configuration.SPED.uartParity = MODE_00_8N1;
        configuration.OPTION.fec = FEC_1_ON;
        configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
        configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS;
        configuration.OPTION.transmissionPower = POWER_20;
        configuration.OPTION.wirelessWakeupTime = WAKE_UP_1250;
        // Set configuration changed and set to not hold the configuration
        ResponseStatus rs = e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
        printParameters(configuration);
        Serial.print("Config: ");
        Serial.println(rs.getResponseDescription());
        c.close();
      }
      
      //****————————–Cek Pesan LoRa————————–****
      void cekpesanLoRa()
      {
        if (e32ttl100.available() > 0)
        {
          Serial.println("———-");
      
          ResponseContainer rc = e32ttl100.receiveMessageUntil();
          // Kalau Error print errornya
          if (rc.status.code != 1)
          {
            rc.status.getResponseDescription();
          }
          else
          {
            // Print data yang diterima
            Serial.println(rc.data);
            Data = rc.data;
          }
        }
      }
      
      //****————————–Cek parameter konfigurasi LoRa————————–****
      void printParameters(struct Configuration configuration)
      {
        Serial.println("—————————————-");
      
        Serial.print(F("HEAD : "));
        Serial.print(configuration.HEAD, BIN);
        Serial.print(" ");
        Serial.print(configuration.HEAD, DEC);
        Serial.print(" ");
        Serial.println(configuration.HEAD, HEX);
        Serial.println(F(" "));
        Serial.print(F("AddH : "));
        Serial.println(configuration.ADDH, DEC);
        Serial.print(F("AddL : "));
        Serial.println(configuration.ADDL, DEC);
        Serial.print(F("Chan : "));
        Serial.print(configuration.CHAN, DEC);
        Serial.print(" -> ");
        Serial.println(configuration.getChannelDescription());
        Serial.println(F(" "));
        Serial.print(F("SpeedParityBit : "));
        Serial.print(configuration.SPED.uartParity, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.SPED.getUARTParityDescription());
        Serial.print(F("SpeedUARTDatte : "));
        Serial.print(configuration.SPED.uartBaudRate, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.SPED.getUARTBaudRate());
        Serial.print(F("SpeedAirDataRate : "));
        Serial.print(configuration.SPED.airDataRate, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.SPED.getAirDataRate());
      
        Serial.print(F("OptionTrans : "));
        Serial.print(configuration.OPTION.fixedTransmission, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.OPTION.getFixedTransmissionDescription());
        Serial.print(F("OptionPullup : "));
        Serial.print(configuration.OPTION.ioDriveMode, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.OPTION.getIODroveModeDescription());
        Serial.print(F("OptionWakeup : "));
        Serial.print(configuration.OPTION.wirelessWakeupTime, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.OPTION.getWirelessWakeUPTimeDescription());
        Serial.print(F("OptionFEC : "));
        Serial.print(configuration.OPTION.fec, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.OPTION.getFECDescription());
        Serial.print(F("OptionPower : "));
        Serial.print(configuration.OPTION.transmissionPower, BIN);
        Serial.print(" -> ");
        Serial.println(configuration.OPTION.getTransmissionPowerDescription());
      
        Serial.println("—————————————-");
      }
      
      void kirimpesanlora()
      {
        String Sampaikan = "";
        if (JenisPesanLora == "STS")
        {
          Sampaikan += "STS\0";
        }
        else if (JenisPesanLora == "GPS")
        {
          Sampaikan += "GPS\0";
        }
        ResponseStatus rs = e32ttl100.sendFixedMessage(0x0, 0x1, 0x2, Sampaikan);
        Serial.println("Sending " + Sampaikan);
        Serial.println(rs.getResponseDescription());
      }
      

      Lora 2

      
      #include <Arduino.h>
      #include <TinyGPSPlus.h>
      //#define E32_TTL_100
      //#define FREQUENCY_915
      #include <LoRa_E32.h>
      #include <SPI.h>
      #include <Wire.h>
      #include <Adafruit_I2CDevice.h>
      #include <Adafruit_GFX.h>
      #include <Adafruit_SSD1306.h>
      #define AUX 18
      #define M0 19
      #define M1 23
      #define RXPin 2
      #define TXPin 4
      #define TRIG_PIN_1 25 // ESP32 pin GIOP25 connected to Ultrasonic Sensor’s TRIG pin
      #define TRIG_PIN_2 26 // ESP32 pin GIOP26 TRIG pin
      #define TRIG_PIN_3 33 // ESP32 pin GIOP33 TRIG pin
      #define ECHO_PIN_1 34 // ESP32 pin GIOP34 connected to Ultrasonic Sensor’s ECHO pin
      #define ECHO_PIN_2 35 // ESP32 pin GIOP35 ECHO pin
      #define ECHO_PIN_3 36 // ESP32 pin GIOP36/VN ECHO pin
      
      static const uint32_t GPSBaud = 9600;
      
      // HardwareSerial serial1(2);
      LoRa_E32 e32ttl100(16, 17, &Serial2, AUX, M0, M1, UART_BPS_RATE_9600, SERIAL_8N1);
      HardwareSerial ss(1); // GPS hardware serial
      // memulai untuk dual core
      TaskHandle_t task0, task1;
      
      // Variable global
      int jeda_sensor = 5000;
      unsigned long millis_sekarang = 0;
      float duration_us_1, distance_cm_1;
      float duration_us_2, distance_cm_2;
      float duration_us_3, distance_cm_3;
      String Data = "";
      String data_masuk;
      int interval = 5000;
      int interval2 = 32150;
      int interval3 = 5000;
      int interval4 = 5000;
      int interval5 = 5000;
      unsigned long lastSendTime = 0;
      unsigned long lastSendTime2 = 0;
      unsigned long lastSendTime3 = 0;
      unsigned long lastSendTime4 = 0;
      unsigned long lastSendTime5 = 0;
      bool islampuon = 0;
      bool issetrumon = 0;
      
      TinyGPSPlus gps; // memulai GPS NEO-6M
      
      // deklarasi fungsi
      void nodeConfig();
      void Kirim_GPS_LoRa();
      void Baca_Pesan_LoRa();
      
      void setup()
      {
        // komunikasi serial
        Serial.begin(9600);
        delay(600);
        // configure the trigger pin to output mode
        pinMode(TRIG_PIN_1, OUTPUT);
        pinMode(TRIG_PIN_2, OUTPUT);
        pinMode(TRIG_PIN_3, OUTPUT);
        // configure the echo pin to input mode
        pinMode(ECHO_PIN_1, INPUT);
        pinMode(ECHO_PIN_2, INPUT);
        pinMode(ECHO_PIN_3, INPUT);
      
        // komunikasi LoRa
        e32ttl100.begin(); // memulai LoRa
        nodeConfig();      // konfigurasi LoRa
      }
      
      //*********************LOOP***********************
      //*********************LOOP***********************
      void loop()
      {
        Baca_Pesan_LoRa();
        delay(100);
      }
      //*********************LOOP***********************
      //*********************LOOP***********************
      
      //*********************KONFIGURASI LoRa***********************
      void nodeConfig()
      {
        ResponseStructContainer c;
        c = e32ttl100.getConfiguration();
        Configuration configuration = *(Configuration *)c.data;
        configuration.ADDH = 0x0;
        configuration.ADDL = 0x1;
        configuration.CHAN = 0x2;
        configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
        configuration.SPED.uartBaudRate = UART_BPS_9600;
        configuration.SPED.uartParity = MODE_00_8N1;
        configuration.OPTION.fec = FEC_1_ON;
        configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
        configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS;
        configuration.OPTION.transmissionPower = POWER_20;
        configuration.OPTION.wirelessWakeupTime = WAKE_UP_1250;
        // Set configuration changed and set to not hold the configuration
        ResponseStatus rs = e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
        Serial.print("Config: ");
        Serial.println(rs.getResponseDescription());
      }
      
      //*********************Lora Rutin***********************
      void Kirim_GPS_LoRa()
      {
        String Sampaikan = "";
        if (data_masuk == "STS")
        {
          Sampaikan += "Status\n";
          Sampaikan += "LAman\n";
          Sampaikan += "SAman\0";
        }
        else if (data_masuk == "GPS")
        {
          Sampaikan += "Lokasi\n";
          Sampaikan += "Aman\0";
        }
      
        ResponseStatus rs = e32ttl100.sendFixedMessage(0x0, 0x3, 0x2, Sampaikan);
        Serial.println("Sending " + Sampaikan);
        Serial.println(rs.getResponseDescription());
      }
      
      //*********************Baca pesan lora dari esp lain***********************
      void Baca_Pesan_LoRa()
      {
        if (e32ttl100.available() > 0)
        {
          Serial.println("———-");
          ResponseContainer rc = e32ttl100.receiveMessageUntil();
          // Kalau Error print errornya
          if (rc.status.code != 1)
          {
            rc.status.getResponseDescription();
          }
          else
          {
            // Print data yang diterima
            Serial.println(rc.data);
            Data = rc.data;
            data_masuk = Data;
            delay(1000);
            Kirim_GPS_LoRa();
          }
        }
      }
      

      it is a bit mess. please help. im going out of my mind, this is my final college project

      Renzo Mischianti
      Keymaster

        Hi Ricardo,

        EByte E32 are suitable for your pourpuse.

        I create a little project with WeMos D1 mini (esp8266) and LoRa E32 to control and fill water tank that have similar behaivor:

        • a master with relay to activate pump, a simple oled display to show status an encoder to manage menù;
        • a client that is powered by battery that are in sleep mode and have 2 water sensor level.

        This devices communicate in this manner

        • master send a wake message to a remote E32 that wake up;
        • client check water level sensors;
        • send current level to the master and go to sleep;
        • master receive message and if te tank is not full start pump;
        • when client is waked up by max level sensor send a new message to master with the new status and wait for ACK message;
        • master receive message stop pump and send ACK.

        To manage wake of an Arduino up you can refer to this article Ebyte LoRa E32 device for Arduino, esp32 or esp8266: WOR (wake on radio) microcontroller and new Arduino shield

         

        For Raspberry I don’t have a library, and you have 2 way:

        • implement base serial command in Raspberry and use a EByte USB TTLlike so (code is not functional example)
          #!/usr/bin/env python
          import time
          import serial
          ser = serial.Serial(
          port='/dev/ttyS0', #Replace ttyS0 with ttyAM0 for Pi1,Pi2,Pi0
          baudrate = 9600,
          parity=serial.PARITY_NONE,
          stopbits=serial.STOPBITS_ONE,
          bytesize=serial.EIGHTBITS,
          timeout=1
          )
          ser.write('')
        • but I’m going to release a REST server implemented in an esp8266 or esp32 that you can control via GET and POST in this way, and receive messages in realtime via WebSocket
          REST server on esp8266 and esp32: introduction
          with this base I create this web interfaceEByte LoRa E32 Manager Custom Home Page

        I think the second way simplify your work a lot, but you must have patience, because I need more time to publish that.

        But I’m here if you need more information.

        Bye Renzo

      Viewing 8 results - 16 through 23 (of 23 total)