question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

__init__() takes 2 positional arguments but 3 were given

See original GitHub issue

I’ve just tried installing on a RPi 3B+ running Ubuntu Server 18.04.3 from here. Following the instructions for installation of bt-mqtt-gateway, I encounter the issue shown below:

(.venv) ubuntu@ubuntu:~/bt-mqtt-gateway$ sudo ./gateway.py -d 2019-10-16 10:27:29,252 INFO bt-mqtt-gw gateway.py:61:<module> - Starting 2019-10-16 10:27:29,254 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:init - Setting LWT to: lwt_topic 2019-10-16 10:27:29,592 INFO bt-mqtt-gw.workers.miflora miflora.py:23:_setup - Adding 11 miflora devices 2019-10-16 10:27:29,592 DEBUG bt-mqtt-gw.workers.miflora miflora.py:25:_setup - Adding miflora device ‘rosemary’ (C4:7C:8D:66:2F:D0) Traceback (most recent call last): File “./gateway.py”, line 67, in <module> manager.register_workers(global_topic_prefix).start(mqtt) File “/home/ubuntu/bt-mqtt-gateway/workers_manager.py”, line 88, in register_workers command_timeout, global_topic_prefix, **worker_config[“args”] File “/home/ubuntu/bt-mqtt-gateway/workers/base.py”, line 7, in init self._setup() File “/home/ubuntu/bt-mqtt-gateway/workers/miflora.py”, line 28, in _setup “poller”: MiFloraPoller(mac, BluepyBackend), File “/usr/local/lib/python3.6/dist-packages/miflora/miflora_poller.py”, line 37, in init self._bt_interface = BluetoothInterface(backend, adapter) TypeError: init() takes 2 positional arguments but 3 were given

My config is the same as what I had running and working on an Intel NUC running Ubuntu server, so it shouldn’t be an issue with my config:

mqtt:
  host: 192.168.1.135
  port: 1883
  username: username
  password: password
  #ca_cert: /etc/ssl/certs/ca-certificates.crt # Uncomment to enable MQTT TLS, update path to appropriate location.
  #ca_verify: False              # Verify TLS certificate chain and host, disable for testing with self-signed certi$
  #topic_prefix: homeassistant         # All messages will have that prefix added, remove if you dont need this.
  client_id: bt-mqtt-gateway
  availability_topic: lwt_topic

manager:
  sensor_config:
    topic: homeassistant
    retain: true
  topic_subscription:
    update_all:
      topic: homeassistant/status
      payload: online
  command_timeout: 35           # Timeout for worker operations. Can be removed if the default of 35 seconds is suff$
  workers:
    miflora:
     args:
       devices:
         rosemary: C4:7C:8D:66:2F:D0
         oregano: C4:7C:8D:66:35:6B
         mint: C4:7C:8D:66:2E:97
         thyme: C4:7C:8D:6A:15:29
         curry: C4:7C:8D:6A:A3:B3
         perennial_basil: C4:7C:8D:66:2D:79
         sweet_basil_and_habanero_orange_chilli: C4:7C:8D:66:36:D2
         asian_siam_yellow_chilli: C4:7C:8D:6A:09:2D
         tabasco_red_chilli: C4:7C:8D:6A:05:27
         garlic_chives: C4:7C:8D:6B:26:75
         happy_plant: C4:7C:8D:6A:8E:0E
       topic_prefix: miflora
     update_interval: 60

Not sure what has gone wrong, please help!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
zewelorcommented, Oct 18, 2019

I’ve pushed fixes with fixed btlewrap version

1reaction
dckiller51commented, Oct 18, 2019

Hello,

Problem maj miflora 0.5. Thé cause = btlewrap == 0.0.8. https://github.com/zewelor/bt-mqtt-gateway/issues/109

the problem after rebooting the new version (btlewrap) is reinstalled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - __init__() takes 2 positional arguments but 3 were ...
Try specifying that you're overriding a default parameter: rfe = RFE(logreg, step = 20).
Read more >
How to solve the error? ' __init__() takes 2 positional ...
I have an assignment to create a regression model for a given datasets. ... __init__() takes 2 positional arguments but 3 were given'....
Read more >
Python - TypeError: takes 2 positional arguments but 3 were ...
Python - TypeError: takes 2 positional arguments but 3 were given. Hi I am struggling with a problem in my python code.
Read more >
[CT-672] _relations_cache_for_schemas() takes 2 positional ...
First time install of DBT (dbt-postgres) on Ubuntu. dbt init ... takes 2 positional arguments but 3 were given Log files don't seem...
Read more >
python - __init__() takes 1 positional argument but 4 were ...
As the error mentions, you are passing multiple positional arguments whereas the __init__ method of StandardScaler only takes in one.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found