OPEnSLab-OSU / Loom-V4

Open Source Internet Of Things Rapid Prototyping Framework For Environmental Sensing Applications
5 stars 1 forks source link

Failed to acknowledge packet sent but still received #54

Closed chabe-bit closed 1 year ago

chabe-bit commented 1 year ago

Describe the bug The node is failing to send a packet, but the hub is stating the packet's been received and prints out the packet.

Hardware in Use Dendrometer's Node = Feather M0 LoRa + Antenna Dendrometer's Hub = Feather M0 LoRa + Antenna

To Reproduce Steps to reproduce the behavior:

  1. Open two Arduino IDEs for Node and Hub
  2. Find Dendrometer.ino in examples/Lab Examples/Dendrometer and push into Hub
  3. Find Transmit.ino in examples/Radios/LoRa/Transmit and push into Node
  4. Open serial monitor for both devices
  5. Most packets will be sent and received successfully, but some will say fail and still send.

Expected behavior If a packet fails to send, it should not be received and appear on the other end.

Code

      if(!manager.sendtoWait((uint8_t*)buffer, measureMsgPack(manInst->getDocument()), destinationAddress)){
          printModuleName(); Serial.println("Failed to send packet to specified address! The message may have gotten their but not received and acknowledgement response");
      }else{
          printModuleName(); Serial.println("Successfully transmitted packet!");
      }

Output ------------------- Hub ------------------ 17:21:15.649 -> [Manager] Data Json: 17:21:15.649 -> "contents": [ 17:21:15.649 -> { 17:21:15.649 -> "module": "Packet", 17:21:15.649 -> "data": { 17:21:15.649 -> "Number": 12 17:21:15.649 -> } 17:21:15.649 -> }, 17:21:23.226 -> [LoRa] Failed to send packet to specified address! The message may have gotten their but not received and acknowledgement response

---------------- Node ------------------ 17:21:13.030 -> [LoRa] Waiting for packet... 17:21:17.568 -> [LoRa] Packet Received! 17:21:17.568 -> [LoRa] 17:21:17.568 -> Message Received: 17:21:17.568 -> "contents": [ 17:21:17.568 -> { 17:21:17.568 -> "module": "Packet", 17:21:17.568 -> "data": { 17:21:17.568 -> "Number": 12 17:21:17.568 -> } 17:21:17.568 -> },

Additional context Plausible faults could be the sleep cycle or recvFromAckTimeout is throwing false because we're receiving duplicated correct packets. https://www.airspayce.com/mikem/arduino/RadioHead/classRHReliableDatagram.html#ac72c7495936b6f655a5765faac609342

WL-Richards commented 1 year ago

Radio's have been misconfigured for all versions of loom when properly configured it appears that all packets are transmit successfully

Bw125Cr45Sf128 = 0,    ///< Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Default medium range

https://hackaday.io/project/27791-esp32-lora-oled-module/log/69630-radiohead-rf95-driver-low-data-rate-optimization