Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sweep-ctl et al. freezes up on first run, but works fine on second run #132

Open
mt-caret opened this issue Apr 17, 2018 · 0 comments
Open

Comments

@mt-caret
Copy link

mt-caret commented Apr 17, 2018

sweep firmware version

1.4

libsweep version + affected bindings

libsweep@HEAD (I haven't tried the others)

operating system

NixOS

Platform/Hardware Setup

Description:

I've been trying to get libsweep working on NixOS, but I've been running into a weird problem;
when I plug the Sweep in and run, for example, sweep-ctl /dev/ttyUSB0 get sample_rate, the Sweep
starts to spin up but the command never returns anything. However, if I Ctrl-C, then
rerun the same command while the Sweep is still spinning, I get the expected output
immediately (in this case, the sample rate 500). I've observed similar behavior for other commands
as well as the example C and C++ programs provided along with libsweep.

I assumed that something was wrong with my OS (since it's not so popular), so I
patched the Sweep visualizer and tried it; the visualizer worked perfectly.

Here's the strace output for the first and second run of sweep-ctl:

Here's the Nix expression that I used for building libsweep.

let
  pkgs = import <nixpkgs> {};
in
  pkgs.stdenv.mkDerivation {
    name = "libsweep";
    src = ./.;
    buildInputs = with pkgs; [ cmake ];
  }

Installing the Nix package manager and placing a file called default.nix
with the above in libsweep/, then executing
nix build should create a result/ directory looking like this:

$ tree ./result
./result
├── bin
│   └── sweep-ctl
├── include
│   └── sweep
│       ├── config.h
│       ├── sweep.h
│       └── sweep.hpp
├── lib
│   ├── cmake
│   │   └── sweep
│   │       └── SweepConfig.cmake
│   ├── libsweep.so -> libsweep.so.1
│   ├── libsweep.so.1 -> libsweep.so.1.3.0
│   └── libsweep.so.1.3.0
└── share
    └── man
        └── man1
            └── sweep-ctl.1.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant