The KiwiSDR 2 online store is open for orders! Please visit kiwisdr.nz

Rebuilding the kiwi software

Hi All,

I've had some problems with the power for my kiwisdr 1. I need to rebuild my kiwisdr. I can log in with Putty no problem I tried to follow the rebuild instructions below but when I type "up". It just says "bash: up: command not found". However, in the folder I am in at the time I can see the command "up" in bright green. Can somebody please advise what I am doing wrong?

  • How do I recover from a corrupted software build?
  • If you think you might have a corrupted build of the software on the Beagle proceed as follows. Login over the network to the Beagle using the debian account. The password (unless you've changed it) is likely the Kiwi serial number or admin password or possibly "temppwd". From a Linux machine use the ssh program, i.e. "ssh debian@kiwisdr.local". From Windows try PuTTY or something similar. Then type these commands on the Beagle:
    • sudo su This starts a root shell. Use the same debian account password.
    • cdp (change directory project) This changes to the build directory.
    • up (update) This should fetch the latest software from github.com, rebuild it, install it and restart the server.

root@kiwisdr:~/Beagle_SDR_GPS# ls

arch      kiwi.config      pru

bits.h     kiwi.h        RASPBERRYPI

CHANGE_LOG   KiwiSDR.rx14.wf0.bit README.md

config.h    KiwiSDR.rx3.wf3.bit  rx

_COPYRIGHT   KiwiSDR.rx4.wf4.bit  support

CROSS_COMPILE KiwiSDR.rx8.wf2.bit  test.h

d       _LICENSE       tools

dev      main.cpp       types.h

dl       Makefile       ui

e_cpu     Makefile.comp.inc   unix_env

extensions   n           up

g       net          update_fix

gps      ng          valgrind.h

init      options.h       verilog

k       pkgs         verilog.Vivado.2022.2.ip

kiwi      platform       web

root@kiwisdr:~/Beagle_SDR_GPS# up

bash: up: command not found

Comments

  • Try ./up

    Also, what does ls -la up tell you?

    And cat up

  • root@kiwisdr:~/Beagle_SDR_GPS# ./up

    make: *** No rule to make target 'stop'. Stop.

    error: object file .git/objects/39/aee1df9cda748de119d493bce56bbfd269086d is empty

    error: object file .git/objects/39/aee1df9cda748de119d493bce56bbfd269086d is empty

    fatal: loose object 39aee1df9cda748de119d493bce56bbfd269086d (stored in .git/objects/39/aee1df9cda748de119d493bce56bbfd269086d) is corrupt

    error: object file .git/objects/92/4381b83ce3f350cf2576699960e12020c439c1 is empty

    error: object file .git/objects/92/4381b83ce3f350cf2576699960e12020c439c1 is empty

    fatal: loose object 924381b83ce3f350cf2576699960e12020c439c1 (stored in .git/objects/92/4381b83ce3f350cf2576699960e12020c439c1) is corrupt

    fatal: The remote end hung up unexpectedly

    make: *** No rule to make target 'clean'. Stop.

    make: *** No targets. Stop.

    make: *** No rule to make target 'install'. Stop.

    make: *** No rule to make target 'start'. Stop.

    "./up" did the above

    ls -la up

    -rwxr-xr-x 1 root root 478 Apr 6 2021 up

    root@kiwisdr:~/Beagle_SDR_GPS# cat up

    #!/bin/sh

    # update to the latest version on Github


    # hack to see if we're running on a BBB

    if test ! -f /etc/dogtag; then

        echo "probably don't want to run this on development machine"

        exit 0

    fi


    if test "x$KIWI_CONSOLE" = "xyes" ; then

      echo "No! Don't do from a console connection. Will strand the Beagle."

      echo "Instead do: m git; mc; m; mi; (restart button)"

      exit 0

    fi


    make stop

    git clean -fd

    git checkout .

    git pull -v

    make clean

    make

    make install

    make start

    root@kiwisdr:~/Beagle_SDR_GPS#


    So I'm guessing something has gone wrong but I don't know how to fix it.

    It is a BBAI btw in case that is relevant.

    Thanks for quick response

  • Okay. Your git clone is trashed. Need a different procedure. I should probably write a script for this. But try this sequence of commands please:

    cd

    rm -rf Beagle_SDR_GPS

    gclone Beagle_SDR_GPS

    cdp

    m (will take a while)

    mi

    ku


  • They have all executed successfully. But, If I try to login via the ip address it is still refusing a connection. DO I need to remove power and restart it?

    Below is the last part of the script

    sent 35,255,369 bytes received 234 bytes 10,073,029.43 bytes/sec

    total size is 35,245,879 speedup is 1.00


    DX_SHA256=9c7dfb38 DX_NEEDS_UPDATE=


    systemctl enable kiwid.service

    Synchronizing state of kiwid.service with SysV service script with /lib/systemd/systemd-sysv-install.

    Executing: /lib/systemd/systemd-sysv-install enable kiwid

    make[1]: Leaving directory '/root/Beagle_SDR_GPS'

    root@kiwisdr:~/Beagle_SDR_GPS# ku

    systemctl --full --lines=250 stop kiwid.service || true

    systemctl --full --lines=250 start kiwid.service || true

    root@kiwisdr:~/Beagle_SDR_GPS#

  • How long did you wait after the ku finished? Try again after one minute.

    Also, do a ps lax | gr kiwid and see if the following is contained in the ps output:

    /usr/local/bin/kiwid -use_spidev 1 -bg -v 1.671
    
  • root@kiwisdr:~/Beagle_SDR_GPS# ps lax | gr kiwid

    0   0 2641 15063 20  0  3752 1684 pipe_w S+  pts/0   0:00 grep --color=auto -i --color=auto kiwid

    about 10 minutes now.

  • How do I do the latter bit?

  • root@kiwisdr:~/Beagle_SDR_GPS# /usr/local/bin/kiwid -use_spidev 1 -bg -v 1.671

    SHMEM=44.863 MB: ipc=0.008 spi=0.220 rx=2.002 wf=4.552 wspr=33.233 drm=4.770

    Wed Apr 17 22:03:52 00:00:00.402  L KiwiSDR v1.671 --------------------------------------------------------------------

    Wed Apr 17 22:03:52 00:00:00.402  L compiled: Apr 17 2024 21:28:12 on kiwisdr

    Wed Apr 17 22:03:52 00:00:00.402  L /etc/debian_version 9.13

    Wed Apr 17 22:03:52 00:00:00.402   TASK MAX_TASKS 217(198|17|2), stack memory 17.6 MB, stack size 8|32|64 k so(u64_t)

    Wed Apr 17 22:03:52 00:00:00.464  L cfg_parse_json: file tcfg:kiwi.json line=1 position=0 token=0 invalid character inside JSON string

    Wed Apr 17 22:03:52 00:00:00.465  L passbands":{"am": {"lo":-4900, "hi":4900},"amn": {"lo":-2500, "

    Wed Apr 17 22:03:52 00:00:00.465  L ^ JSON error position

    Wed Apr 17 22:03:52 00:00:00.465  L cfg_save_json: /root/kiwi.config/kiwi.json JSON PARSE ERROR -- FILE SAVE ABORTED!

    passbands":{"am": {"lo":-4900, "hi":4900},"amn": {"lo":-2500, "hi":2500},"amw": {"lo":-6000, "hi":6000},"sam": {"lo":-4900, "hi":4900},"sal": {"lo":-4900, "hi":  0},"sau": {"lo":  0, "hi":4900},"sas": {"lo":-4900, "hi":4900},"qam": {"lo":-4900, "hi":4900},"drm": {"lo":-5000, "hi":5000},"lsb": {"lo":-2700, "hi":-300},"lsn": {"lo":-2400, "hi":-300},"usb": {"lo": 300, "hi":2700},"usn": {"lo": 300, "hi":2400},"cw": {"lo": 300, "hi": 700},"cwn": {"lo": 470, "hi": 530},"nbfm":{"lo":-6000, "hi":6000},"nnfm":{"lo":-3000, "hi":3000},"iq": {"lo":-5000, "hi":5000}}}

    Wed Apr 17 22:03:52 00:00:00.465   PANIC: "json integrity fail" (init/cfg.cpp, line 1576)

    root@kiwisdr:~/Beagle_SDR_GPS#

  • Ugh. So either your configuration was trashed, or you just trashed it by running the server in an unapproved way.

    Try:

    cdp

    mst

    cp unix_env/kiwi.config/dist.kiwi.json ../kiwi.config

    msa

    Then wait maybe 30 seconds and see if it comes up.

  • all the commands executed OK but still no difference. Do you think it is worth disconnecting the power and letting it boot back up again?

  • just run the ps lax again after running the above commands and results below

    root@kiwisdr:~/Beagle_SDR_GPS# ps lax | gr kiwid

    0   0 14621 8197 20  0  3752 1656 pipe_w S+  pts/0   0:00 grep --color=auto -i --color=auto kiwid

    root@kiwisdr:~/Beagle_SDR_GPS# /usr/local/bin/kiwid -use_spidev 1 -bg -v 1.671

    SHMEM=44.863 MB: ipc=0.008 spi=0.220 rx=2.002 wf=4.552 wspr=33.233 drm=4.770

    Wed Apr 17 22:27:55 00:00:00.604  L KiwiSDR v1.671 --------------------------------------------------------------------

    Wed Apr 17 22:27:55 00:00:00.604  L compiled: Apr 17 2024 21:28:12 on kiwisdr

    Wed Apr 17 22:27:55 00:00:00.605  L /etc/debian_version 9.13

    Wed Apr 17 22:27:55 00:00:00.605   TASK MAX_TASKS 217(198|17|2), stack memory 17.6 MB, stack size 8|32|64 k so(u64_t)

    Wed Apr 17 22:27:56 00:00:00.667  L cfg_parse_json: file tcfg:kiwi.json line=1 position=0 token=0 invalid character inside JSON string

    Wed Apr 17 22:27:56 00:00:00.668  L passbands":{"am": {"lo":-4900, "hi":4900},"amn": {"lo":-2500, "

    Wed Apr 17 22:27:56 00:00:00.668  L ^ JSON error position

    Wed Apr 17 22:27:56 00:00:00.668  L cfg_save_json: /root/kiwi.config/kiwi.json JSON PARSE ERROR -- FILE SAVE ABORTED!

    passbands":{"am": {"lo":-4900, "hi":4900},"amn": {"lo":-2500, "hi":2500},"amw": {"lo":-6000, "hi":6000},"sam": {"lo":-4900, "hi":4900},"sal": {"lo":-4900, "hi":  0},"sau": {"lo":  0, "hi":4900},"sas": {"lo":-4900, "hi":4900},"qam": {"lo":-4900, "hi":4900},"drm": {"lo":-5000, "hi":5000},"lsb": {"lo":-2700, "hi":-300},"lsn": {"lo":-2400, "hi":-300},"usb": {"lo": 300, "hi":2700},"usn": {"lo": 300, "hi":2400},"cw": {"lo": 300, "hi": 700},"cwn": {"lo": 470, "hi": 530},"nbfm":{"lo":-6000, "hi":6000},"nnfm":{"lo":-3000, "hi":3000},"iq": {"lo":-5000, "hi":5000}}}

    Wed Apr 17 22:27:56 00:00:00.668   PANIC: "json integrity fail" (init/cfg.cpp, line 1576)

    root@kiwisdr:~/Beagle_SDR_GPS#

  • No, you don't run /usr/local/bin/kiwid -use_spidev 1 -bg -v 1.671 yourself. That's bad. That string describes the output from the ps command that you're looking for (which I don't see).

    So try this please:

    cdp

    mst

    cp unix_env/kiwi.config/dist.kiwi.json ../kiwi.config

    reboot

    In this case it will take as long as one minute before you might be able to do a Kiwi connection (assuming it works).

    If it doesn't work PuTTY in again and do:

    cdp

    msl | tail -n 1000

    And copy/paste the result to support@kiwisdr.com

  • just on midnight so I'll be back on in the (UK) morning. Thanks for your support.

  • I'll try the stuff above first

  • root@kiwisdr:~/Beagle_SDR_GPS# msl | tail -n 1000

    I've had to cut this back as it was 93218 characters too long but it appears to be repetitive anyway.


    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.679  KiwiSDR v1.671 --------------------------------------------------------------------

    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.679  compiled: Apr 17 2024 21:28:12 on kiwisdr

    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.679  /etc/debian_version 9.13

    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.739  cfg_parse_json: file tcfg:kiwi.json line=1 position=0 token=0 invalid character inside JSON string

    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.740  passbands":{"am": {"lo":-4900, "hi":4900},"amn": {"lo":-2500, "

    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.740  ^ JSON error position

    Apr 17 22:57:07 kiwisdr kiwid: 00:00:00.740  cfg_save_json: /root/kiwi.config/kiwi.json JSON PARSE ERROR -- FILE SAVE ABORTED!

    Apr 17 22:57:07 kiwisdr kiwid: PANIC: "json integrity fail" (init/cfg.cpp, line 1576)

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 0 0xb61fc /usr/local/bin/kiwid() [0xb61fc]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 1 0xb6188 /usr/local/bin/kiwid() [0xb6188]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 2 0xaf11c /usr/local/bin/kiwid() [0xaf11c]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 3 0xae214 /usr/local/bin/kiwid() [0xae214]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 4 0xada40 /usr/local/bin/kiwid() [0xada40]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 5 0xad578 /usr/local/bin/kiwid() [0xad578]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 6 0x21e24 /usr/local/bin/kiwid() [0x21e24]

    Apr 17 22:57:07 kiwisdr kiwid: panic: backtrace 7 0xb664e4aa /lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x9d) [0xb664e4aa]

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.450  KiwiSDR v1.671 --------------------------------------------------------------------

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.452  compiled: Apr 17 2024 21:28:12 on kiwisdr

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.453  /etc/debian_version 9.13

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.514  cfg_parse_json: file tcfg:kiwi.json line=1 position=0 token=0 invalid character inside JSON string

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.516  passbands":{"am": {"lo":-4900, "hi":4900},"amn": {"lo":-2500, "

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.517  ^ JSON error position

    Apr 17 22:57:20 kiwisdr kiwid: 00:00:00.518  cfg_save_json: /root/kiwi.config/kiwi.json JSON PARSE ERROR -- FILE SAVE ABORTED!

    Apr 17 22:57:20 kiwisdr kiwid: PANIC: "json integrity fail" (init/cfg.cpp, line 1576)

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 0 0xb61fc /usr/local/bin/kiwid() [0xb61fc]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 1 0xb6188 /usr/local/bin/kiwid() [0xb6188]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 2 0xaf11c /usr/local/bin/kiwid() [0xaf11c]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 3 0xae214 /usr/local/bin/kiwid() [0xae214]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 4 0xada40 /usr/local/bin/kiwid() [0xada40]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 5 0xad578 /usr/local/bin/kiwid() [0xad578]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 6 0x21e24 /usr/local/bin/kiwid() [0x21e24]

    Apr 17 22:57:20 kiwisdr kiwid: panic: backtrace 7 0xb668c4aa /lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x9d) [0xb668c4aa]

  • Here is all 1000 lines in notepad. Appears to be in a loop of some sort


  • I also rebooted again, logged in quickly and grabbed 2000 lines... all exactly as above

  • jksjks
    edited April 18

    Aw hell, typo. Sorry.

    Instead of: cp unix_env/kiwi.config/dist.kiwi.json ../kiwi.config

    Try the above commands with: cp unix_env/kiwi.config/dist.kiwi.json ../kiwi.config/kiwi.json

  • Thank you so much for all the support. For anybody reading this particular thread, this is why it is worth buying a genuine product from the creator. Apart from it being a fantastic product, the support is second to none. As you can tell by the post, all back up and running. Now to take a much closer look at the 5V linear PSU ( which I'm not using until I understand what went wrong).

    Thanks again.

  • edited April 18

    Posting here in case anybody else ever has the issue I'm about to describe. I built my own linear 5V PSU capable of up to 8A. On the output side I had used one of those ubiquitous digital volt amp meters from China. As you may know, to measure current, the negative feed to the load goes through a connector on the digital meter via an on-board shunt. Anyway, one of the pins on the current monitor connector (JST HV) was not soldered properly and thus giving a resistance. Now fixed and load tested.

Sign In or Register to comment.