# \[Python API\] Device Calibration

**URL:** https://discuss.saleae.com/t/python-api-device-calibration/1927
**Category:** Support
**Created:** [November 17, 2022, 7:23pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927 "2022-11-17T19:23:49Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![itay.work94](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@itay.work94](https://discuss.saleae.com/u/itay.work94)
#### Post date: [November 17, 2022, 7:23pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/1 "2022-11-17T19:23:50Z")

</div>

Its me again (🙂  
Quick question about device calibration via Automation (using Python API),  
is there a way for detecting whether the connected device is calibrated ?  
and if not to calibrate it ?

---

<div class="post-metadata">

### Author: ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)
#### Post date: [November 18, 2022, 11:46pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/2 "2022-11-18T23:46:30Z")

</div>

@itay.work94 Thanks for bringing this up. This is unfortunately not possible via the Automation API, though I agree we should certainly get this added.  
[https://saleae.github.io/logic2-automation/automation.html](https://saleae.github.io/logic2-automation/automation.html)

Similar to my comment on your other post for renaming channels, you’ll have to manually check if the particular device calibration file has been loaded on the particular PC it’s being used on (instructions in the link below for reference). Normally, this happens automatically (otherwise, an error pop up will appear, typically caused by network issues), and once the calibration file has been downloaded once on a PC for a particular device, it won’t need to be downloaded again.

> **[Device Calibration](https://support.saleae.com/user-guide/device-calibration)**

---

<div class="post-metadata">

### Author: ![markgarrison](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/markgarrison/32/23_2.png) [@markgarrison](https://discuss.saleae.com/u/markgarrison)
#### Post date: [December 2, 2022, 9:18pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/3 "2022-12-02T21:18:07Z")

</div>

I’ve just added this to our feedback list for the next automation update, thanks for asking about it!

In the meantime, one somewhat hacky solution would be to check the calibration folder for a calibration file that matches the device ID in use.

The location of the calibration folder is mentioned in the link Tim shared above.

The files The first part of the file name is the device ID, in base 10. You could check that folder for a file starting with the device ID before allowing a capture to take place.

If this is a new device, calibration download will start the moment the software detects the new device. You could poll the folder with a timeout until the file is detected.

Sorry for the trouble with this!

---

<div class="post-metadata">

### Author: ![loic.murith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/loic.murith/32/1953_2.png) [@loic.murith](https://discuss.saleae.com/u/loic.murith)
#### Post date: [March 5, 2025, 3:38pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/4 "2025-03-05T15:38:22Z")

</div>

Hi Mark,  
I’ve seen in the documentation ([Errors — Saleae 1.0.6 documentation](https://saleae.github.io/logic2-automation/errors.html?highlight=calibration)) as well as in the comment of the “connect” method of the python package “logic2\_automation” that we should get an exception in case the SALEAE is not calibrated but I never managed to get such exception.  
To do so I’ve used the latest version of the tools I could find:  
Logic2 V2.4.22  
Logic2\_automation V1.0.7

Do you know if the feature mentioned in this ticket is already available?

If you need more details, I’ll be happy to answer you.  
Kind regards, Loïc

---

<div class="post-metadata">

### Author: ![markgarrison](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/markgarrison/32/23_2.png) [@markgarrison](https://discuss.saleae.com/u/markgarrison)
#### Post date: [April 17, 2025, 8:44pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/5 "2025-04-17T20:44:36Z")

</div>

Thanks for checking in on this, and sorry we didn’t fix it sooner!

I’ve just made a change internally, the capture command will now fail with that error if the device’s calibration data is not available.

The automation API (and the Logic 2 software) already blocks captures until the calibration data has been loaded (or was not found). This change just covers the case where if you have a machine that is offline, and has always been offline while the Logic analyzer was in use, the calibration may never have been downloaded. This also happens when behind some company firewalls, if traffic to our servers is blocked.

This is not in 2.4.27, which shipped about an hour before I worked on this, but it will be in the next release.

Thanks!

- Mark

---

<div class="post-metadata">

### Author: ![loic.murith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/loic.murith/32/1953_2.png) [@loic.murith](https://discuss.saleae.com/u/loic.murith)
#### Post date: [April 22, 2025, 6:51am UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/6 "2025-04-22T06:51:52Z")

</div>

Hi Mark,  
Thank you very much for your feed-back and fix coming. I think that I am exactly in the situation you describe as the computer I’m using is on an internal network that has no access to the external network.

With my kindest regards,  
Loïc

---

<div class="post-metadata">

### Author: ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)
#### Post date: [May 5, 2025, 8:35pm UTC](https://discuss.saleae.com/t/python-api-device-calibration/1927/7 "2025-05-05T20:35:59Z")

</div>

@loic.murith The update which should fix this is now available! (v2.4.29)

> **[Download Logic 2 Software](https://www.saleae.com/pages/downloads)**
>
> Download Logic 2 Software for advanced logic analysis with Saleae Logic Analyzers. Enhance your debugging and data analysis with user-friendly features, real-time updates, and extensive protocol support. Compatible with Windows, macOS, and Linux.
