繁体   English   中英

带有STM32F103的LoRa模式下的RFM95-我无法发送和接收任何东西

[英]RFM95 in LoRa mode with STM32F103 - I can't transmit and receive anything

我在LoRa模式和STM32F103上使用RFM95。 我的代码非常简单,我只是将控制器用作串行和SPI之间的“桥梁”。

if (Serial.available()>0) {
  inByte = Serial.read();
  if(fifao==0) {
    if (inByte=='R') {
      //if we send R to the serial port it will print all registers values --- it is all working here
      imprimeregist();
    } else if (inByte=='r') {
      //if we send r to the serial port it will read all fifo addres from 0 to 0x80 and print it in the screen --- it is all working here
      lefifo();
    } else if(inByte=='F') {
      //if we send F to the serial port it will read the fifo address and return the value--- it is all working here
      Serial.println(F("type fifo address please: "));
      fifao=1;
    } else {
      //if we type any other thing it will write the next typed value to the address specified 
      entrada[contser]=inByte;
      contser++;
    }
  } else {
    fifu=inByte; 
    Serial.println(spiRcv(fifu),HEX);
    fifao=0;
  }
  if(contser==2) {
    //writing the value ---------------- it is working here too
    writeSPI(entrada[0],entrada[1]);
    Serial.println( spiRead(entrada[0]),HEX);
    contser=0;
  }

我正在使用Arduino IDE(我使用了很多软件,并到达了相同的地方)。 我就是无法传播。

我将其中一个寄存器写入RX LoRa模式,将另一个寄存器写入TX LoRa模式。

有谁能够帮助我? 也许是我必须使用的寄存器的值或我必须进行传输和接收数据的方式。

为了减少干扰,Lora节点无线电在接收时使用I / Q转换,以便仅听到网关的声音,而不会听到对方的声音。

为了使两个Lora节点直接相互通信,需要清除它们的反转IQ标志(如此处https://github.com/things-nyc/arduino-lmic/blob/master/src/lmic/radio所示) .c#L590

#define LORARegInvertIQ 0x33
writeReg(LORARegInvertIQ, readReg(LORARegInvertIQ) & ~(1<<6));

一旦您这样做,他们应该能够互相听到。 这是做到这一点的示例Arduino草图: https : //github.com/things-nyc/arduino-lmic/blob/master/examples/raw/raw.ino

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM