feat(daq): add Arduino Firmata DAQ driver - #117
Open
dalvarez-204 wants to merge 13 commits into
Open
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
Author
Contributor
Author
|
PWM is not implemented in this PR, but should be added later because it's a popular use case for arduinos. This DAQ implementation also relies on users knowing which analog and digital pins are available to them. |
dalvarez-204
marked this pull request as ready for review
June 17, 2026 21:16
nhschwab
reviewed
Jun 18, 2026
nhschwab
reviewed
Jun 18, 2026
nhschwab
reviewed
Jun 18, 2026
nhschwab
reviewed
Jun 18, 2026
Contributor
Author
nhschwab
reviewed
Jun 24, 2026
nhschwab
reviewed
Jun 24, 2026
nhschwab
reviewed
Jun 26, 2026
nhschwab
reviewed
Jul 9, 2026
nhschwab
reviewed
Jul 9, 2026
nhschwab
reviewed
Jul 9, 2026
nhschwab
reviewed
Jul 9, 2026
nhschwab
reviewed
Jul 9, 2026
…thod, updated docstrings
…ting sample rate adjusts HWTimingConfig
…e for Measurement
…ue race in ArduinoFirmata read_analog/read_digital_line now raise RuntimeError instead of silently returning 0 when no Firmata report has arrived yet for a channel, so a race read can't be confused with a genuine low/zero reading. The background daemon already isolates per-call exceptions, so this can't stall the data flow. _on_analog_callback now attempts the queue put first and only evicts on queue.Full, tolerating fetch_analog's drain loop concurrently emptying the queue between the full-check and the evict (which previously raised an uncaught queue.Empty on the pyfirmata2 reader thread, permanently killing sample production). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rebase conflict resolution on uv.lock kept taking main's side at each step, which dropped pyfirmata2 from the lockfile. Regenerating from pyproject.toml restores it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
_wait_for_digital's whole purpose is to poll through a transient not-ready condition, but had no exception handling. read_digital_line now raises RuntimeError instead of silently defaulting until the first Firmata report arrives, so the helper needs to retry through that too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ose() close() previously never stopped the pyfirmata2 Iterator thread (it wasn't even stored on self) and never reset _latest_values/_sample_queue/ _pending_updates. Reusing a closed driver via open() again could see a stale callback from the old reader thread land in the new session, and read_analog()/read_digital_line() could silently return leftover data from before close() instead of raising for a channel that hasn't reported yet in the new session. close() now stops and joins the iterator before tearing down the board, then clears all stream state. Channel configuration (_ai_channels, etc.) is left intact, matching normal open/close/reopen DAQ lifecycle. Documented the AI/DI alias-collision limitation (shared _latest_values dict) as a known limitation rather than fixing it in this pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
dalvarez-204
force-pushed
the
dalvarez/instro-324-driver-arduino-firmata-daq
branch
from
July 27, 2026 20:38
f54c923 to
b96d835
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Closes INSTRO-324. Fixes #49
Summary
Test plan