Beacon Scanner + Repetier

Hey there,

I am trying to install a beacon sensor to my klipper printer, but I can't even download the beacon-module through a regular ssh session.

It starts the download

"cd ~
git clone https://github.com/beacon3d/beacon_klipper.git
./beacon_klipper/install.sh"

But it says:

"beacon: klipper or klippy env doesn't exist"

If I do ls dev by id it shows the beacon correctly, but it seems that I can't talk to it at all.

Has anyone set up a Beacon with Repetier? How did you manage to do it. I'm a bit lost.


German answers welcome too.

Comments

  • I never did this by I think your problem is this:
    "beacon: klipper or klippy env doesn't exist"

    You must activate correct klipper environment. For server the klipper installations are all in /opt/klipper/<printer slug name>

    I guess after activating the env it would work better.
    Or do you even need to unpack this inside klipper sources?
  • I tried installing it in /opt/klipper/<printer slug name> but I don't have permission.

    Apparently it needs to be unpacked inside klipper sources.

    In the past I have only done the beacon install on printers running mainsailos, here the process was incredibly simple, because you can simply paste the command after login through shell.


  • It is easier if you run it as user owning and running klipper. Enter
    sudo -i sudo -u repetierserver bash
    and you are user repetierserver and have no permission issues any more. Same installation process just adapt folders to the one used. We can have multiuple klipper instances in parallel so we need different solution to handle it and also it is better to run klipper as same user than server so there are no permission issues.
  • Thanks, I was able to install into /opt/klipper/<printer slug name> now, however, it still returns, that the klipper or klippy env doesn't exist. (Even though it definitely exists here)

    When looking into the folder through winscp I can see that most folders (test, src, scripts, lib, klippy-env, klippy, docs, config) have "rwx r-x---" rights, but the new beacon_klipper folder that was installed into the directory has it set to "rwxr-xr-x".

    Unfortunately I'm not sure if this has anything to do with it. As of right now the printer still reports, that "beacon" is not a valid config section.
  • As long as user is repetierserver only first 3 permissions letters are relevant. others are group and rest of the world.

    Looking into installer
    KDIR="${HOME}/klipper"
    KENV="${HOME}/klippy-env"

    BKDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

    if [ ! -d "$KDIR" ] || [ ! -d "$KENV" ]; then
        echo "beacon: klipper or klippy env doesn't exist"
        exit 1
    fi

    You get the error when you did not set HOME variable correctly. So run
    export HOME=/opt/klipper/<slug>
    before running installer and it should find the env correctly.
  • Thanks, just got back from vacation. Tried to tackle this at work again, but "export HOME=/opt/klipper/<slug>" does absolutely nothing and it still says, that "klipper" or the "klipper env" doesn't exist.
  • KDIR="${HOME}/klipper"
    in the script is wrong here. Should be
    KDIR="${HOME}"

    when you use 
    export HOME=/opt/klipper/<slug>

    I think. that is already the klipper dir with klippy-env as subdirectory.
  • edited August 9
    Thank you!

    That did the trick for the initial install.

    Unfortunately, because there is no update manager for beacon in Repetier, I need to manually pull the update.
    When running the update

    ./update_firmware.py update all

    it tries to do a sudo dfu firmware upload. Because I don't have the password, the update fails.

    Anything you can think of, that I can do here? It won't let me start the update without running it as repetierserver..

  • There is no password for that user. You need to add dfu to list of sudoers. See file
    /etc/sudoers.d/repetierserver-perms
    how it looks and add one mor eline withh full path to dfu.
  • Great, but how do I go about figuring out this "full path to dfu"?
  • if it is in your path enter
    type dfu
    to see where the file is stored. I mean enter complete path starting with / to the dfu executeable. If it is not in linux path because it is in the klipper folder somewhere youe need to find where. In my klipper/linux it does not exist.
  • Thanks, but I'm not sure what you are saying. DFU is a method to directly upload firmware to the scanner.
  • Looking into the code it actually calls dfu-util an external command so full path needed in sudoers list seems to be /usr/bin/dfu-util where it is located on my pi at least.
  • To add it run as user pi
    sudo echo "repetierserver ALL=NOPASSWD: /usr/bin/dfu-util" >>/etc/sudoers.d/repetierserver-perms

  • Thank you!

    Running
    sudo echo "repetierserver ALL=NOPASSWD: /usr/bin/dfu-util" >>/etc/sudoers.d/repetierserver-perms

    returned a permission error, but I was able to edit the file via winscp. After running the update command it flashed fine. It is now connected to the printer.

    Again, thanks for the help. Highly appreciated. :-)
Sign In or Register to comment.