Comments (47)
I had a stop yesterday after over 2 weeks.
What about surrounding the sniff call in try/catch? see this bug nicolargo/glances#1106 and the commit nicolargo/glances@7547ab9
from dasshio.
Still good. I guess it's time to close the bug as solved.
Thanks to everybody who participated for their contribution, and to Daniel for this very useful add-on.
from dasshio.
I have the same issue, Dasshio just randomly stops sometimes. I have no special router config setup for the Dash buttons.
from dasshio.
I might have found a possible cause / contributing factor for this. I updated all of my config to use the new internal communication added in 2.0 and when I hit save I got an error stating I was missing the URL field (which is no longer required).
I remembered that Dasshio is built on device rather than been stored in Dockerhub so I rebuilt the image and everything worked. Clearly even though Hass.io said I was on the latest version it hadn’t rebuild the image. Since then no random stopping (at 2 days now).
Looking through the rest of these reports most people seeing this issue seem to still be using the old URL method of calling services. I’d suggest if you’re having the issue rebuild the image as there’s a good chance you’re not on the version you think you’re on. It’s possibly also worth moving to the new internal coms API if possible (if nothing else it feels a little faster).
from dasshio.
Hi @amagnolo!
I am sorry I am not too focused on this project but I find quite difficult to get reproducible steps to fix this issue.
I have myself experienced some ramdom stops from time to time but not so often...
It would be very helpful for me to have the steps to reproduce your errors with the logs.
One thing to note also is that I am not an expert on the scapy python library at all and the documetation is quite bad, so I will try to do what is on my hand as I see it is a common issue.
I will try to address this at the end of this week. Any help with logs and steps will be hugely welcomed!
from dasshio.
Since we seem to be struggling to replicate and solve this bug with Python maybe the simple solution is to wrap the app in something like Supervisor and let that restart the process whenever it dies. Then have the Docker image start Supervisor instead of the app directly.
(I think that Hassio should have the option to auto restart addons itself personally, it's pretty standard practice when orchestrating container based systems.)
If I can find time I'll have a go at this myself and pull request if I'm successful.
from dasshio.
I have just released v0.2.1 with the try/except approach, lets see how it goes...
Note now the delay time is configurable from the UI too :)
Please try the new version and let me know 😄
from dasshio.
Installed! Will see how things go.
Thanks for the work Daniel.
from dasshio.
No stops until update. Seems fine 👍
from dasshio.
^^ no Problems anymore
from dasshio.
I do not know if it is fixed, have only had a couple of days of uptime. But it is much better.
from dasshio.
I have not experienced the bug after a whole week with 0.2.1. Good job!
from dasshio.
HI @amagnolo! Thank you so much for reporting.
Have you experieced this with last version of Dasshio? If not, please check it and let me know.
Thanks!
from dasshio.
I updated Dasshio to 0.2.0 and it happened again.
This is the error log:
2017-12-19 08:57:44,663 | INFO | Gillette button pressed!
2017-12-19 08:57:44,665 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2017-12-19 08:57:44,816 | INFO | Status Code: 200
2017-12-19 08:57:44,818 | INFO | Successful request Traceback (most recent call last): File "dasshio.py", line 147, in <module> filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0) File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff s.close() File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close set_promisc(self.ins, i, 0) File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"") File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0]) File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,'utf-8'))) OSError: [Errno 19] No such device
Hass.io is still version is 0.59.2 running on Raspberry Pi 3; I will check with version 0.60.
from dasshio.
I upgraded Hass.io to 0.60.0 and it still happens, with Dasshio 0.2.0. Unfortunately, I am not able to reproduce it at will: after three days without the bug, this morning it happened again.
Please notice that the add-on crashes after having successfully performed the action.
This is the log:
2017-12-25 23:46:45,260 | INFO | Gillette button pressed!
2017-12-25 23:46:45,262 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2017-12-25 23:46:45,347 | INFO | Status Code: 200
2017-12-25 23:46:45,348 | INFO | Successful request
2017-12-25 23:46:45,401 | INFO | Packet captured, waiting 20s ...
2017-12-25 23:47:05,405 | INFO | Starting sniffing...
2017-12-26 09:03:33,114 | INFO | Gillette button pressed!
2017-12-26 09:03:33,115 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2017-12-26 09:03:33,246 | INFO | Status Code: 200
2017-12-26 09:03:33,247 | INFO | Successful request
Traceback (most recent call last):
File "dasshio.py", line 147, in <module>
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0)
File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff
s.close()
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close
set_promisc(self.ins, i, 0)
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index
return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0])
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,'utf-8')))
OSError: [Errno 19] No such device
from dasshio.
This seems quite odd to me and will definitely have to look into the problem.
Some questions just to have some additional info to solve this:
- Does this happen just afeter pressing the button?
- Do you have a stable internet connection to your rpi?
- Do you have both ethernet and wifi configured at the same time in your pi?
Thanks for reporting and please write me back in case you are able to reproduce it.
from dasshio.
-
Does this happen just afeter pressing the button?
yes; it performs the associated action successfully, and then it crashes
-
Do you have a stable internet connection to your rpi?
yes, it is connected by ethernet to an adsl modem/router with a stable internet connection
-
Do you have both ethernet and wifi configured at the same time in your pi?
no, the wifi is not configured
from dasshio.
I have just realized that this may be relevant: the router is configured to drop packets from the IP address of the dash button, to avoid it communicating with Amazon.
from dasshio.
from dasshio.
Suffering same issue and same output in the logs running latest version of hassio and dasshio. No special config on my router either.
from dasshio.
I am seeing it on 0.2.0 as well.
2018-01-03 21:12:17,710 | INFO | Hammermill button pressed!
2018-01-03 21:12:17,712 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2018-01-03 21:12:17,945 | INFO | Status Code: 200
2018-01-03 21:12:17,947 | INFO | Successful request
Traceback (most recent call last):
File "dasshio.py", line 147, in <module>
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0)
File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff
s.close()
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close
set_promisc(self.ins, i, 0)
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index
return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0])
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,'utf-8')))
OSError: [Errno 19] No such device
Config options
{ "buttons": [ { "name": "Hammermill", "address": "00:fc:8b:54:41:d9", "url": "http://hassio/homeassistant/api/services/light/toggle", "headers": "{\"x-ha-access\": \"pm9600sa\"}", "body": "{\"entity_id\": \"light.bathroom_2, light.bathroom_1\"}" } ] }
Pi 2 running Hassio 60.0, but has been happening since 0.2.0 update but not as often as the previous version of Dasshio.
from dasshio.
Same thing happening to me, I use the Dash button as doorbell, and it happened to me several times that I do not notice people at the door, and after checking the service it was stopped for no apparent reason. I use an AWS Iot dash button, Hassio 0.60 and dasshio 0.20
from dasshio.
Same here
File "dasshio.py", line 101, in <module>
sniff(stop_filter=arp_display, filter='arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)', store=0, count=0)
File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff
s.close()
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close
set_promisc(self.ins, i, 0)
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index
return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0])
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,"utf-8")))
OSError: [Errno 19] No such device```
from dasshio.
Hello
I have the exact same problem and it seems to happen after a press on a dash button
2018-01-10 09:36:31,701 | INFO | Sun button pressed!
2018-01-10 09:36:31,703 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2018-01-10 09:36:32,896 | INFO | Status Code: 200
2018-01-10 09:36:32,898 | INFO | Successful request
Traceback (most recent call last):
File "dasshio.py", line 147, in <module>
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0)
File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff
s.close()
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close
set_promisc(self.ins, i, 0)
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index
return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0])
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,'utf-8')))
OSError: [Errno 19] No such device
I'm using hassio 0.60.1, dasshio 0.2.0
My router is a TP-Link Archer C59 and I don't block the button from accessing Amazon (but that's a good idea to avoid the app notifications !)
I'll be glad to help more if possible
from dasshio.
Rebuild is running on my Hassio install right now.
from dasshio.
Is there any way to shorten the delay before re-activation?
from dasshio.
Tried rebuild but same issue is present for me although it doesn't seem as often. Maybe that's coincidence I don't know but the log output is exactly the same.
from dasshio.
I've bodged this for now - I've added the following to an automation that is trigger by the entity that the button calls in home assistant.
- service: hassio.addon_start
data:
addon: "03d23610_dasshio"
from dasshio.
What we need is an automation triggered by the "stopped" state of the addon to relaunch it when it randomly stops
from dasshio.
I don't think any events are fired that we can use as a trigger though?
from dasshio.
I had considered solving this with an automation myself (although the changes I listed in my previous post seem to have fixed it for me).
It could be done by setting up a ping
binary sensor
which checks the state of Dasshio and an automation that triggers when the binary sensor
turns off.
from dasshio.
I really need a way to watchdog this program, it is stopping for me about every 2 days.
Could you elaborate on the ping and binary_sensor test? Is there a specific port on the hassio server that should respond if dasshio is alive? How does one restart the process in an automation?
from dasshio.
I'm having the same random stops here, about once a week. Dasshio 0.2.0 on fully updated HASSIO (supervisor 0.83, HA 0.61.1). Now I'll try rebuilding the addon as suggested by @danrspencer , will report back.
In the meantime, any suggestion on how to monitor if the addon is up? I'd like the Ping binary sensor option, but don't know what is the address to ping.
from dasshio.
Rebuilding doesn't solve the issue.
Restarting the addon when it doesn't respond might mitigate the problem, but it would be just an ugly hack.
I would concentrate on addressing the root of the bug: what is the "device" that is expected and reported not found? What is line 147 in dasshio.py supposed to do? Why on earth does the addon stops for an error that occurs AFTER having successfully performed the requested action?
Unfortunately I don't know Python, but in other languages the exceptions (unexpected errors) can be "caught" by the code. Is there such a thing for Python that could wrap the offending call, quietly log the error message and move on?
@danimtb : Is the error (OSError: [Errno 19] No such device) originated by your code or is it from the system, i.e. should we escalate this bug to @home-assistant programmers?
from dasshio.
@amagnolo Yes, the addon stopped less than 24h after the rebuilding. I agree that the only solution is to solve the bug, but in the meantime having it restarted when it goes down can be a useful workaround.
from dasshio.
Same problem here. :/
2018-01-28 16:55:38,609 | INFO | finish button pressed!
2018-01-28 16:55:38,611 | INFO | Request: http://homeassistant:8123/api/services/script/switch_living_room
2018-01-28 16:55:38,784 | INFO | Status Code: 200
2018-01-28 16:55:38,785 | INFO | Successful request
Traceback (most recent call last):
File "dasshio.py", line 147, in <module>
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0)
File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff
s.close()
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close
set_promisc(self.ins, i, 0)
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index
return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0])
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,'utf-8')))
OSError: [Errno 19] No such device
from dasshio.
So, it stopped this morning and after it stopped... what had appeared to be a memory leak fixed itself!
Logs:
2018-02-08 06:38:56,750 | INFO | Hammermill button pressed!
2018-02-08 06:38:56,752 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2018-02-08 06:38:57,035 | INFO | Status Code: 200
2018-02-08 06:38:57,037 | INFO | Successful request
Traceback (most recent call last):
File "dasshio.py", line 147, in <module>
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0)
File "/usr/lib/python3.6/site-packages/scapy/sendrecv.py", line 617, in sniff
s.close()
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 499, in close
set_promisc(self.ins, i, 0)
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 151, in set_promisc
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 294, in get_if_index
return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0])
File "/usr/lib/python3.6/site-packages/scapy/arch/linux.py", line 288, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",bytes(iff,'utf-8')))
OSError: [Errno 19] No such device
Screen shot of ram available before and after crash. Restarting it consumed about 19.6 to 20 MiB.
from dasshio.
Counting the number of users affected, and the degree of malfunction, this is a serious bug. Without the help of the original author, I guess we're stuck with a platform too unreliable.
@danimtb, is there any hope that you will look into the issue or have you abandoned the project? Not to put pressure on you, just to know if we should look for alternatives.
from dasshio.
Hello @danimtb , good to know that you're giving it a try, thanks!
Unfortunately I can't reproduce the bug with predictable steps. The best analysis I managed to do so far is in my previous comment #21 (comment) .
Maybe someone else has found a pattern in this seemingly random behavior...
from dasshio.
I cannot reproduce it at will either. Sometimes it goes for days and sometimes it will die in a couple of hours... I do see my free memory pool decline before it dies.
from dasshio.
Let's try something like that. I will also do some test inside the docker image this weekend.
Thanks!
from dasshio.
same issue in my case, hope for fix
from dasshio.
Doing a rebuild now, but Hassio did not indicate that a new version was out there.
from dasshio.
How is version 0.2.1 working? Could we consider this issue fixed?
from dasshio.
Still working good guys? I experienced no stops. Even the stops I had from time to time have disappeared.
from dasshio.
Wouldn't be possible without your feedback! Thank you guys and thanks @amagnolo for reporting this :)
from dasshio.
Can confirm, not a single stop since update. Thanks @danimtb
from dasshio.
Related Issues (20)
- README.md grammar error
- Errors Log, config HOT 4
- help to understand error in logs HOT 2
- Manual installation HOT 1
- 400 Bad Request from Homeassistant API HOT 1
- Some scripts work - others don't - here's how to fix it HOT 2
- support for 'dash wand'? HOT 1
- How to get dasshio to connect to HA IP address HOT 5
- Where to put the config file ? HOT 2
- Problem with config HOT 7
- Service started but not responding to Dash buttons HOT 5
- README.md regarding Quick Setup
- ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /addons/03d23610_dasshio/changelog
- Expections since ~ beginning of May
- Dash button stopped working HOT 16
- Amazon Dash button Not working updating Home Assistant 0.102.2 HOT 5
- Format for button connection to wifi HOT 7
- Prevent New Dash Button from Being Bricked HOT 1
- Nmap Device Tracker conflict HOT 1
- Older Dash Buttons HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dasshio.