JoToSystems / SX1302_UDP_Packet_Forwarder

SX1302 Modified UDP Packet Forwarder
4 stars 1 forks source link

socket check #2

Open maxntf opened 1 year ago

maxntf commented 1 year ago

Greetings! I myself ran into a problem with the temperature sensor and also planned to figure out what was what and come up with a stub. But I saw your repository and used this solution. Only I constantly have a problem related to the fact that there is no socket control in the 'packet_forwarder' up and down. And if they opened successfully, and then a failure occurs, then the program does not react like that. Could you fix this, add a socket check. Or lay out your sources with changes to the 'packet_forwarder'. Thanks in advance!

JoToSystems commented 1 year ago

Hi, the file on the respository is based on the Semtech packet forwarder with a modification to handle the lack of a temperature sensor. The simplest solution is to replace the function that reads the temperature sensor with one that returns a fixed temperature value, say 22C. I took a slightly different approach, I added a parameter to the global config file to allow the sensor to be active or replaced with a fixed value. The remaining functions of the packet forwarder are unchanged. As a result if the original Semtech packet forwarder didn;t have a socket control then this patch won't have that feature either.

The temperature is used to compensate the value the SX1302/3 chip reads when calculating RSSI. I've found it only chnages the value by less than 1dB and so the simple solution of returning a fixed value provides little difference than measuring actual temperature