Closed xmbforum closed 5 years ago
The reason you're having trouble with the \$
is that those are escaped to be run within a shell script in the cat
command (https://github.com/davidjb/technicolor-tg799vac-hacks/blob/master/03-configure.sh#L91-L119). In your case, you've copy/pasted the escaped code and so it's invalid syntax. So, you can either run that whole cat
command in your shell to create the file, or edit what you pasted to unescape the characters (which is just to say remove the backslashes; there's quite a few there). Same applies to /etc/init.d/leds-off
if you're following that.
Easiest option can be to just copy/paste all of https://github.com/davidjb/technicolor-tg799vac-hacks/blob/master/03-configure.sh#L84-L146 into a script or shell and run it -- but review what you're running just to make sure it's what you want.
As for running the uci set
command, that should all fine shell-wise but ymmv on a model different to a TG799vac.
Ah, thank you! Was a noobie issue then. All works fine now thank you, well except for the reallocation of the wifi button. Which actually suits me as I'd rather reallocate the WPS button. [http://www.resqnet.co.uk/wp-content/uploads/2016/02/TG789vac-v2-Set-up-and-user-guide.pdf page 9 "The WPS button allows you to add new wireless clients to your network in an easy yet secure way without the need to enter any of your wireless settings manually"]
So instead of uci set button.wifi_onoff.handler='toggleleds.sh' uci commit
something like set uci.button.button.@wps.handler 'toggleleds.sh' uci commit
Would you happen to know the correct wps button string code? Also, out of curiousity, when toggling led's back on, why power = blue? Is that the default colour for the 799VAC or your preferred power colour?
Thanks again.
Ah, I see. Your physical device is notably different to mine. To see all the available config on your device, ssh
in and run:
uci show button
which shows all the UCI configuration for button.*
and get a long list of current options, something like this:
button.reset.button='BTN_0'
button.reset.action='released'
button.reset.handler='rtfd'
button.reset.min='7'
button.reset.max='90'
button.easy_reset=button
button.easy_reset.button='BTN_3'
button.easy_reset.action='released'
button.easy_reset.handler='rtfd'
button.easy_reset.min='7'
button.easy_reset.max='90'
button.dect_paging=button
button.dect_paging.button='BTN_2'
button.dect_paging.action='released'
button.dect_paging.handler='ubus call mmpbxbrcmdect.paging toggle'
button.dect_paging.min='0'
button.dect_paging.max='3'
button.dect_registration=button
button.dect_registration.button='BTN_2'
button.dect_registration.action='released'
button.dect_registration.handler='ubus call mmpbxbrcmdect.registration open'
button.dect_registration.min='3'
button.dect_registration.max='30'
button.wifi_onoff=button
button.wifi_onoff.button='BTN_1'
button.wifi_onoff.action='released'
button.wifi_onoff.min='0'
button.wifi_onoff.max='2'
button.wifi_onoff.handler='toggleleds.sh'
button.wps=button
button.wps.button='BTN_4'
button.wps.action='released'
button.wps.handler='wps_button_pressed.sh'
So in my case, to remap the WPS button, I'd do almost exactly what you suggested:
uci set button.wps.handler='toggleleds.sh'
uci commit
And you have what you want! YMMV on your device so figure out which UCI key (eg button.wps.handler
or button.dect_registration.handler
etc you want and that should be that. Your device might have even more buttons and you can make custom scripts to do anything you want 😄
The reason I went with the Wifi button is that it's the "obvious" button on the top of the device. My TG799vac has WPS/DECT buttons on the left side, but they're white-on-white and not obvious. There's a "secret" button which is the Status LED (https://crowdsupport.telstra.com.au/t5/image/serverpage/image-id/15531i404CD6C1A4A86D05?v=1.0) but there's no config for this that I can see so I'm guessing it's fake.
As for your last question about LED toggling, iirc the power LED doesn't come back on automatically with mine as a bridged modem. It's been a while so I might be forgetting but pretty sure this is why - the status only reported Internet connectivity, which my other router is handling. Blue is a favourite colour of mine though so that might be why I chose that colour!
Thank you again David! Works exactly as I wished for - no more seemingly bright lights emitting at night, yay! Have to think about other scripts now...
You got it -- that's exactly my reasoning for customising and shutting down the LEDs. They only serve a purpose if someone is looking at them, so it makes sense for them to be off 99.9% of the time.
I understand your script affects wifi connection (?).
There's a "secret" button which is the Status LED (https://crowdsupport.telstra.com.au/t5/image/serverpage/image-id/15531i404CD6C1A4A86D05?v=1.0) but there's no config for this that I can see so I'm guessing it's fake.
No it's not secret and is a more obvious button. Unfortunately been having heaps of issues with leds at https://github.com/Ansuel/tch-nginx-gui/issues/264. I think status button and your script close to best solution.
@flywire What I meant above is that I've been through the UCI settings for all available buttons (see the list of settings above) and whilst the WPS/DECT/WiFi buttons trigged scripts, the Status button failed to do anything, leading me to conclude it either isn't wired up physically or lacks software support. Code that allows trigging a script from the status button are definitely welcome, though!
And yes, my scripts do disable wifi (https://github.com/davidjb/technicolor-tg799vac-hacks/blob/92b7b2fa9846547e2f5fcf590f4a47cb8c917a83/05-bridge-mode.sh#L3-L12) but only if you run that file specifically, which is designed for modems operating in 'bridge mode'. If you want wifi, then either skip that script or run the reverse to re-enable hostapd etc. And if you want the wifi button to control wifi, then you can reassign the LED-toggle switch script to another button -- the original setting is in the comments in that script.
https://github.com/Ansuel/tch-nginx-gui/issues/264#issuecomment-443346808
# most of script removed
Changeduci set button.wifi_onoff.handler=toggleleds.sh
touci set button.info.handler=toggleleds.sh
and status button toggles leds.
@flywire Interesting; I don't have those settings on my device. What's your modem's model number and the output of the command uci show button
?
Telstra TG799vac GUI Version 8.9.82 2018 Software Version 17.2.0261-7021006-20180717060049-820-RA
root@mygateway:~# uci show button
button.reset=button
button.reset.button='BTN_0'
button.reset.action='released'
button.reset.handler='rtfd'
button.reset.min='7'
button.reset.max='90'
button.dect_paging=button
button.dect_paging.button='BTN_2'
button.dect_paging.action='released'
button.dect_paging.handler='ubus call mmpbxbrcmdect.paging toggle'
button.dect_paging.min='0'
button.dect_paging.max='3'
button.dect_registration=button
button.dect_registration.button='BTN_2'
button.dect_registration.action='released'
button.dect_registration.handler='ubus call mmpbxbrcmdect.registration open'
button.dect_registration.min='3'
button.dect_registration.max='30'
button.wifi_onoff=button
button.wifi_onoff.button='BTN_1'
button.wifi_onoff.action='released'
button.wifi_onoff.min='0'
button.wifi_onoff.max='2'
button.wifi_onoff.handler='wifionoff.sh'
button.wps=button
button.wps.button='BTN_4'
button.wps.action='released'
button.wps.handler='wps_button_pressed.sh'
button.wps.min='0'
button.wps.max='3'
button.info=button
button.info.button='BTN_3'
button.info.action='released'
button.info.min='0'
button.info.max='2'
button.info.handler='toggleleds.sh'
Thanks for the info. So the button was renamed & repurposed in later firmware versions it seems (easy_reset
--> info
). I pushed https://github.com/davidjb/technicolor-tg799vac-hacks/commit/dd57a9bdb6afb76c9f2532ff9d7e76ba199b2151 which makes it work for my firmware and might investigate newer firmware later.
/rom/etc/ledfw/stateMachines.lua
Copied and pasted sections of 03-configure.sh as required led off functionality into their relevant files however got the following errors. No doubt noobie issues as I couldn't get uci set button.wifi_onoff.handler='toggleleds.sh' to work either. [nb: TG789 vac]