I have an SA818 and exec'ing sa818 version fails with the following :
SA818: ERROR: Unable to decode the firmeare version
Traceback (most recent call last):
File "/usr/bin/sa818", line 425, in <module>
main()
File "/usr/bin/sa818", line 409, in main
radio.version()
File "/usr/bin/sa818", line 121, in version
return version
^^^^^^^
UnboundLocalError: cannot access local variable 'version' where it is not associated with a value
With a bit of debugging I found the reply string include 2 "_" characters (+VERSION:SA818_V5.5_MM).
The following diff appears to resolve the issue (for me).
diff --git a/sa818.py b/sa818.py
index 71f1a7f..0bdb96d 100755
--- a/sa818.py
+++ b/sa818.py
@@ -113,7 +113,7 @@ class SA818:
time.sleep(0.5)
reply = self.readline()
try:
- _, version = reply.split('_')
+ _, version = reply.split('_', 1)
except ValueError:
logger.error('Unable to decode the firmeare version')
else:
Bonus points if you can also correct two typos (firweare --> firmware, tome --> tone)
I have an SA818 and exec'ing
sa818 version
fails with the following :With a bit of debugging I found the reply string include 2 "_" characters (+VERSION:SA818_V5.5_MM).
The following diff appears to resolve the issue (for me).
Bonus points if you can also correct two typos (firweare --> firmware, tome --> tone)