Joulescope with claude

I’ve been doing some stress testing with joulescope using claude. (I also use a saleae). In my current work I’m using the stm32U375 which has some nice low power stop,standby, shutdown states, but entry to these states can fail for a variety of difficult to diagnose reasons (the stm documentation is especially poor on what prevents entry to low power states). So claude can build, download new firmware, test, and attempt to diagnose issues. Power measurement is an important part of this cycle because it can identify situations where low power states were not reached.

One joulescope api issue that has emerged is that there are situations where joulescope disconnects the current path and hence removes power from the board under test. Claude seems to mostly work around this, but it’s important to take care in cycling through stress tests. It would be helpful if the api explicitly called this out for AI agents.

Just a follow up. In the end resolving the power issue required a custom python server (thank you claude) that connects through the joulescope api and listens for unix socket connections. This configures the hardware once so hangups are less of an issue. It’s a pretty sparse server so I won’t post the code. The published mcp currently only works with pre-js320 joulescopes (pull request made), but wouldn’t solve my issue anyway because all my stress tests are through shell scripts

Great that you found a solution!

I think that you are looking for the open(mode="resume") option? Without any arguments, mode is defaults, which restores the Joulescope to default operation, meaning the the current range is off. If you pass resume, then the host syncs with whatever settings are on the device.

Is this a better solution for your use case?

Actually probably not, rather than pounding on USB connection, the server holds the connection open and takes measurements when asked. Both a simple use case and an optimization for that case.

Hi @geoffrey - Great to hear that you are happy with your client/server solution.

If you were to use multiple scripts, open(mode="resume") is our recommendation.

We also have pyjoulescope_server. I haven’t looked at this in a while, but it should still work. No reason to switch over if you are happy with your client/server solution.