Saleae Logic 2 Automation API

Hello!
Is it possible to connect to Logic 2 from a remote PC? By default, it seems that the automation API binds on local host IP address.
Thanks!

Hi Jacob,

Just to clarify, does the streaming need to happen while recording, or can it happen after the recording has stopped? I’m assuming the former, but I wanted to double check.

Live streaming is on our list, but we don’t have a timeline for it yet.

Yes, you can do this, but it is currently undocumented. There are 3 flags you can pass to the Logic application to control automation:

  • --automation - Enable automation
  • --automationPort - Port to use for the automation API
  • --automationHost - Interface to bind to for the automation API

So to enable automation on port 12000 on all interfaces:

Logic.exe --automation --automationHost 0.0.0.0 --automationPort 12000

We will make sure to get this in the documentation.

Hope that helps,

Ryan

It works now!
Thank you very much!

@huffman
to be useful streaming of data must happen more or less live, while recording.

thanks, jacob

Hi Ryan

Any progress on an update that will address the issue I highlighted above?

Regards,
Robert

Hi @northernboy,

Thanks for reaching out again. Yes! The latest release now builds the grpc/protobuf files using the installed versions at install time. We distribute a a source build, which on install will go through the build process and generate a .whl. The one downside is that it won’t automatically rebuild the files if you later up/downgrade protobuf and/or grpc.

This is available 1.0.5, and can be downloaded from PyPi: logic2-automation · PyPI

I’m curious to hear how this works for you,

Ryan

Hi Ryan

So I was finally able to get it to work by manually installing grpcio-tools (to match the version of grpcio we have installed) and then do a pip install logic2-automation —no-deps. If I don’t do this then a vanilla ‘pip install’ of the logic2 package wants to update the gprcio and protobuf packages which we need to be pinned to a particular version. So I think this is something we can work around by building and installing our own wheel. However, one question that is being asked by our build engineering team is if it is possible to remove the grpcio-tools as a run-time dependency and instead have them as a build-time dependency? Apparently, the grpcio-tools are only used for building the wheel and not needed after that. I’m not sure myself how you would do that i.e. what you would specify in your packaging script. So, is it possible to release another version with the dependency change? Let me know one way or another.

Regards,
Robert

Hi Robert,

If I install protobuf 3.5.0.post1 and grpcio-tools 1.13.0, and then install logic2-automation 1.0.5 (without --no-deps), it does not try to upgrade protobuf or grpcio. Are you installing logic2-automation 1.0.5? I’m surprised it’s forcing you to upgrade.

However, one question that is being asked by our build engineering team is if it is possible to remove the grpcio-tools as a run-time dependency and instead have them as a build-time dependency

I hadn’t thought about that - we could probably move this requirement underneath the build-tools spec. I will try to test this out this week and report back.

Ryan

Hi Ryan:

I think what happens in my case, is we don’t have grpcio-tools installed by default so it goes to download and install the latest copy of that, but in the process it then goes and updates grpcio itself so that the versions align. It then also tries to update protobuf but it can’t because it’s pinned to a version and thus fails the overall installation. So looks like a series of transitive dependencies causes me the problems.

Now regarding removing the run-time dependency on grpcio-tools, someone here, that knows a lot more about python packaging, played around a bit and seems to have been able to adjust the dependency as follows:
In your pyproject.toml:

  • remove the “grcpio-tools>=1.13.0” from section project, attribute dependencies
  • add
    dependencies = [
    “grpcio-tools>=1.13.0”
    ]
    to section [tool.hatch.build.targets.wheel.hooks.custom] to be used for protobuf compilation
    Now with this in place, your ‘hatch build’ builds wheels and tar.gz both without grpcio-tools dependency.

Hope you can make sense of the above
Robert

Hi Robert,

Excellent, it sounds like that should be a pretty easy update on our end. Thanks for the explanation, and coming up with a solution. I’ll test that out this week and try to get an update out. Hopefully your local solution is sufficient for the time being!

Ryan

Hi Robert,

Sorry for the delay on this one. It’s still on my list, but it’s not something I will be able to get a chance to look at until next week. I just wanted to make sure to give an update since it has been a couple weeks.

Ryan

1 Like

Hi Ryan

Funny, I was going to ping you this week to see where things were at. Thanks for the heads up.

Robert

Hi Ryan

Just following up to see if there was an update.

Robert

Hi Robert, no updates yet, but I’ll update here as soon as I have one. Thanks!

Ryan

Hi Ryan:

Any chance we can get this resolved soon?

Robert

Hi Robert,

I just tried out your suggestion over here. This appears to work as expected, but I’m not sure this satisfies your issue. Currently we only release source distributions so that the protobuf python files are generated using whatever version you already have installed. If you try to install the source distribution, it will still try to install grpcio-tools to build the package.

I still think this is an improvement, so it’s something we can release, but I’m just not sure if it is an improvement for you.

What do you think?

Ryan

Hi Ryan:

Yes, this would work for us. So let me know if you have something for me to try.

Regards,
Robert

Actually, is it possible for you to release something for me to try before officially releasing?

Hi Robert,

Sure, this source build is 1.0.5 but with the change to move the grpcio-tools dependency to the build step: logic2_automation-1.0.6…zip (15.8 KB)

Please note, the .tar.gz is inside of the zip, so you will need to extract it first. You can pip install the tar.gz directly.

Looking forward to hearing how that works for you,

Ryan