Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

device.id not copied correctly from mos.yml. Don't know where to complain

I was just re-building my sources and found that the device.id setting in the con0.json file is no longer copied correctly from my mos.yml file.

I can see that the device.id setting is copied all the way into the build/gen/mos_final.yml file, but whoever sets the device.id in conf0.json ignores my setting and leaves the default value of "cc3220_XXXXXX" instead.

I don't know if this is a new bug in the mos tool or somewhere in mongoose-os.

Comments

  • Can't reproduce on ESP32

     - ["device.id", "my_device_id"]
    

    mos get conf0.json | grep device returns

     "device": {
      "id": "my_device_id",
    

    and mos config-get device.id returns

    config-get device.id
    

    cat build/gen/mgos_config_defaults.json | grep device

     "device": {
      "id": "my_device_id",
    

    empty built for cc3220:

    cat build/gen/mgos_config_defaults.json | grep device
     "device": {
      "id": "my_device_id"
    
    cd build
    unzip fw.zip
    cd empty-demo-1.0/
     strings spiffs.img |grep device
    # *.azure-devices.de use this root.
     "device": {
      "id": "my_device_id"
    

    Looks like the device id is the one set in mos.yml

     - ["device.id", "my_device_id"]
    
  • ulsoulso Stockholm

    Weird.

    I just re-built again. Got the following:

    In file build/gen/mos_config_defaults.json:

    {
     "device": {
      "id": "cc3220_??????"
     },
    

    In build/gen/mos_final.yml:

    - - device.id
      - s
      - ssd_??????
      - title: Device id
    

    In my ´mos.yml` file I have:

      - ["device.id", "s", "ssd_??????", {title: "Device id"}]
    

    The command mos help gives:

    The Mongoose OS command line tool 201902252335.
    Update channel: "latest". Checking updates... Up to date.
    

    My build command looks like this:

    mos build --local --platform cc3220 --repo ../mongoose-os --clean --verbose --gh-token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
  • ulsoulso Stockholm

    All my other settings from the mos.yml file seems to get into conf0.json though. It's only the device.id that fails to be copied.

  • ulsoulso Stockholm

    I get the same issue when building for esp32. My setting of device.id to ssd_?????? doesn't stick. It's still esp32_??????.

  • Set it like this
    - ["device.id", "ssd_??????"]
    and rebuild.

  • ulsoulso Stockholm

    That didn't work for me. Got the following error:

    device.id references a non-existent entry ssd_??????
    make: *** [/Users/ulf/Documents/Projects/mongoose/psgwng/build/gen/mgos_config.c] Error 1
    make: *** Waiting for unfinished jobs....
    /mongoose-os/fw/src/mgos_config.mk:14: recipe for target '/Users/ulf/Documents/Projects/mongoose/psgwng/build/gen/mgos_config.c' failed
    make: Leaving directory '/app'
    Error: exit status 2
    
  • Strange. It looks like there is something wrong with your repo.
    Try the following:

    rm -rf build deps
    mos build --local --platform cc3220  --clean --verbose --gh-token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
  • ulsoulso Stockholm

    Just to be sure everything was clean, I did remove both the build and the deps directories. Forgot to mention that.

    My repo is the latest available from github. I haven't changed anything in my sources. Just wanted to try the latest versions of both the mongoose-os and mos tool.

    Do you know where in the build process that the mos.yml settings are taken into account and copied into the conf0.json file?

  • I'm also on mos latest and the build is ok for me.
    Run git log in the repo directory.
    The first entry should be

    commit 3e97fe76f2b6e5e94fb4e22df7324fbf235da4fc
    Author: Deomid Ryabkov <rojer@cesanta.com>
    Date:   Tue Feb 26 17:00:28 2019 +0000
    
        Add addr to STM32 manifest
    
        CL: none
    
        PUBLISHED_FROM=b4f4167b04de06c23a83127b90b82a3a017d4f8e
    
  • ulsoulso Stockholm

    Yep. That's what I get when I do git log.

  • Try to build the empty application with mos build --local --platform cc3220 with

    config_schema:
     - ["device.id", "ssd_??????"]
    

    BTW, if I build with

    config_schema:
     - ["device.id", "s", "ssd_??????", {title: "Device id"}]
    

    mgos_config_defaults.json and conf0.json contain

     "device": {
      "id": "cc3220_??????"
     },
    

    but with

    config_schema:
     - ["device.id", "ssd_??????"]
    

    they contain

     "device": {
      "id": "ssd_??????"
    
    Thanked by 1ulso
  • ulsoulso Stockholm

    Now it works. Thank you very much for the help!

    Something must have changed, in how the build is performed, since I hadn't changed my sources at all. Also, my other settings that use the same syntax when setting a string, still works. Maybe not for long ;)

  • What did you do to make it work?

  • ulsoulso Stockholm

    When I first changed the following line in mos.yml

    - ["device.id", "s", "ssd_??????", {title: "Device id"}]
    

    I changed it to this

    - ["device.id", "ssd_??????", {title: "Device id"}]
    

    which obviously was wrong. It wasn't until I changed it to this

    - ["device.id", "ssd_??????"]
    

    that it finally worked.

  • Ok, I see :)

Sign In or Register to comment.