You are reading a single comment by @hygy and its replies. Click here to read the full conversation.
  • Hi,

    I'm trying to make work 2 esp32 modules with lora. But I did not succed.

    espruino version: 1v99.4103
    pinout (i hope it is good): https://cdn.hackaday.io/files/2699111547­82944/Heltec_WIFI-LoRa-32_DiagramPinout.­jpg

    For tx code i use:

    SPI1.setup({ sck:D5, mosi:D27, miso: D19 });
    
    var sx = require("SX127x").connect({spi: SPI1, cs: D18, rst : D14 });
    
    setInterval(function() { sx.onIRQ(); }, 100);
    
    var config = {
      freq: 868E6
    };
    
    sx.setTxConfig(config);
    
    sx.send("Hello", function() {
      console.log("TX done");
    });
    

    for the rx config i use:

    SPI1.setup({ sck:D5, mosi:D27, miso: D19 });
    
    var sx = require("SX127x").connect({spi: SPI1, cs: D18, rst : D14 });
    
    setInterval(function() { sx.onIRQ(); }, 100);
    
    var config = {
      rxContinuous : true,
      freq: 868E6
    };
    
    console.log('starting receiver');
    sx.setRxConfig(config);
    // enter receive mode
    sx.rx(function(err, inf) {
      // Error, or you get signal strength and data returned in an object
      if (err) console.log("RX ERROR");
      else console.log("RX>",inf);
    });
    

    I got no erros. On tx I got nothing. On rx I got this after upload:

    >starting receiver
    RX> { "snr": 82, "rssi": 82,
      "data": new Uint8Array([82, 82, 106, 57, 74, 161, 198, 62, 219, 7, 163, 65, 161, 130, 133, 51, 199, 36, 195, 5, 38, 5, 180, 150, 128, 35, 21, 91, 209, 28, 236, 12, 240, 80, 184, 230, 197, 134, 10, 22, 185, 154, 4, 0, 65, 225, 192, 10, 25, 14, 79, 117, 132, 194, 240, 160, 192, 83, 163, 48, 201, 0, 242, 12, 28, 228, 98, 16, 132, 5, 180, 231, 64, 201, 65, 82, 108, 14, 10, 232, 244, 114])
     }
    

    What I'm doing wrong?

    thanks

About

Avatar for hygy @hygy started