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

Check the Modem Address on Startup #303

Merged
merged 11 commits into from
Jan 5, 2021
Merged

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Jan 5, 2021

This will check the modem address on startup:
If no address is specified in the config file:

  1. It will use the address obtained from the modem; OR
  2. Fail and exit if no address is obtained.

If an address is specified in config:

  1. If the returned address is the same, nothing
  2. If the returned address is different, an error is reported,
    and things will continue using the address in the config.

Closes #266

  • Works in testing
  • Cleanup code documentation
  • Change config.yaml
  • Unit Tests

This will check the modem address on startup:
If no address is specified in the config file:
1. It will use the address obtained from the modem; OR
2. Fail and exit if no address is obtained.

If an address is specified in config:
1. If the returned address is the same, nothing
2. If the returned address is different, an error is reported,
   and things will continue using the address in the config.
@krkeegan
Copy link
Collaborator Author

krkeegan commented Jan 5, 2021

I also added the get_model functionality to the modem since we get that information with the address request anyways.

It could be useful for debugging or maybe something in the future.

@krkeegan krkeegan linked an issue Jan 5, 2021 that may be closed by this pull request
@krkeegan krkeegan merged commit 1f9aa4a into TD22057:dev Jan 5, 2021
@krkeegan krkeegan deleted the Get_Modem_Addr branch January 5, 2021 23:51
@jonsmirl
Copy link

jonsmirl commented Jan 5, 2021

I don't know about this one...

If the returned address is different, an error is reported,
and things will continue using the address in the config.

I messed up my entire house network by having the sample modem address uncommented in the config and of course that didn't match my actual modem address. I had to repair every device again using the correct modem address. I would suggest exiting if they disagree with a message telling the user to fix it.

What would be a use case for wanting to use an address that didn't match your actual modem?

@krkeegan
Copy link
Collaborator Author

krkeegan commented Jan 6, 2021

I am worried about messing up current installations that use the address configuration. The sample config file has been changed so that the default address is not enabled anymore.

@jonsmirl
Copy link

jonsmirl commented Jan 6, 2021

But why would you want it not to match the actual modem? If you write the links in with the wrong modem address like I did, nothing works.

Every LED on my switches was blinking red.

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.

Query PLM for its Address Rather than set in Config
2 participants