logo
Welcome, Guest. Please Login or Register.
05. December 2024, 10:37:47


Home Help Search Login RegisterWIKIUHSDR Download

Amateurfunk Sulingen
Diskussions- und Newsboard des DARC-Ortsverbandes I40  |  allgemeine Kategorie  |  UHSDR Firmware (Moderators: DF8OE, DL1PQ)  |  Topic: [solved] unable to perform Configuration File Backup <- zurück vorwärts ->
Pages: [1] Go Down Print
   Author  Topic: [solved] unable to perform Configuration File Backup  (Read 1769 times)
F4HTX
schon länger dabei
**

Offline

Posts: 66



Scotty, energize...

View Profile
[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
DF8OE
Administrator
*****

Offline

Posts: 6277



Stellvertr. OVV I40, Jugend / Nachwuchsreferent

View Profile WWW
Re:unable to perform Configuration File Backup
« Reply #1 on: 28. July 2018, 10:05:20 »

You need python serial module. At all my Debian based installations this is installed default and named "python-serial". Because Mac OSX is a cloned Unix/Linux in my eyes it may be that your installation missed this package.

vy 73
Andreas
« Last Edit: 29. July 2018, 04:35:58 by DF8OE » Logged

Wenn der Wind des Wandels weht, nageln die einen Fenster und Türen zu und verbarrikadieren sich. Die anderen gehen nach draußen und bauen Windmühlen...
qrz.com-Seite von DF8OE
-----------------------------------------------------
>>>> Die Inhalte meiner Beiträge dürfen ohne meine explizite Erlaubnis in jedwedem Medium weiterverbreitet werden! <<<<
F4HTX
schon länger dabei
**

Offline

Posts: 66



Scotty, energize...

View Profile
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...

View Profile
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
DF8OE
Administrator
*****

Offline

Posts: 6277



Stellvertr. OVV I40, Jugend / Nachwuchsreferent

View Profile WWW
Re:unable to perform Configuration File Backup
« Reply #4 on: 28. July 2018, 15:49:10 »

Hi François,
thats the advantage of an interpreter language  I think we can improve here something in the script.

Backup via USB key is in our todo list but we do not want to do a simple "binary backup" - it is not robust if you are swapping between different UHSDR versions. So not very simple task.

vy 73
Andreas
Logged

Wenn der Wind des Wandels weht, nageln die einen Fenster und Türen zu und verbarrikadieren sich. Die anderen gehen nach draußen und bauen Windmühlen...
qrz.com-Seite von DF8OE
-----------------------------------------------------
>>>> Die Inhalte meiner Beiträge dürfen ohne meine explizite Erlaubnis in jedwedem Medium weiterverbreitet werden! <<<<
F4HTX
schon länger dabei
**

Offline

Posts: 66



Scotty, energize...

View Profile
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





View Profile
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
Code:

      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...

View Profile
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





View Profile
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] Go Up Print 
Diskussions- und Newsboard des DARC-Ortsverbandes I40  |  allgemeine Kategorie  |  UHSDR Firmware (Moderators: DF8OE, DL1PQ)  |  Topic: [solved] unable to perform Configuration File Backup <- zurück vorwärts ->
Jump to: 


Login with username, password and session length

 Es wird die Verwendung von Browsern die auf der "Blink"-Engine basieren und mindestens
1024x768 Pixel Bildschirmauflösung für die beste Darstellung empfohlen
 
Amateurfunk Die Beiträge sind, sofern nicht anders vermerkt, unter der folgenden Lizenz veröffentlicht:
GNU Free Documentation License 1.3 GNU Free Documentation License 1.3
verbindet!
Powered by MySQL Powered by PHP Diskussions- und Newsboard des DARC-Ortsverbandes I40 | Powered by YaBB SE
© 2001-2004, YaBB SE Dev Team. All Rights Reserved.
- modified by Andreas Richter (DF8OE)
Impressum & Disclaimer
Valid XHTML 1.0! Valid CSS!