maxisme / amazon-bash

A bash script to react to the click of an amazon-dash button
18 stars 5 forks source link

Multiple dash buttons #2

Closed Mohoganogan closed 7 years ago

Mohoganogan commented 7 years ago

Can this script handle multiple dash buttons?

Could this script handle multiple dash buttons each resulting in a different action?

Button 1 does action A Button 2 does action B

maxisme commented 7 years ago

Currently you could have two scripts running:

but that is a waist of resources. I will look into modifying the simple scripts. Currently I only have one dash button so will not be able to test for a while but I will make a branch :+1:

Mohoganogan commented 7 years ago

I could mail you one if it would help. I am currently running two copies of the script. I have a stack of buttons and was looking in to using several to post various messages to slack. So if you figure out how to scale from one to many that would be great. As you mention node is rather heavy and I am trying to use my older Raspberry B to run this. Your script(s) does not seem to have any trouble catching button presses almost instantly.

maxisme commented 7 years ago

That would be really kind of you but don't want to waist your money! I will get one soon and the previous one was free.

So you are in affect doing what I mentioned, and it works?

The more I think about it the more I think the fore mentioned method would be best. Have you found any problems with it (slower response times, messy to set up, etc...)? Can you tell me a bit more about your ideal situation/setup?

Mohoganogan commented 7 years ago

Running January edition of Raspian Lite Installed the minimum required packages I did not use your described method to find the MAC of the buttons. I used LanScan Pro since I already own it. Created two copies of the script A & B Currently manually running them from the command line "sudo bash amazon-basha.sh &" Followed by "sudo amazon-bashb.sh &"

I did not see too much of a change in the response time. I was going to try running 5 versions but ran short on time last night.

I will try this evening to get 5 buttons running.

Mohoganogan commented 7 years ago

I have five copies running. Five buttons all sending slack messages. It takes on average 10 seconds from button press to notification appearing on my phone.

maxisme commented 7 years ago

Interesting. And if you stop 4 of the scripts does much change (speed wise)? Also would you mind running ps aux | grep amazon-bash?

You are running the amazon-bash.sh script rather than the amazon-bash-wifi.sh is that because you do not have a wifi dongle? If you get one, the wifi script will improve the speed massively - if that is of interest of course.

Mohoganogan commented 7 years ago

Hard wired for now. Easier to plug right in to the router. I am seeing on screen detections in under 2 seconds. Which is better than some other methods I tried before yours. Plus yours detects the newer second generation buttons.

pi 883 1.0 0.4 4268 1948 pts/0 S+ 17:38 0:00 grep --color=auto amazon-bash?

On Jan 27, 2017, at 5:25 PM, Maximilian Mitchell notifications@github.com wrote:

ps aux | grep amazon-bash?