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

Feature/channel settings #68

Merged
merged 16 commits into from
Oct 2, 2020
Merged

Feature/channel settings #68

merged 16 commits into from
Oct 2, 2020

Conversation

ryan-summers
Copy link
Member

@ryan-summers ryan-summers commented Oct 2, 2020

This PR adds in support for persistent channel configuration settings.

This PR fixes #11

I have also added a TXT file containing the EEPROM contents of one of the RF modules for future reference.

The present channel configuration may be persisted to channel EEPROM using the booster utility script: python booster.py <CH> --save.

The channel configuration is composed of:

  • Boolean indicating whether or not channel is enabled by default
  • Linear transforms for output/input/reflected power (not yet configurable)
  • Channel bias voltage
  • Reflected + Output interlock threshold

Power measurement calibration is deferred to #69

Testing:

  1. An RF channel was installed in channel 0 and the existing EEPROM contents were dumped to the TXT file in this PR.
  2. The channel was configured with thresholds of 10dBm and 20dBm, the bias voltage was tuned (1.14V, 50mA), and the channel was enabled
  3. Channel settings were persisted to nvm using python booster.py 0 --save
  4. Booster was reset over the USB terminal
  5. Upon boot, it was confirmed that the channel remained enabled, the bias was set, and the thresholds were configured by observing the MQTT telemetry reports.

src/rf_channel.rs Outdated Show resolved Hide resolved
.expect("Failed to configure RF bias voltage");

self.pins.signal_on.set_high().unwrap();

self.settings.data.enabled = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change the boot-up configuration here. The enable-on-boot setting should be separate from the enable/disable commands and the latter should not touch that setting. The setting should be (separately) configurable (like the thresholds and transforms).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I think this is already implemented by the save_config semantics, right? Then scratch it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct - settings are only updated in NVM when explicitly requeested to save over the MQTT control interface.

Right now, the settings are loaded from NVM and propagated to the channel. Then, the settings mirror the current state of the channel so they can be persisted to nvm immediately upon receipt of the save command - they are not otherwise persisted.

src/rf_channel.rs Show resolved Hide resolved
src/rf_channel.rs Outdated Show resolved Hide resolved
src/settings/global_settings.rs Outdated Show resolved Hide resolved
@ryan-summers ryan-summers requested a review from jordens October 2, 2020 17:41
@ryan-summers ryan-summers merged commit 4c17834 into develop Oct 2, 2020
@ryan-summers ryan-summers deleted the feature/channel-settings branch October 2, 2020 17:49
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

Successfully merging this pull request may close these issues.

Store configuration settings to non-volatile memory
2 participants