Can dx.json be manually edited?

edited January 31 in KiwiSDR Discussion
Can I just use nano to edit it?

Comments

  • jksjks
    Accepted Answer
    Yes. But be careful. You'll have to use URL encoding (http://www.w3schools.com/tags/ref_urlencode.asp) for all but the most ordinary characters. If you make an error in JSON syntax then the server will panic and restart over and over (hmm, I should do something more graceful). Login to the Beagle, "cdp", "ms" and look for messages like these:

    Jan 30 23:53:57 grn kiwid[22834]: 0:00:01 ....      cfg_parse_json: file /root/kiwi.config/dx.json line=4 pos=230 tok=21

    Jan 30 23:53:57 grn kiwid[22834]: 0:00:01 ....      invalid character inside JSON string

    Jan 30 23:53:57 grn kiwid[22834]: PANIC: "jsmn_parse" (cfg.c, line 693)


    Line 4 looks like:

    ,[14.88,"CWN",Alpha%20F3%2fp%20RUS","Khabarovsk%20%26%20Novosibirsk,%20navigation%20system"]
    So I forgot the double quote (") before "Alpha".

    *Someday* I'll get around to adding a .csv file upload/download function like what WebSDR has.


  • Seems like deleting stuff might be easy.....     looking at lines like these, just delete a whole line, correct?

    ,[10253.75,"CW","FSK","FSK-CW%20ID,%208PM",{"WL":1}]
    ,[10285.00,"USB","FSK","8PM",{"WL":1}]
    ,[10304.00,"CW","FSK","5PM",{"WL":1}]
    ,[10309.00,"USB","FSK","2AM",{"WL":1}]
    ,[10318.50,"USB","FSK","6PM",{"WL":1}]
    ,[10333.00,"CW","FSK","weak,%208PM",{"WL":1}]
    ,[10334.00,"CW","FSK","8PM",{"WL":1}]
    ,[10345.00,"AM","HM01%20CUB","6PM",{"WL":1}]
    ,[10352.50,"USB","STANAG","8PM",{"WL":1}]
    ,[10362.00,"CW","FSK","11PM",{"WL":1}]
    ,[10373.00,"CW","CW","11PM",{"WL":1}]
    ,[10373.50,"USB","STANAG","5PM",{"WL":1}]
    ,[10400.00,"CW","FSK","11PM",{"WL":1}]
    ,[10405.00,"USB","STANAG%204529","11PM",{"WL":1}]
    ,[10408.35,"CW","FSK","11PM",{"WL":1}]
    ,[10421.30,"USB","STANAG","12AM",{"WL":1}]
    ,[10429.00,"USB","FSK","9PM",{"WL":1}]

  • jksjks
    Accepted Answer
    Yes

  • edited September 22
    I would like to delete most (or all) of the lines in the default dx.json file, to make all new frequency markers.

    I'm unfamiliar with Debian. 
    But, I've logged into the Beagle Debian console 
    in the kiwiSDR admin panel. 
    Then, using the shell commands cd and cat, etc: 
    I made a backup of the file.

    I could read the dx.json file and copy the text with ctrl-c

    Then, ctrl-v pasted it into Notepad++ on my Windows box.
    Now I have an edited file. 
    But, how do I get that new edited file back into the Beagle so it can be utilized?

    On my Windows box, I tried reading the micro SD card and then tried connecting the Beagle USB port to the Windows box. Both of those attempts were total fail. 

    Is there any way in Nano or some other method, to clear many default lines of the file in a single command, instead of hundreds of commands? 

    Also, I would like to exchange dx.json marker files with other users. 
  • I would suggest you become familiar with how to ssh into the kiwi and edit etc. natively there. 
  • once ssh is going, you can use scp to move files
  • The v1.128 release adds a file to /root/kiwi.config called dx.min.json that has most of the entries deleted. You can force an update immediately by restarting the Kiwi.

    From the admin console tab type these commands to use the new file ('cp' is the Linux copy command)
    cd /root/kiwi.config
    cp dx.json dx.json.save
    cp dx.min.json dx.json

    Now you can use the Kiwi web interface for editing the entries. Unfortunately on-screen text editors like nano don't work with the console tab. Better to figure out the Windows command line tools for copying files over the network to the Kiwi as Jim suggests. Or if connected to the Kiwi using ssh or PuTTY (Windows) then running nano on the Kiwi should work.


  • I use MobaXterm to ssh/editing everything on the Kiwi.
    (ps: Notepad2 as editor)
  • I would be happy to host a repository of dx.json files on a public/free access Dropbox site. Mail me your file at jim@jimlill.com renamed <your_callsign.json>

    Files will be at 
  • Hi,

    Not being fluent in Linux commands, I use WinSCP https://winscp.net/eng/download.php to move stuff around to and from my windows machine and keep backups of my customised files etc. 

    It's also possible to open and edit files still residing on the KiWi using standard windows applications such as Notepad++ from within WinSCP.

    Regards,

    Martin - G8JNJ



  • I put my own file in the Dropbox site
  • It's great that have that dx.min.json as part of the distro.  That will make it easier for admins to have a log that is unique and relevant to their own station.
  • Hi All,

    Something like this next suggestion has been discussed before


    But here is a new variation on my previous thoughts. Please note that this would require some backend / web work as well as additions to the KiWi.

    A quick brainstorm, so please feel free to add more ideas as they occur.

    When a new tag is entered on a KiWi the Tag information along with Time, Date, KiWi ID (URL or sr.hu reg)  and Signal strength reading are uploaded to a central data base.

    All the information from all participating KiWi's is stored together.

    If a KiWi admin wishes to update his DX Jason file it could be possible to add an update button to the presently unused DX list tab in the admin menu that would automatically import a customised DX Jason file from the central database that is based on a geographical sort centered around the KiWi that is importing it.

    As an incentive for new contributions only admins who have added a minimum number of unique tag entries (say 10) would be allowed to download a customised DX Jason file.

    When the database is searched and the DX Jason file is generated, it is based on the entry with the strongest S meter reading for the target region the importing KiWi is located in, so that It selects the most likely signal to be heard in that region.

    Imported tags are shown in a different colour to locally generated tags, so that the tags that have been added locally are used as a default instead of imported tags and the true source can be quickly identified, so that admins who spend a lot of time adding tags (like myself) don't feel 'ripped off' by others who just import tags without putting the effort in.

    I suggest that if a tag is clicked on, as well as tuning the Kiwi to that frequency, a new separate pop up pane should appear containing more detailed tag information. This would also work better on a tablet like my iPad where the tag information can't be seen when it is hovered over (as is the case on a standard PC browser).

    If the tag information is from another KiWi, the source Kiwi URL and tuning  / mode information should be included in the tag so that it's possible to tune to the originating source KiWi with a click on the URL so that it opens in another browser session. This would mean that the originating KiWi gets a hit and the admin is acknowledged.

    If a user suspects that a tag is not valid, incorrect or can add more information, it should be possible to provide an update via the KiWi tag information pane, that adds a marker to the data base file and advises the admin who originated it that it may require editing.

    Regards,

    Martin - G8JNJ






  • edited September 24
    Thanks, WA2ZKD and G8JNJ, for the advice on using WinSCP and editing the file in Windows. 
    I was able to get the dx.json file edited.

    I used approximately the following settings in WinSCP:

    site Settings:
    file protocol: SCP
    address 192.168.1.100 port 22
    user: root

    From there, entered the Beagle /root directory. 

    then the sub-directory: kiwi.config
    then the file to edit: dx.json
    Copied the file to the Windows machine.
    Renamed the BeagleKiwiSDR dx.json file to original.dx.json
    Edited the Windows dx.json file in the Windows machine and saved it in a Windows directory.
    Copied the Windows dx.json file to the BeagleKiwiSDR directory  /root/kiwi.config/
    Reset the BeagleKiwiSDR hardware.
    Voila'.
    It worked.

    I kept some of the default markers, especially the IARU beacon network, and some other standard freqs.
    Now, I basically have a blank slate for entering all the new markers.




  • jksjks
    edited September 24
    Some important clarification about the directory locations.

    Anything in /root/Beagle_SDR_GPS will be overwritten with a software update. So do not edit the files in /root/Beagle_SDR_GPS/unix_env/kiwi.config Files here are templates that are copied to /root/kiwi.config exactly once if they don't exist. Because the /root/kiwi.config directory is outside of the /root/Beagle_SDR_GPS directory structure it will not be effected by an update, and it is safe to edit them (and making a backup copy is a good idea).

    Bonnie, I edited your post slightly to reflect this.
    WA2ZKD
  • Hi Bonnie (and All),

    It's a good idea to periodically make a SD card copy too - it's saved me a few times when I've messed something up really badly.

    Regards,

    Martin - G8JNJ
Sign In or Register to comment.