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

Local override for mos.yml #28

Open
Harvie opened this issue Nov 28, 2019 · 3 comments
Open

Local override for mos.yml #28

Harvie opened this issue Nov 28, 2019 · 3 comments

Comments

@Harvie
Copy link

Harvie commented Nov 28, 2019

We have mos.yml in our repository, where multiple developers collaborate.
I have some changes that i want to store and apply only on my development setup. I think it would be nice to have something like mos.local.yml which i would be able to put in .gitignore and it would eventualy override any upstream settings from mos.yml. So i can still pull latest mos.yml from git without having to worry that my local changes will be overwriten by upstream or commited to repository.

@rojer
Copy link
Contributor

rojer commented Nov 28, 2019

you can use mos_PLATFORM.yml for that, e.g. mos_esp32.yml, etc.

out of curiosity, what's different in your mos.yml? what are you overriding?

@Harvie
Copy link
Author

Harvie commented Nov 29, 2019

out of curiosity, what's different in your mos.yml? what are you overriding?

wifi credentials and azure cloud pairing keys. so when i flash the device with new development firmware i don't have to go throught the pairing process each time and it gets connected right away. while the clean repository will build firmware that is not paired to particular wifi network and azure account, so the end user will be able to pair it.

@rojer
Copy link
Contributor

rojer commented Nov 29, 2019

so you're overriding config values, correct?
in that case, better way to do it (and one i use daily) is to use confX.json.
i use conf5.json which i put in the fs directory and where it gets picked up by the firmware build (assuming it's listed in the "filesystem" section in mos.yml), and i put my overrides there.
the file is not checked in. here's an example of fs/conf5.json from one of my projects:

{
  "device": {
    "Xmac": "88:da:1a:11:11:11"
  },
  "bt": {
    "keep_enabled": true
  },
  "wifi": {
    "ap": {
      "enable": false,
      "ssid": "Mongoose_000000",
      "pass": "Mongoose"
    },
    "Xsta": {
      "enable": true,
      "ssid": "Cesanta",
      "pass": "XXXX"
    },
    "Xsta": {
      "enable": true,
      "ssid": "zLocal",
      "pass": "XXX"
    },
    "sta": {
      "enable": true,
      "ssid": "Over_9000_Internets",
      "pass": "XXX"
    },
    "sta_connect_timeout": 10
  },
  "debug": {
    "Xlevel": 3,
    "Xmbedtls_level": 4,
    "udp_log_addr": "192.168.11.30:1234",
    "udp_log_level": 4,
    "Xfile_level": "mg_mqtt=3,mg_net=3,mg_lwip_net_if.c:175=4,mg_lwip_net_if.c:528=4"
  }
}

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

No branches or pull requests

2 participants