[Amazon Dash Button - DNSMASQ Problem]

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

StefanP

New Around Here
Hello,

i have buy for few days my ASUS AC88U Router and flash them with "asus merlin".
Network Speed is on 2.4 and 5.0 GHZ Band perfectly.

I have found a Amazon Dashbutton its connect to 2.4GHZ and block internet access.
I found few "scripts" to load a action when the Button is pressed but DNSMASQ give me an error and
the few wlan devices cant login into wlan.

May 5 07:17:16 custom_config: Appending content of /jffs/configs/dnsmasq.conf.add.
May 5 07:17:16 dnsmasq[3182]: illegal repeated keyword at line 42 of /etc/dnsmasq.conf
May 5 07:17:16 dnsmasq[3182]: FAILED to start up

On:
/jffs/configs/dnsmasq.conf.add file with this line :
dhcp-script=/jffs/a/post-lease.sh

On:
/jffs/a/post-lease.sh
#!/bin/sh
# just for testing
# touch /tmp/0_script_test
NowLeasedMac=$2
if [ “$NowLeasedMac” == “10:B3:32:42:55:62” ]; then
#Do what you want here when dashbutton pressed.
#e.g. I switch on-off my squeezebox player.

wget http://10.10.1.204/cm?user=demo&password=demo&cmnd=Power Off
echo “Caught !”
fi


Its a Sonoff behind with the cm? command to put it offline when is online.

Cant help me? Thanks
 

Maverickcdn

Senior Member
May 5 07:17:16 dnsmasq[3182]: illegal repeated keyword at line 42 of /etc/dnsmasq.conf

Because /etc/dnsmasq.conf (default dnsmasq config file) already contains a 'dhcp-script=' directive in it
 

CaptainSTX

Part of the Furniture
If you are using a dedicated DASH button Amazon discontinued supporting them several months ago at least in the USA. They no longer work. They are electronic trash now.

If you log into your Amazon account you can still use virtual DASH buttons but Amazon really wants you to ask Alexa to get you what you need

To bad as my wife really liked the real buttons.
 

StefanP

New Around Here
Because /etc/dnsmasq.conf (default dnsmasq config file) already contains a 'dhcp-script=' directive in it

Can you help me to fix the problem?
When the button is pressed than call with wget the "tasmota" url to activate oder deaktivate the light.

@CaptainSTX
Yes you have right, the Amazon Dashbutton is deactivated and electronic trash now.
When you connected to amazon and press the button to order -> is trash now
When you only have connected to your wlan and close the setup you can use the dashbutton to any "action" when sniff or filter the mac of the dashbutton.

Big thanks for your replay. I hope you can help me to integrated the "dash" button for the sonoff action.
 

Maverickcdn

Senior Member
Can you help me to fix the problem?
When the button is pressed than call with wget the "tasmota" url to activate oder deaktivate the light.

Not I at the moment. Maybe @ColinTaylor or another site guru might have an idea.

If I understand right, when you press the button is when the 'Dashbutton' connects to the router, then disconnects after X secs Im guessing, and you are trying to execute a script when then Dashbutton connects?
 

Maverickcdn

Senior Member

Martineau

Part of the Furniture
There may be a way to edit the dhcp-script file called in the /etc/dnsmasq.conf but likely not otherwise Id think there'd be a thread around about it
Many use 'dnsmasq.postconf' to plug-in their custom script:

e.g. this is mine
Code:
# v384.9 (Feb-2019) ASUS now uses dnsmasq directive:
#    dhcp-script=/sbin/dhcpc_lease
if [ $FIRMWARE -ge 38409 ];then
    pc_replace "dhcp-script=/sbin/dhcpc_lease" "dhcp-script=/jffs/scripts/DHCP_LeaseTracker.sh   # Request my dhcpc_lease script" $CONFIG
fi
then simply call '/sbin/dhcpc_lease' at the end of the custom script.
 
Last edited:

Martineau

Part of the Furniture
Can you help me to fix the problem?
When the button is pressed than call with wget the "tasmota" url to activate oder deaktivate the light.

Remove the following line from 'dnsmasq.conf.add'
Code:
dhcp-script=/jffs/a/post-lease.sh
then create

/jffs/scripts/dnsmasq.postconf
Code:
pc_replace "dhcp-script=/sbin/dhcpc_lease" "dhcp-script=/jffs/scripts/post-lease.sh   # Request my dhcpc_lease script" $CONFIG
then add the call to the ASUS utility '/sbin/dhcpc_lease' to the end of your custom script

/jffs/scripts/post-lease.sh
Code:
#!/bin/sh

NowLeasedMac=$2

if [ “$NowLeasedMac” == “10:B3:32:42:55:62” ]; then
   #Do what you want here when dashbutton pressed
   #e.g. I switch on-off my squeezebox player.
   wget http://10.10.1.204/cm?user=demo&password=demo&cmnd=Power Off
   echo “Caught !”
fi

/sbin/dhcpc_lease [email protected]
 
Last edited:

StefanP

New Around Here
Thanks for your posts but
@Martineau:

Apr 20 17:05:02 dnsmasq-dhcp[330]: DHCPREQUEST(br0) 10.10.10.77 aL:58:bE:62:3C:L0
Apr 20 17:05:02 dnsmasq-script[330]: connect error: No such file or directory
Apr 20 17:05:02 dnsmasq-script[330]: [SEND_AMAS_NODE_EVENT:(4684)] ERROR connecting:No such file or directory.

Asus-Merlin Router Version: ASUSWRT-Merlin RT-AC88U 384.16_1-geda9010451
 

Martineau

Part of the Furniture
Thanks for your posts but
@Martineau:

Apr 20 17:05:02 dnsmasq-dhcp[330]: DHCPREQUEST(br0) 10.10.10.77 aL:58:bE:62:3C:L0
Apr 20 17:05:02 dnsmasq-script[330]: connect error: No such file or directory
Apr 20 17:05:02 dnsmasq-script[330]: [SEND_AMAS_NODE_EVENT:(4684)] ERROR connecting:No such file or directory.

Asus-Merlin Router Version: ASUSWRT-Merlin RT-AC88U 384.16_1-geda9010451
Thanks for reporting this, but please search the forum, first reported 4 months ago.
 
Last edited:

StefanP

New Around Here
Thanks for reporting this, but please search the forum, first reported 4 months ago.

Sorry to you, but i found only topics with the same probem but no with the fix and in beta versions but nothing answers to this problem :(

The search give me no more related and fixed tipps.

It's not only the dash button on every wlan client this message is reapeating it in the logfile.
Can you give me a tipp or link to fix it - i found it not :(
 

Maverickcdn

Senior Member

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top