mmakaay / esphome-xiaomi_bslamp2

ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.
Other
219 stars 51 forks source link

cannot get dev branch to compile on arch linux #64

Closed f0rdprefect closed 3 years ago

f0rdprefect commented 3 years ago

just took the example.yaml and supplied a secrets.yaml

when I do a

esphome config example.yaml

I get

INFO Updating https://github.com/mmakaay/esphome-xiaomi_bslamp2@dev
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
  File "/usr/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome==2021.10.2', 'console_scripts', 'esphome')())
  File "/usr/lib/python3.9/site-packages/esphome/__main__.py", line 815, in main
    return run_esphome(sys.argv)
  File "/usr/lib/python3.9/site-packages/esphome/__main__.py", line 793, in run_esphome
    config = read_config(dict(args.substitution) if args.substitution else {})
  File "/usr/lib/python3.9/site-packages/esphome/config.py", line 974, in read_config
    res = load_config(command_line_substitutions)
  File "/usr/lib/python3.9/site-packages/esphome/config.py", line 829, in load_config
    return _load_config(command_line_substitutions)
  File "/usr/lib/python3.9/site-packages/esphome/config.py", line 817, in _load_config
    result = validate_config(config, command_line_substitutions)
  File "/usr/lib/python3.9/site-packages/esphome/config.py", line 674, in validate_config
    result[CONF_SUBSTITUTIONS] = {
TypeError: 'NoneType' object is not a mapping

not sure who is to blame. However I successfully compiled a new project created with esphome wizard to confirm my installation is working in principle. Any idea what to check or try? Thanks for this awesome project!

mmakaay commented 3 years ago

I can reproduce the issue here, so looking into it now.

mmakaay commented 3 years ago

Found it already. The substitutions: component doesn't like being in the config file on its own. When you provide one or more keys, or comment out the substitutions: line, then it will work.

I will update my example yaml to not have this error, and I will check if an improvement can be made for ESPHome on this.

mmakaay commented 3 years ago

I updated the example.yaml file in the dev and release/2021.10.0 branches. As a quick fix, I included the name and friendly_name keys by default, so an unmodified compile from the example.yaml will now work.

Thanks for the issue report, @f0rdprefect

f0rdprefect commented 3 years ago

Yes, I can confirm this helps. However looks like something is still missing:

***** [.pioenvs/bedside-lamp/.pioenvs/bedside-lamp/x509_crt_bundle.o] Source `.pioenvs/bedside-lamp/x509_crt_bundle.S' not found, needed by target `.pioenvs/bedside-lamp/.pioenvs/bedside-lamp/x509_crt_bundle.o'.
**

Will double check the release branch now! Thanks for the prompt response @mmakaay

f0rdprefect commented 3 years ago

Same error.

Generating assembly for certificate bundle...
CMake Error at /home/matt/.platformio/packages/framework-espidf/tools/cmake/scripts/data_file_embed_asm.cmake:26 (file):
  file failed to open for reading (No such file or directory):

    /home/matt/src/esphome/bslamp-guest/bedside-lamp/.pioenvs/bedside-lamp/x509_crt_bundle

even tried to update platformio and clean the cache. platformio is no version 5.2.2 ...

mmakaay commented 3 years ago

I compiled the firmware using an unmodified example.yaml file. That worked, without the error that you saw. I do see the file .pioenvs/bedside-lamp/x509_crt_bundle.S in the build output.

Can you try a clean build? I don't think that should matter in this case, but I have seen some strange compile issues with ESP-IDF that were resolved by a clean build.

f0rdprefect commented 3 years ago

clean build does not solve this. I believe this will haunt us some more time. See https://github.com/espressif/esp-idf/issues/7631#issuecomment-934212224 for details. Anyhow the initial issue is solved and I will look into how to apply the workaround...

And this is the workaround (for now...) https://github.com/espressif/esp-idf/issues/7621#issuecomment-950135638 at least for the command line

Thanks again!

mmakaay commented 3 years ago

Great! Thanks for sharing the pointer to the work-around. I hope to never need it :-)