ropg / heltec_esp32_lora_v3

Proper working Arduino library for the Heltec ESP32 LoRa v3 board, as well as for Wireless Stick v3 and Wireless Stick Lite v3. Uses RadioLib
MIT License
317 stars 15 forks source link

no I2C #34

Open jo-ei opened 1 month ago

jo-ei commented 1 month ago

Hello everyone, I have been trying for days now to address an RTC clock in order to have the time locally after retrieval via LORA.

With the original lib from heltec and the arduino environment it works and I see the address with the I2C scanner. With this lib it does not work and I always see only

SDA on PIN: 41 SCL on PIN: 42 Scanning I2C Addresses Channel 1 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. Scan Completed, 0 I2C Devices found.

is there a special way with this lib?

I have tried many things, here is the latest version of my test code:

#define SDA 41
#define SCL 42

void setup() {
  heltec_setup();
    Wire.begin(SDA, SCL);

  Serial.print("SDA on PIN: ");
  Serial.println(SDA);
  Serial.print("SCL on PIN: ");
  Serial.println(SCL);
}

void loop() {

  Serial.println("Scanning I2C Addresses Channel 1");
  uint8_t cnt=0;
  for(uint8_t i=0;i<128;i++){
    Wire.beginTransmission(i);
    uint8_t ec=Wire.endTransmission(true);
    if(ec==0){
      if(i<16)Serial.print('0');
      Serial.print(i,HEX);
      cnt++;
    }
    else Serial.print("..");
    Serial.print(' ');
    if ((i&0x0f)==0x0f)Serial.println();
    }
  Serial.print("Scan Completed, ");
  Serial.print(cnt);
  Serial.println(" I2C Devices found.");

delay(20000);

}

since i see the clock module with the other code, the wiring must be correct

can you give me a hint what i might be doing wrong?

Thanks

ropg commented 1 month ago

I’ll try to have a look at this later this week.

jo-ei commented 1 month ago

hi, any news about the bug? was it possible to reproduce?

ropg commented 1 month ago

Hello there! I have been operated on my shoulder, and need to have my arm in a sling for another month. So doing anything with electronics and lots of wires is a lot harder now than I would like it to be. Two thoughts:

Good luck!

jo-ei commented 4 weeks ago

Hi ropg, first of all, get well soon for your shoulder.

Unfortunately, the internal RTC does not continue to run during deep sleep and I don't want to get the times via LoRa every time unnecessarily. (or am I doing something wrong and there is a way to get the time even in deep sleep)

I have the light version without display.

I still set the option for testing and couldn't see any improvement. Is there anything else I can do to provide more information?

Thank you