KhaosT / homebridge-amazondash

Amazon Dash Button plugin for Homebridge
58 stars 14 forks source link

Failed to create pcap session #12

Open jasehigh opened 7 years ago

jasehigh commented 7 years ago

When I run homebridge with the homebridge-amazondash plugin, I get the following error on start-up:

[Error: pcap_findalldevs didn't find any devs]
Failed to create pcap session: couldn't find devices to listen on.
Try running with elevated privileges via 'sudo'
/usr/local/lib/node_modules/homebridge-amazondash/node_modules/node-dash-button/index.js:16
        throw new Error('Error: No devices to listen');
        ^
Error: Error: No devices to listen

I can resolve this by running homebridge with elevated privileges:

sudo homebridge

However, I do not know how to run with sudo (on my mac) and the ~/Library/LaunchAgents script as described here: https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-OSX

Any advise on how to auto run home bridge with sudo or to run the homebridge-amazondash without the need for elevated privileges would be much appreciated.

In addition, when homebridge is running with homebridge-amazondash, I get the following messages logged:

node_pcap: EthernetFrame() - Don't know how to decode ethertype 30329

Is this an issue?

many thanks, for your assistance.

Jason.

jasehigh commented 7 years ago

Moved the com.homebridge.server.plist file... as described here...https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-OSX

From: /Users/username/Library/LaunchAgents To: /Library/LaunchDaemons

I made the following changes to the plist file:

Added:

<key>UserName</key>
<string>root</string>

To run as root.

Changed program to run from:

/usr/local/bin/homebridge -I

To:

/usr/local/bin/homebridge -U /Users/username/.homebridge

To ensure the config.json file is picked up as before.

Instead of the following commands to load/unload homebridge:

launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist
launchctl unload ~/Library/LaunchAgents/com.homebridge.server.plist

Use the following commands:

sudo launchctl load -F /Library/LaunchDaemons/com.homebridge.server.plist
sudo launchctl unload -F /Library/LaunchDaemons/com.homebridge.server.plist

I still have the following message logged when homebridge is running with homebridge-amazondash:

node_pcap: EthernetFrame() - Don't know how to decode ethertype 30329

Is this an issue?

Jason.

amitgandhinz commented 7 years ago

Were you able to solve this issue? I am experience the same error when i press the dash button. The scene does not get triggered and i see the following in the home bridge logs

node_pcap: EthernetFrame() - Don't know how to decode ethertype 35085

ooii commented 6 years ago

I'm having the same problem, still this message

Failed to create pcap session: couldn't find devices to listen on.
Try running with elevated privileges via 'sudo'
/Users/user/.homebridge/node_modules/node-dash-button/index.js:28
        throw new Error('Error: No devices to listen');

While I'm running the launchctl as root from launchDaemons repository. If I start homebridge manually as root, it works fine.