Pages: [1]
|
|
|
|
Author
|
Topic: [solved] unable to perform Configuration File Backup (Read 1769 times)
|
|
F4HTX
schon länger dabei
Offline
Posts: 66
Scotty, energize...
|
|
[solved] unable to perform Configuration File Backup
« on: 28. July 2018, 09:30:22 »
|
|
Hello Friends,
Easier to say than to do...
I am unable to perform the Configuration File Backup : I tried to follow those instructions ( https://github.com/df8oe/UHSDR/wiki/Backup-and-Restore ) and I ended with :
landsofmordor:Desktop francois$ python uhsdr_tool.py Traceback (most recent call last): File "uhsdr_tool.py", line 144, in <module> backupRestoreApp() File "uhsdr_tool.py", line 51, in backupRestoreApp import serial ImportError: No module named serial
I use a Mac computer, Python 2.7.10 and the mchf cat is working fine with wsjtx (usb cable in the DFU socket).
I am really not a code guy, thank you in advance for your understanding
Best Regards,
François
edit by Mod: moved to the right category
|
« Last Edit: 28. July 2018, 16:00:46 by DL8EBD » |
Logged
|
|
|
|
|
F4HTX
schon länger dabei
Offline
Posts: 66
Scotty, energize...
|
|
Re:unable to perform Configuration File Backup
« Reply #2 on: 28. July 2018, 11:52:54 »
|
|
Hi Andreas,
Thanks for the clue, it helped to go forward.
For OSX users, I installed pyserial using : sudo easy_install pyserial
Then :
francois$ python uhsdr_tool.py This program backups and restores the configuration of UHSDR TRX via USB Use -h to get more information
List of detected UHSDR TRX [u'/dev/cu.usbmodem1D151'] Please specify valid UHSDR TRX serial port number(!) with -p / --port
so I guessed :
francois$ python uhsdr_tool.py -p /dev/cu.usbmodem1D151 -b usage: uhsdr_tool.py [-h] [-b] [-r] [-p PORT] [-f FILE] uhsdr_tool.py: error: argument -p/--port: invalid int value: '/dev/cu.usbmodem1D151'
Closer, but not yet...
ioreg gives this (extract) : | +-o USB Interface mchf@1d150000 <class AppleUSBDevice, id 0x10000ea57, registered, matched, active, busy 0 (14 ms), retain 22> | "PortNum" = 5 | "USB Serial Number" = "00000000002A"
and : ls /dev/tty.usb* /dev/tty.usbmodem1D151
I am not sure what would be the correct syntax for PORT
73's
François[i][/i]
|
« Last Edit: 28. July 2018, 12:18:17 by F4HTX » |
Logged
|
|
|
|
F4HTX
schon länger dabei
Offline
Posts: 66
Scotty, energize...
|
|
Re:unable to perform Configuration File Backup
« Reply #3 on: 28. July 2018, 15:14:31 »
|
|
Hi Andreas and Friends,
Success !!
Well almost success, I had to do some tweak that Danilo will not approve...
OSX name the usb devices like /dev/cu.usbmodem1D151, so the script do not know how to handle that. I, brutally and inelegantely, hard coded my device name in the script and the backup performed.
Line 88 of the script : " comPort= ("COM" if os.name == "nt" else "/dev/cu.usbmodem1D151")"
As it already exists for the eeprom, could it be possible to add a backup/restore function for the usb key ?
Thanks for helping
Best Regards,
François
|
|
Logged
|
|
|
|
|
F4HTX
schon länger dabei
Offline
Posts: 66
Scotty, energize...
|
|
Re:unable to perform Configuration File Backup
« Reply #5 on: 28. July 2018, 16:00:04 »
|
|
Hi Andreas,
You are right about modern language, and thank you for the clean programming.
About the robustness of a backup/restore on key, an intermediary step might be to set an intermediary dialog saying "this is a version x file and you are running a version y code, are you really sure you want to do this ?).
This is absolutely not perfect, bu t this might save a lot of time when testing, experimenting or bug hunting.
Best Regards,
François
|
|
Logged
|
|
|
|
DB4PLE
positron Urgestein
Offline
Posts: 1278
|
|
Re:[solved] unable to perform Configuration File Backup
« Reply #6 on: 28. July 2018, 21:13:41 »
|
|
Hi Francois,
I think, it should be not a problem to a) support OSX b) teach -p to accept full device names.
since b) includes a) we should work on b).
Please replace the line "comPort = ...." with
try: int(args.port); comPort= ("COM" if os.name == "nt" else "/dev/ttyACM") + str(args.port) except: comPort = args.port
|
|
Now you can pass full device names as well as numbers (numbers will work only on Linux and Windows).
Please test, report and I'll update the code (or you create a pull request on GitHub).
73 Danilo
|
« Last Edit: 28. July 2018, 21:14:01 by DB4PLE » |
Logged
|
|
|
|
F4HTX
schon länger dabei
Offline
Posts: 66
Scotty, energize...
|
|
Re:[solved] unable to perform Configuration File Backup
« Reply #7 on: 29. July 2018, 06:39:55 »
|
|
Hi Danilo,
Thank you for the code, it runs fine. But I needed to change the type of the port argument from int to str (line 66).
Hope that is clean to do that.
73's
François
|
|
Logged
|
|
|
|
DB4PLE
positron Urgestein
Offline
Posts: 1278
|
|
Re:[solved] unable to perform Configuration File Backup
« Reply #8 on: 29. July 2018, 08:50:46 »
|
|
Hi Francois,
you're right, then it is a string .
Good, but the idea works and has the benefit of being compatible with the existing approach.
I will introduce the necessary changes in the code and publish a pull request soon.
73 Danilo
|
|
Logged
|
|
|
|
Pages: [1]
|
|
|
|
|
|
|