Nekmo / amazon-dash

Hack your Amazon Dash to run what you want.
MIT License
816 stars 69 forks source link

"Unable to init server: Could not connect: Connection refused" Issue #146

Closed elwoodjd closed 2 years ago

elwoodjd commented 4 years ago

What is the purpose of your issue?

Description

I am just trying to get the service to actually see the button press. I have installed everything on a fresh rasperry pi running the latest raspian OS; I am using the latest master release of amazon dash. I also installed tcpdump as per the installation instruction. I installed everything without errors. When I run the discovery command, it gives me the MAC address (which I independently verified via WireShark).

However, when I execute it to run the daemon, nothing readily happens. When I run the status command, I get the below

pi@raspberrypi:/etc $ sudo systemctl start amazon-dash pi@raspberrypi:/etc $ sudo systemctl status amazon-dash ● amazon-dash.service - Amazon Dash service Loaded: loaded (/usr/lib/systemd/system/amazon-dash.service; disabled; vendor preset: enabled) Active: active (running) since Fri 2019-09-27 16:04:43 EDT; 7s ago Main PID: 1577 (amazon-dash) Tasks: 1 (limit: 2200) Memory: 38.9M CGroup: /system.slice/amazon-dash.service └─1577 /usr/bin/python3 /usr/local/bin/amazon-dash run --config /etc/amazon-dash.yml

Sep 27 16:04:43 raspberrypi systemd[1]: Started Amazon Dash service. Sep 27 16:04:43 raspberrypi env[1577]: Welcome to Amazon-dash v1.3.3 using Python 3.7.3 Sep 27 16:04:44 raspberrypi env[1577]: Listening for events. Amazon-dash will execute the events associated with the registered buttons. Sep 27 16:04:49 raspberrypi env[1577]: Unable to init server: Could not connect: Connection refused Sep 27 16:04:49 raspberrypi env[1577]: Unable to init server: Could not connect: Connection refused Sep 27 16:04:49 raspberrypi amazon-dash[1577]: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed Sep 27 16:04:49 raspberrypi amazon-dash[1577]: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

If I attempt to test the MAC address manually with the test device command, it gives the expected success response and says its triggering the event (in my case, an IFTTT command). But IFTTT never receives any signal.

My best guess is that amazon-dash is not connecting the server properly when the daemon runs, and thus isn't seeing the real button press traffic or able to send the IFTTT command out when I test-fire the device through the command line. But, then why does the discovery command work?

I'm a novice to the world of Pi and modern coding in general, but I understand the basics and coded when I was younger, use the terminal on OSX frequently for trivial things, so I feel like with the right direction I should be able to solve this.

Thank you in advance for any help you might be able to provide.

Nekmo commented 4 years ago

These are GTK errors. It's weird, because there are no graphic components in Amazon-dash. Try running amazon-dash in manual mode.

Also paste your configuration file.

elwoodjd commented 4 years ago

Hi thanks so much for getting back to me. I have posted the config file at the bottom. It's didn't delete much just tried to activate what I needed, so I could refer to it later for future tinkering with other services.

As for manual mode, could you provide me a little more instruction? Sorry. I tried to google how to use manual mode in linux/debian systems but what I found sounded just complicated enough I wanted to confirm what to do before making tweaks that would be more difficult to troubleshoot later if I did it wrong.

Sorry, I don't know how to post code without it looking crazy...have simply attached the file if that's ok

amazon-dash.yml.txt

danielherrington commented 4 years ago

@elwoodjd Did you find a fix for this? Running into the same bug.

Nekmo commented 2 years ago

Closed due to inactivity.