sparkfun / SparkFun_LoRaSerial

A simple to use radio modem for long distances using LoRa.
https://docs.sparkfun.com/SparkFun_LoRaSerial/
Other
17 stars 6 forks source link

When displaying airspeed, the zero is confusing and looks like a bug. (1) back calc it or (2) document it #585

Closed tonycanike closed 9 months ago

tonycanike commented 10 months ago

Subject of the issue

After a power cycle or reboot, the airspeed displays as zero. How can I confirm that it is set properly? I'm attempting to optimize the airspeed for RTCM data between to Facets to maximize the radio range, so I currently need to frequently check if the airspeed is set to 4800, 9600, or 19200 and if both units match.

Two suggestions/alternatives:

Alternative 1: Calc and display airspeed based on bw, coding, and spread When displaying the parameters (eg. ATI0), back-calculate the airspeed from the bandwidth, coding, and spread. I'd guess you have a lookup table to set those three parameters when someone sets the airspeed; could you use that table backwards?

If the bw, coding, and spread are set to non-standard values, that is values that would not be set from an at-airspeed=XXXX command, do something reasonable but not crazy, perhaps display "????".

Alternative 2: Document this behavior Simply document the behavior and provide a link in the product manual to https://github.com/sparkfun/SparkFun_LoRaSerial/blob/main/Documents/Readme.md


Your workbench

ATI1 SparkFun LoRaSerial SAMD21 1W 915MHz OK ati2 ATI2 2.0 OK

Steps to reproduce

ATZ OK OK ati0 ATI0 AT-AirSpeed=0 AT-AutoTune=0 AT-Bandwidth=500.00 AT-ClientFindPartnerRetryInterval=3 AT-CmdVC=0 AT-CodingRate=7 AT-CopyDebug=0 AT-CopySerial=0 AT-CopyTriggers=0 AT-DataScrambling=0 AT-Debug=0 AT-DebugDatagrams=0 AT-DebugHeartbeat=0 AT-DebugNvm=0 AT-DebugRadio=0 AT-DebugReceive=0 AT-DebugSerial=0 AT-DebugStates=0 AT-DebugSync=0 AT-DebugTraining=0 AT-DebugTransmit=0 AT-DisplayRealMillis=0 AT-Echo=0 AT-EnableCRC16=1 AT-EncryptData=1 AT-EncryptionKey=37782141A665734E4475672AE6308308 AT-FlowControl=0 AT-FramesToYield=3 AT-FrequencyHop=1 AT-FrequencyMax=928.000 AT-FrequencyMin=902.000 AT-HeartBeatTimeout=5000 AT-InvertCts=0 AT-InvertRts=0 AT-MaxDwellTime=400 AT-MaxResends=0 AT-NetID=192 AT-NumberOfChannels=50 AT-OperatingMode=0 AT-OverHeadtime=10 AT-PreambleLength=8 AT-PrintAckNumbers=0 AT-PrintChannel=0 AT-PrintFrequency=0 AT-PrintLinkUpDown=0 AT-PrintPacketQuality=0 AT-PrintPktData=0 AT-PrintRfData=0 AT-PrintTimestamp=0 AT-PrintTxErrors=0 AT-RTSOffBytes=32 AT-RTSOnBytes=256 AT-SelectLedUse=4 AT-SerialDelay=50 AT-SerialSpeed=57600 AT-Server=0 AT-SpreadFactor=8 AT-SyncWord=18 AT-TrainingKey=537061726B46756E547261696E696E67 AT-TrainingTimeout=1 AT-TriggerEnable_31-0=0 AT-TriggerEnable_63-32=0 AT-TriggerWidth=25 AT-TriggerWidthIsMultiplier=1 AT-TxPower=30 AT-TxToRxUsec=280 AT-UsbSerialWait=0 AT-VerifyRxNetID=1 OK ato ATO OK

tonycanike commented 10 months ago

I think I understand a little more now. Airspeed is not a characteristic setting of the radio modem hardware. Bandwidth, coding, and spread are. When "setting" the airspeed, we are making a request for comms at that rate, not directly programming the radio modem to operate at the airspeed we request.

The LoRaSerial firmware takes our requested airspeed, and programs the bandwidth, coding, and spread of the radio modem.

I'll update this issue to, when displaying parameters, read the bandwidth, coding, and spread, calc the effective airspeed, and display it.

nseidle commented 9 months ago

do something reasonable but not crazy, perhaps display "????"

Yes, that was the bulk of the conversation we had when we were designing the airspeed command interface. For now, it's very not clean to try to back calculate the airspeed. A lookup table would be a reasonable fix. For now, I've documented how AirSpeed is displayed and checked after a system reset.

tonycanike commented 9 months ago

Awesome, thanks!