GithubHelp home page GithubHelp logo

Comments (11)

xbmcnut avatar xbmcnut commented on August 18, 2024 1

Thanks @bendikwa Got it working with Python3 as you've indicated. Seems there was a post on the HA forums I missed that I copied and that worked. Key changes are were no dedicated /config folder and locate the igrill folder under the /home/pi.

In regards the docs, just check each of the example files in the master and releases folders to ensure consistency.

FYI, I've got my Google Home in the kitchen announcing when the thermometer comes online and offline so we know it's working. Thanks for the integration! Working a treat now.

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

N.B All of my pip modules are installed using pip3. Is that going to work or do I need to reinstall pip versions?

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

OK, making some progress.
Ran python3 ./monitor.py -c config and now I get:


pi@raspberrypi-ble:/home/igrill $ python3 ./monitor.py -c config
2020-05-06 23:48:59,808 MainThread INFO: log_level set to: INFO
2020-05-06 23:48:59,997 MainThread ERROR: Config validation failed: Value of optional entry 'port' must be <class 'int'>, was <class 'str'>
2020-05-06 23:49:00,000 MainThread ERROR: Config validation failed: Value of optional entry 'keepalive' must be <class 'int'>, was <class 'str'>
Traceback (most recent call last):
  File "./monitor.py", line 58, in <module>
    main()
  File "./monitor.py", line 34, in main
    raise ValueError("Config found in directory {0} is not valid".format(options.config_directory))
ValueError: Config found in directory config is not valid
devices:
  - name:       'grill'                  # Unique name of the device
    type:       'igrill_mini'              # Supported devices: igrill_mini, igrill_v2, igrill_v3
    address:    'D4:81:CA:01:E7:B5'      # The MAC of the device
    topic:      'temperature'    # The topic to publish on. will have name and probe number appended: <topic>/<name>/probe{1..4}
    interval:   20  
#MQTT All values default to paho.mqtt.client defaults
mqtt:
  host:       '10.0.1.100'                   # Optional default 'localhost'
  port:       '1883'                                 # Optional default '1883'
  keepalive:  '60'                                   # Optional default '60'

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

OK, changed external mqtt host to mqtt:10.0.1.100 and commented out the port and keepalive and now this:

pi@raspberrypi-ble:/home/igrill $ python3 ./monitor.py -c config
2020-05-06 23:56:11,636 MainThread INFO: log_level set to: INFO
Traceback (most recent call last):
  File "./monitor.py", line 58, in <module>
    main()
  File "./monitor.py", line 39, in main
    devices = get_device_threads(config.get_config('devices'), config.get_config('mqtt'), run_event)
  File "/home/igrill/utils.py", line 131, in get_device_threads
    enumerate(device_config)]
  File "/home/igrill/utils.py", line 130, in <listcomp>
    return [DeviceThread(ind, mqtt_config, run_event, **d) for ind, d in
  File "/home/igrill/igrill.py", line 201, in __init__
    self.mqtt_client = utils.mqtt_init(mqtt_config)
  File "/home/igrill/utils.py", line 97, in mqtt_init
    mqtt_client.connect(**strip_config(mqtt_config, ['host', 'port', 'keepalive']))
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 937, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1071, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
    return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
  File "/usr/lib/python3.5/socket.py", line 694, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Stumped for now. For what's its worth, I can see and pair with my iGrill mini using sudo bluetoothctl no problem.

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

Whew...nutted it. There seems to be document inconstancies that cause much confusion. It is now working with the following MQTT config and the latest files pulled from the releases page.

#MQTT All values default to paho.mqtt.client defaults
mqtt:
  host:       '10.0.1.100'                   # Optional default 'localhost'
  port:       1883                                # Optional default '1883'
  keepalive:  60    

So there are no quotes around the port or keepalive and mqtt does not need to be appended to the host ip (at least in my case).

from igrill.

bendikwa avatar bendikwa commented on August 18, 2024

I am glad that you got it to work! 👍

Where did it say that you needed "mqtt" appended to the host IP?

-Bendik

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

Thanks for the reply. This # host: 'mqtt.example.com' is in the zip download for the master which confused me along with some chatter about that in the issues or forums somewhere. As I had to use mqtt appended to a host with magicmirror years ago, it threw me for a bit. I've posted a full walk-through on the HA forums. https://community.home-assistant.io/t/weber-igrill-2-integration-with-lovelace-ui/61880/129

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

Oooh, a question then. For the service file, would I need to amend ExecStart=/usr/bin/python to be ExecStart=/usr/bin/python3?

from igrill.

xbmcnut avatar xbmcnut commented on August 18, 2024

Having issues with the service file now. So if I run the script manualy it works but after a reboot, it's not starting.

pi@raspberrypi-ble:~ $ systemctl daemon-reload && systemctl enable igrill && systemctl start igrill
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: root
Password: Failed to reload daemon: Method call timed out

If I run sudo su then run the command again it works but when I exit back to the pi user and run systemctl is-active igrill, it alternates from activating to active and back to activating again. How do I debug that?

from igrill.

bendikwa avatar bendikwa commented on August 18, 2024

As you have probably figured out, you need to reference the python executable that you want the program to be run with. in your case it is ExecStart=/usr/bin/python3

I use sudo/root for all commands regarding systemd (like systemctl)
Is the actual igrill script restarting all the time, or is it just the output of systemctl is-active igrill that is alternating.

In the thread you keep mentioning that you encountered inconsistencies in the guide/docs, please help me by pointing these out, so others don't have to struggle. :-)

from igrill.

bendikwa avatar bendikwa commented on August 18, 2024

Happy to hear that you got it working. I'll soon do another release, so any example config will be updated.
Thanks for the feedback.

-Bendik

from igrill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.