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

need json config file , but cannot find this from source code. #32

Closed
5high opened this issue Sep 29, 2020 · 7 comments
Closed

need json config file , but cannot find this from source code. #32

5high opened this issue Sep 29, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@5high
Copy link

5high commented Sep 29, 2020

Describe the bug
I am follow script directly running guide

Running script directly on your host system (if your platform is not listed/supported):
Note: Python 3.6 or higher is required to run the script manually

Install python requirements (pip3 install -r requirements.txt)
Open wrapper.sh and configure your environment variables to suit your setup.
Add a cron-tab entry to wrapper like so:
@reboot bash /path/to/wrapper.sh
NOTE: Although once started the script runs continuously, it may take a few seconds for the data to be retrieved, computed and sent via mqtt.

To Reproduce
Steps to reproduce the behaviour, including error message if any.

Expected behaviour

run the shell show me error , cannot find json file ,but I can't find out sample json file.

-------------------------------------
2020-09-29 21:48:20 - Starting Xiaomi mi Scale...
2020-09-29 21:48:20 - Loading Config From OS Environment...
Traceback (most recent call last):
  File "/root/xiaomi_mi_scale/src/Xiaomi_Scale.py", line 28, in 
    with open('/data/options.json') as json_file:
FileNotFoundError: [Errno 2] No such file or directory: '/data/options.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/xiaomi_mi_scale/src/Xiaomi_Scale.py", line 165, in 
    if MQTT_DISCOVERY.lower() in ['true', '1', 'y', 'yes']:
AttributeError: 'bool' object has no attribute 'lower'

Screenshots
If applicable, add screenshots to help explain your problem.

Scale (please complete the following information):

  • Name
  • Model #

Desktop/Server (please complete the following information):

  • manually ran after a Git Clone , running on aarch64.

Additional context
Add any other context about the problem here.

@5high 5high added the bug Something isn't working label Sep 29, 2020
@lolouk44
Copy link
Owner

Please provide the details requested in the issue form if you need help
Also confirm which version of the container you're using

@5high
Copy link
Author

5high commented Sep 30, 2020

Thank you for your reply , I am edited issue content.

@lolouk44
Copy link
Owner

What type of computer are you running the script on please?
Which version of Python3 do you have installed?

@5high
Copy link
Author

5high commented Oct 7, 2020

I am using ArmBian aarch64
Python3.7.3

@lolouk44
Copy link
Owner

lolouk44 commented Oct 7, 2020

I don't understand why this fails for you, unless you're using an old version of the code?
Can you try and delete the local copy and re-clone / re-pull the repo?

@Proxx
Copy link

Proxx commented Oct 21, 2020

the problem is using the docker-compose example.

comment out the empty values

#    - MQTT_USERNAME=                # Username for MQTT server (comment out if not required)
#    - MQTT_PASSWORD=                # Password for MQTT (comment out if not required)
#    - MQTT_PORT=                    # Defaults to 1883

#    - MQTT_DISCOVERY_PREFIX=        # Home Assistant Discovery Prefix, defaults to homeassistant

at least that solved my problems

@lolouk44
Copy link
Owner

Thanks for the update.
Indeed values need to be provided in docker-compose environment variables if they are listed. If you do not need these, you need to comment them out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants