Nekmo / amazon-dash

Hack your Amazon Dash to run what you want.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

elwoodjd opened this issue · comments

What is the purpose of your issue?

  • Bug report (encountered problems with amazon-dash)

  • Feature request (request for a new functionality)

  • Question

  • Other

  • The pip install or setup install command has been completed without errors

  • The python -m amazon_dash.install command has been completed without errors

  • The amazon-dash discovery command works without errors

  • I have created/edited the configuration file

  • Amazon-dash service or amazon-dash --debug run works

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.

commented

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.

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

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

commented

Closed due to inactivity.