Ansuel / tch-nginx-gui

Modified file to apply to a stock technicolor GUI
GNU General Public License v3.0
346 stars 52 forks source link

DGA4131FWB #637

Closed lorenzocanalelc closed 4 years ago

lorenzocanalelc commented 5 years ago

If you are on the latest dev, please go to Cards >> System Extras >> Debug Report and press the Generate button. Please attach the file here: DebugHelper2019-05-05-0025.tar.zip

Device Model: DGA4131 FW 17.2.0412-2141001-20181215141731_FW_248 Gui Version: 9.1.16

Description of problem: Many bug. Some of them: LEDS are all off except the POWER one which is White (Even Without Connection). When installing for the first time there are 8 wifi which are 6 Guest without a real name (3x2.4 and 3x5) and the 2 normal one(2.4 and 5). The local network card doesn't accept any change. It says internal error. The Wifi Button doesn't work. Luci is not working. Other than that it seems to work (I'm using it with a FTTH Vodafone with external ONT, so Eth4 as WAN). I also attach the first /etc/init.d/rootdevice debug when I installed the GUI

root@OpenWrt:~# /etc/init.d/rootdevice debug
Root Script: Installing in progress...
Root Script: Applying specific model fixes...
Root Script: DGA device detected!
Root Script: Extracting custom-ripdrv-specificDGA.tar.bz2 ...
Root Script: Extracting telnet_support-specificDGA/TG800.tar.bz2 ...
Root Script: Extracting upgrade-pack-specificDGA.tar.bz2 ...
Root Script: Extracting upnpfix-specificDGA.tar.bz2 ...
Root Script: Extracting dlnad_supprto-specificDGA.tar.bz2 ...
Root Script: Extracting wgetfix-specificDGA.tar.bz2 ...
Installing wget (1.17.1-1) to root...
Configuring wget.
Unsupported parameter [set]
Root Script: Removing fixes and resuming root process...
Root Script: Disable watchdog
Root Script: Start rooting
Root Script: Unlocking web interface if needed
Root Script: Check if variant_friendly_name set
Root Script: Check and cleanup
Root Script: Remove default DNS Servers
Root Script: Purify WAN
Root Script: Fix DNS bug
Root Script: Enable DLNAd
Root Script: Fix Sysupgrade
Root Script: Check original config
Root Script: Restore original mapper
Root Script: Transformer lib check
Root Script: Remove https check
Root Script: Check for CSS themes
Root Script: Check if dnsmasq daemon name is as we need it for the GUI
Root Script: Check driver setting
Root Script: Check Dropbear config file
Root Script: Check eco paramaters
Root Script: Restarting power management
Root Script: Enable new upnp
Root Script: Sync DHCP configuration for new GUI
Root Script: Create GUI type in config
Root Script: Add new web options
Root Script: New DHCPRelay Option
Root Script: Disable trace from igmpproxy
Root Script: Move Aria2 dir
Root Script: Create new option for led definitions
Root Script: LedEventing new md5sum: e1fc0cbc7bde9a2f4b99f6d716abda7e
Root Script: LedEventing md5sum: c2994cf472060f933bfb703c9c15535d
Root Script: Old build detected, moving wansensing file
Root Script: Checking downgrade limitation bit
Root Script: Checking opkg feeds config
Root Script: Creating and checking real version
Root Script: Implementing WoL
Cannot find device "lan"
Cannot find device "lan"
Warning: Option 'lan'.wan is unknown
Warning: Option 'mgmt'.wan is unknown
Warning: Section 'mgmt' cannot resolve device of network 'mgmt'
Warning: Option 'wan'.wan is unknown
Warning: Section 'wan' cannot resolve device of network 'wan'
Warning: Section 'wan' cannot resolve device of network '6rd'
Warning: Option 'wwan'.wan is unknown
Warning: Section 'wwan' cannot resolve device of network 'wwan'
Warning: Option 'Guest'.wan is unknown
Warning: Option 'hotspot'.wan is unknown
Warning: Section 'hotspot' cannot resolve device of network 'hotspot'
Warning: Option 'Allow_DHCP_Renew_mgmt'._key is unknown
Warning: Option 'Allow_DHCP_Renew_wan'._key is unknown
Warning: Option 'Allow_Ping_mgmt'._key is unknown
Warning: Option 'Allow_Ping_wan'._key is unknown
Warning: Option 'Allow_DHCPv6'._key is unknown
Warning: Option 'Allow_Encapsulated_IPv6'._key is unknown
Warning: Option 'Allow_ICMPv6_Input'._key is unknown
Warning: Option 'Allow_ICMPv6_Forward'._key is unknown
Warning: Option 'Deny_HTTPS_lan'._key is unknown
Warning: Option 'Deny_HTTP_lan'._key is unknown
Warning: Option 'Deny_HTTPS_lan_v6'._key is unknown
Warning: Option 'access_2_LAN_IP'._key is unknown
Warning: Option 'access_2_GUEST_IP'._key is unknown
Warning: Option 'Deny_Guest_lan_gateway'._key is unknown
Warning: Option 'Deny_lan_2_Guest'._key is unknown
Warning: Option 'Deny_Guest_2_lan'._key is unknown
Warning: Option 'Access_Guest_ICMP'._key is unknown
Warning: Option 'SpeedTest_Allow_8888'._key is unknown
Warning: Option 'SpeedTest_Allow_7548'._key is unknown
Warning: Option 'redirectdmz'._key is unknown
Warning: Option 'MARK_CPE_DNSQUERY_SRCIP'._key is unknown
Warning: Option 'MARK_SPEEDTEST_DATA_SRCIP'._key is unknown
Warning: Option 'MARK_DATA_SRCIP'._key is unknown
Warning: Option 'MARK_BULKDATA_SRCIP'._key is unknown
Warning: Option 'MARK_LAN_TO_WAN'._key is unknown
Warning: Option 'MARK_WAN_TO_LAN'._key is unknown
Warning: Option 'MARK_GUEST_TO_WAN'._key is unknown
Warning: Option 'MARK_WWAN_TO_LAN'._key is unknown
Warning: Option 'Allow_ACS_1'._key is unknown
Warning: Option 'Allow_ACS_2'._key is unknown
Warning: Option 'Allow_restricted_sip_1'._key is unknown
Warning: Option 'Allow_restricted_sip_2'._key is unknown
Warning: Option 'Allow_restricted_sip_3'._key is unknown
Warning: Option 'Allow_restricted_sip_4'._key is unknown
Warning: Option 'Allow_restricted_sip_5'._key is unknown
Warning: Option 'Allow_restricted_sip_6'._key is unknown
Warning: Option 'Allow_restricted_sip_7'._key is unknown
Warning: Option 'Allow_restricted_sip_8'._key is unknown
Warning: Option 'Allow_restricted_sip_9'._key is unknown
Warning: Option 'Allow_restricted_sip_10'._key is unknown
Warning: Option 'Allow_restricted_sip_11'._key is unknown
Warning: Option 'Allow_restricted_sip_12'._key is unknown
Warning: Option 'Allow_restricted_sip_13'._key is unknown
Warning: Option 'Allow_restricted_sip_14'._key is unknown
Warning: Option 'Allow_restricted_sip_15'._key is unknown
Warning: Option 'Allow_restricted_sip_16'._key is unknown
Warning: Option 'Allow_restricted_sip_17'._key is unknown
Warning: Option 'Allow_restricted_sip_18'._key is unknown
Warning: Option 'Access_Guest_DHCP'._key is unknown
Warning: Option 'Access_Guest_DNS'._key is unknown
Warning: Option 'Access_Guest_DNS_input'._key is unknown
Warning: Option 'Access_Guest_ICMPv6'._key is unknown
Warning: Option 'Access_Guest_Browser'._key is unknown
Warning: Option 'telnetlan'._key is unknown
Warning: Option 'telnetguest'._key is unknown
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
does not specify a protocol, assuming TCP+UDP
Warning: Section 'wanapi' has no target specified, defaulting to DNAT
Warning: Section 'SNAT_PING' has no src_dip option specified
Warning: Section @zone[1] (mgmt) has no device, network, subnet or extra options
Warning: Section @zone[2] (wan) has no device, network, subnet or extra options
Warning: Section @zone[3] (wwan) has no device, network, subnet or extra options
Warning: Section @zone[5] (hotspot) has no device, network, subnet or extra options
* Clearing IPv4 filter table
* Clearing IPv4 nat table
* Clearing IPv4 mangle table
* Clearing IPv4 raw table
* Populating IPv4 filter table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
   * Rule 'Allow-DHCP-Renew-mgmt'
   * Rule 'Allow-DHCP-Renew-wan'
   * Rule 'Allow-Ping-mgmt'
   * Rule 'Allow-Ping-wan'
   * Rule 'Allow-Encapsulated-IPv6'
   * Rule 'Deny-HTTPS-lan'
   * Rule 'Deny-HTTP-lan'
   * Rule 'Only-allow-access-to-LAN-IP'
   * Rule 'Only-allow-access-to-GUEST-IP'
   * Rule 'Deny-Guest-lan-gateway'
   * Rule 'Deny-lan-2-Guest'
   * Rule 'Deny-Guest-2-lan'
   * Rule 'Allow-Guest-ICMP'
   * Rule 'SpeedTest_Allow_8888'
   * Rule 'SpeedTest_Allow_7548'
   * Rule 'Allow-ACS-1'
   * Rule 'Allow-ACS-2'
   * Rule 'Allow-restricted-sip-from-wan-again-1'
   * Rule 'Allow-restricted-sip-from-wan-again-2'
   * Rule 'Allow-restricted-sip-from-wan-again-3'
   * Rule 'Allow-restricted-sip-from-wan-again-4'
   * Rule 'Allow-restricted-sip-from-wan-again-5'
   * Rule 'Allow-restricted-sip-from-wan-again-6'
   * Rule 'Allow-restricted-sip-from-wan-again-7'
   * Rule 'Allow-restricted-sip-from-wan-again-8'
   * Rule 'Allow-restricted-sip-from-wan-again-9'
   * Rule 'Allow-restricted-sip-from-wan-again-10'
   * Rule 'Allow-restricted-sip-from-wan-again-11'
   * Rule 'Allow-restricted-sip-from-wan-again-12'
   * Rule 'Allow-restricted-sip-from-wan-again-13'
   * Rule 'Allow-restricted-sip-from-wan-again-14'
   * Rule 'Allow-restricted-sip-from-wan-again-15'
   * Rule 'Allow-restricted-sip-from-wan-again-16'
   * Rule 'Allow-restricted-sip-from-wan-again-17'
   * Rule 'Allow-restricted-sip-from-wan-again-18'
   * Rule 'Allow-Guest-DHCP'
   * Rule 'Allow-Guest-DNS'
   * Rule 'Allow-Guest-DNS-input'
   * Rule 'Access-Guest-Browser'
   * Rule 'Refuse_TELNET_LAN'
   * Rule 'Refuse_TELNET_GUEST'
   * Rule 'SSH_wan'
   * Rule 'Default action for outgoing NAT'
   * Rule 'Default action for outgoing NAT for Guest'
   * Redirect #0
   * Forward 'lan' -> 'wan'
   * Forward 'lan' -> 'wwan'
   * Forward 'Guest' -> 'wan'
   * Forward 'Guest' -> 'wwan'
 * Populating IPv4 nat table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
   * Redirect #0
 * Populating IPv4 mangle table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
 * Populating IPv4 raw table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
 * Clearing IPv6 filter table
 * Clearing IPv6 mangle table
 * Clearing IPv6 raw table
 * Populating IPv6 filter table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
   * Rule 'Allow-DHCPv6'
   * Rule 'Allow-Encapsulated-IPv6'
   * Rule 'Allow-ICMPv6-Input'
   * Rule 'Allow-ICMPv6-Forward'
   * Rule 'Deny-HTTPS-lan-v6'
   * Rule 'Deny-Guest-lan-gateway'
     ! Skipping due to different family of ip address
   * Rule 'Deny-lan-2-Guest'
   * Rule 'Deny-Guest-2-lan'
   * Rule 'SpeedTest_Allow_8888'
   * Rule 'SpeedTest_Allow_7548'
   * Rule 'Allow-Guest-ICMPv6'
   * Rule 'Access-Guest-Browser'
   * Rule 'Refuse_TELNET_LAN'
   * Rule 'Refuse_TELNET_GUEST'
   * Rule 'Allow incoming IPv6 when firewall off'
   * Rule 'Default action for outgoing NAT'
   * Rule 'Default action for outgoing NAT for Guest'
   * Forward 'lan' -> 'wan'
   * Forward 'lan' -> 'wwan'
   * Forward 'Guest' -> 'wan'
   * Forward 'Guest' -> 'wwan'
 * Populating IPv6 mangle table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
 * Populating IPv6 raw table
   * Zone 'lan'
   * Zone 'mgmt'
   * Zone 'wan'
   * Zone 'wwan'
   * Zone 'Guest'
   * Zone 'hotspot'
 * Set tcp_ecn to off
 * Set tcp_syncookies to on
   ! Unable to write value: No such file or directory
 * Set tcp_window_scaling to on
 * Running script '/etc/firewall.user'
 * Running script '/lib/functions/firewall-ext-tch.sh'
 * Running script '/lib/functions/tod.sh'
iptables: Chain already exists.
ip6tables: Chain already exists.
 * Running script '/lib/functions/firewall-wol.sh'
   ! Skipping due to path error: No such file or directory
 * Running script '/lib/functions/firewall-cwmpd.sh'
 * Running script '/usr/share/miniupnpd-tch/firewall.include'
 * Running script '/lib/functions/firewall-mmpbx.sh'
 * Running script '/lib/functions/weburl-tch.sh'
 * Running script '/lib/functions/firewall-dropbear.sh'
 * Running script '/lib/functions/firewall-telnet.sh'
Root Script: Apply new xDSL options
Root Script: Creating utility symbolic link
Root Script: Remove old update script
Root Script: Adding fast cache options
Root Script: Reinstalling Telstra GUI if needed...
Root Script: Checking if wan_mode option exists...
Root Script: Inizialize and start DoSprotect...
Root Script: Checking if intercept is enabled and disabling if it is...
Root Script: Attempt to clean the wansensing script from hardcoded interfaces...
Root Script: Cleaning WanSensing
Root Script: Disabling coredump reboot...
Root Script: Restoring nginx additional options if needed...
Root Script: Enabling hardware serial console...
Root Script: Cleaning cups firewall rule...
Root Script: Setting root flag
Root Script: Reset unlock bit
Root Script: Save root password if modified
Root Script: Setting & Enabling Dropbear SSH Server
Root Script: Restarting Dropbear SSH Server
Root Script: Doing various checks and generating hashes...
Root Script: Setting update branch to STABLE
Root Script: Stable GUI not found in /root
Root Script: Stable GUI not found in /tmp, checking for GUI_dev...
Root Script: Found GUI_dev in /tmp, copying in /root to generate a valid hash
Root Script: Updating GUI in /root folder from /tmp
Root Script: Assuming first time install, cleaning /www dir and re-extracting .bz2
Root Script: Detected upgrade!
Root Script: Old GUI hash: 
Root Script: New GUI hash: 939bf5caea2cfd8fd6f166b865945ad2
Root Script: Resetting version info...
Root Script: Add checkversion to cron...
Root Script: Applying modifications
Root Script: Restarting dnsmasq if needed...
Root Script: Checking if ISP is detected...
Root Script: Trafficmon inizialization
Root Script: Resetting cwmp and watchdog
Root Script: Process done.
Root Script: Restarting transformer
Root Script: Stopping nginx
Root Script: Restarting nginx...`

How to reproduce (if possible): Install the GUI on DGA4131

lorenzocanalelc commented 5 years ago

Throughout this week I discovered some information about the FastGate firmware; turns out the original wifi config has the 8 different wifi SSID, and I had to manual edit the file to works correctly with the GUI (But I still have trouble to change settings in the GUI for the guest network). For the Leds, only way to make ledfw not crashing (I think it crashs because power led is white when turning on, but after editing eco leds settings, it turns off and doesn't comes on) is using the original /usr/lib/lua/ledframework/ubus.lua but the line leds keeps flashing red (Even though the line is on) I attach some file for development purpose. Including the original button scripts for line,wifi and wps Original Fastweb FW files.zip

Ansuel commented 5 years ago

debug ledfw is a reale pain....

anyway i think we should first fix the wifi config and the ethernet.

lorenzocanalelc commented 5 years ago

Yes, I agree, I think that the original GUI doesn't show the other wifi that are present on the config file though. And probably one of them is related to the "WOW-FI" but I don't have it because my ISP is not Fastweb so it never got configured correctly

lorenzocanalelc commented 5 years ago

Ok, it probably was the old Dev GUI, because with the new dev the local network card works, only problem is the first time you edit, because the default SFP IP address is 169.x.x.x (I don't remember since I edited it to 172.16.x.x to work) and the GUI says "Public IP Range should not be used". Speaking of the wifi, I manually edited the config as the attached file shows, using the TG789vac wireless file as reference, so that WiFI Nurse works properly (It doesn't if the apX have different number on the wireless config file) but I can't turn on the guest wifi from the gui wirelessMOD.txt .

lorenzocanalelc commented 5 years ago

Can you at least remove led file from the GUI for the DGA4131? Because every time I update the gui, the led file overwrite the original one that I recopied. I used the original file to know at least when it fully booted up (even though the light stays red). With the GUI file for the leds it always stays white

Ansuel commented 5 years ago

it would be better to fix it

lorenzocanalelc commented 5 years ago

Is there anything I can do to help fixing it?

Ansuel commented 5 years ago

list all the problems in details and what should happen

lorenzocanalelc commented 5 years ago

Ok, I actually have no idea of how the leds should work, I have a list of them though, I will report the name as Fastweb shows it:

Ambient1:white -> Power (Luce Di Presenza)

Ambient2:White -> Luce Linea Bianco (Stato Linea) BroadBand:Green -> Luce Linea Verde (Stato Linea) BroadBand:Orange ->Luce Linea Arancione (Stato Linea) BroadBand:Red ->Luce Linea Rossa (Stato Linea)

Ambient3:White -> Luce Wifi Bianco (Stato Wifi) Wireless:Green -> Luce Wifi Verde (Stato Wifi) Wireless:Orange ->Luce Wifi Arancio (Stato Wifi) Wireless:Red ->Luce Wifi Rossa (Stato Wifi)

Ambient4:White -> Luce WPS Bianca (WPS) WPS:green -> Luce WPS Verde (WPS) WPS:orange -> Luce WPS Arancio (WPS) WPS:red ->Luce WPS Rossa (WPS)

Ambient5:White -> Luce In basso Bianca (??? No report on Fastweb manual)

What they should do on the stock firmware on a normal boot is: first the Ambient Led turn on and then off in this order 1,2,3,4,5,4,3,2,1 2017-03-25-10 09 41 then only the first white led should stays on. I'm not sure though because in my case the BroadBand:Red led turns on and stay red (I think is related to some check that Fastweb firmware does to check broadband connection (I used it with a FTTH connection with the LAN4 as WAN port)).

What I would suggest is this behavior (Taking the cue from other technicolor routers that I have): During the boot the 1,2,3...,3,2,1 animation (instead of the orange power led which is not present in this modem) and then those leds on: the Ambient1:white (instead of the green power led), BroadBand:Green (In case of working internet connection), Wireless:Green (In case of wifi on) with the possibility to turn off the BroadBand:Green and Wireless:Green with the Eco Led setting.

I don't know how hard is to implement that, but this I think would be the right behavior.

Ansuel commented 5 years ago

can yu give me a dump of the firmware?

dd if=/dev/mtd3 of=/tmp/mtd3 and give me mtd3 file in /tmp

lorenzocanalelc commented 5 years ago

Here it is. mtd3.zip

By the way can the gui also install openssh-sftp-server? Or at list could you add it to the default opkg repo?

Ansuel commented 5 years ago

it's very strange that the gui replace the leds file...

lorenzocanalelc commented 5 years ago

It replaces this file https://github.com/Ansuel/tch-nginx-gui/blob/master/decompressed/upgrade-pack-specificDGA/usr/lib/lua/ledframework/ubus.lua and this file https://github.com/Ansuel/tch-nginx-gui/blob/master/decompressed/ledfw_support-specificDGA/etc/ledfw/stateMachines.lua. I guess because it's a DGA model

Ansuel commented 5 years ago

can give me output of this ?

uci get -q env.var.prod_friendly_name

lorenzocanalelc commented 5 years ago

MediaAccess DGA4131FWB

Ansuel commented 5 years ago

you are using dev build right?

lorenzocanalelc commented 5 years ago

Yes

Ansuel commented 5 years ago

can you give me output of upgradegui ?

lorenzocanalelc commented 5 years ago

Oh you were right it doesn't change the stateMachines.lua file, only the ubus.lua file which breaks the leds

Ansuel commented 5 years ago

ok i don't need upgradegui

lorenzocanalelc commented 5 years ago

👍

Ansuel commented 5 years ago

should be good now

lorenzocanalelc commented 5 years ago

Yes, we have some improvement! So now, the initial presentation still doesn't work (this one

)

But now at least when the router is fully booted the Broadband:green led turns on, and the white1 power led stays on. The wifi one doesn't work though, and the eco led function only turns off the white led, that doesn't come back on when switching eco led off, until a reboot.

lorenzocanalelc commented 5 years ago

Never mind, I accidentally updated the gui to the stable and when going back to the dev the stateMachines didn't get update, so I had to overwrite it with the new one you posted. Surprisingly with the new one the presentation works, but the broadband led flashes red and doesn't get green

lorenzocanalelc commented 5 years ago

When upgrading the GUI the Green broadband led starts blinking (This is in accord to the original ubus.lua behavior for updates) but it doesn't stop because it doesn't recognize the message "done" for the fwupgrade. I tried to add this line to the ubus.lua in the event 'fwupgrade' elseif msg.state == "done" then update_led_status(cb, "broadband", ""ping_ok", "timerled", "green-blink") But it gets overwrited every update, therefore I cannot test if this stops the led from blinking

Ansuel commented 5 years ago

@lorenzocanale-LC nice find !

lorenzocanalelc commented 5 years ago

I don't know what is wrong but the file doesn't get updated

lorenzocanalelc commented 5 years ago

Found the problem, ledfw_support-specificDGA4131.tar.bz2 is not present in the GUI package

Ansuel commented 5 years ago

WAT!!!!

lorenzocanalelc commented 5 years ago

I don't know how CircleCI works, but in modular there is no trace of DGA4131

Ansuel commented 5 years ago

Yes my bad... never added the new dir to the shell file

lorenzocanalelc commented 5 years ago

Ok, I discovered something new on the leds behavior, first of all this voice is necessary under ledfw config file in order to make led work properly.

config led 'broadband'
  option provisioning_status 'completed'

I suggest putting

uci set ledfw.broadband.provisioning_status=completed
uci commit

On the led rework script for the DGA4131. Second the restart_leds script breaks led on the DGA4131, since it keeps doing the presentation until reboot. EDIT: Also the /usr/lib/lua/ledframework/ubus.lua file didn't get updated by the GUI probably because it exported only stateMachines on the specific script bzcat "/tmp/ledfw_support-specific$1.tar.bz2" | tar -C / -xf - etc/ledfw/stateMachines.lua

FrancYescO commented 5 years ago

are you talking about /usr/share/transformer/scripts/restart_leds.sh ?

probably the rpc.network. mapper need more attention for this device...

should be okay now for ubus file extract and provisioning_status

lorenzocanalelc commented 5 years ago

Yes ubus now works and provisioning is now ok. Yes I'm talking about that /usr/share/transformer/scripts/restart_leds.sh. I suspect is that is related to the network.interface because if I send this command

ubus send network.interface '{"interface":"wan","action":"ifdown"}'

and then this

ubus send network.interface '{"interface":"wan","action":"ifup"}'

Leds works again

EDIT:Never mind the rpc.network is not responsible of this

lorenzocanalelc commented 5 years ago

Okay, I found how to fix the restart_leds on the DGA4131, it needs ubus send network.interface '{"interface":"wan","action":"ifdown"}' before the ubus send network.interface '{"interface":"wan","action":"ifup"}' So you could add this line

ubus send network.interface "{\"action\":\"if$wan_status\",\"interface\":\"$iface\"}"

after this

#Restore Internet LED status
for iface in "wan" "wwan"
do
    wan_status="down"

On the restart_leds script

lorenzocanalelc commented 5 years ago

When opening Wireless Time Control the GUI returns this Internal Server Error occured, please contact administrator logread reports

Sat Jul 13 20:49:03 2019 daemon.err nginx: 2019/07/13 20:49:03 [error] 4838#0: *33 lua entry thread aborted: runtime error: /usr/lib/lua/web/taint.lua:301: bad argument #1 to 'gmatch' (string expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function 'gmatch'
    /usr/lib/lua/web/taint.lua:301: in function 'gmatch'
    [string "/modals/tod_wireless-modal.lp"]:366: in function 'content'
    /usr/lib/lua/web/web.lua:264: in function 'process'
    content_by_lua(nginx.conf:163):4: in function <content_by_lua(ngin
lorenzocanalelc commented 5 years ago

On the ECO Tab this error appears, and the ambient setting doesn't work

Exact data not found in this paths: 
Key ledfw_ambient_pattern : uci.ledfw.ambient.pattern
FrancYescO commented 5 years ago

please output of transformer-cli get uci.ledfw.

lorenzocanalelc commented 5 years ago

root@OpenWrt:~# transformer-cli get uci.ledfw. uci.ledfw.internet.check [string] = 1 uci.ledfw.iptv.check [string] = 1 uci.ledfw.status_led.enable [string] = 0 uci.ledfw.timeout.ms [string] = 200 uci.ledfw.voip.check [string] = 1 uci.ledfw.wifi.nsc_on [string] = 1

FrancYescO commented 5 years ago

cat /rom/etc/config/ledfw

lorenzocanalelc commented 5 years ago

root@OpenWrt:~# cat /rom/etc/config/ledfw config service 'internet' option check '1'

config service 'iptv' option check '1' option itf 'iptv'

config service 'voip' option check '1'

config timeout 'timeout' option ms '5000'

config led 'ambient' option active '1'

FrancYescO commented 5 years ago

could you check now?

what status will remain after upgrade? (GUI upgrade?) ambient loop?

try issuing these commands and let me know how (and if..) the led status change

ubus send fwupgrade '{ "state": "done" }'
ubus send fwupgrade '{ "state": "flashing" }'
ubus send fwupgrade '{"state":"upgrading"}'
ubus send fwupgrade '{ "state": "failed" }'
lorenzocanalelc commented 5 years ago

The ambient switch in the eco pannel now works, but it doesn't turn on or off the ambient, only restart the leds without change. After the upgrade the broadband led keeps flashing green ubus send fwupgrade '{"state":"upgrading"}' makes the broadband led blinking green (like on the update) ubus send fwupgrade '{ "state": "done" }' this after ubus send fwupgrade '{"state":"upgrading"}' turns ambient on (as if the leds were all off) but the broadband led keeps flashing ubus send fwupgrade '{ "state": "flashing" }' No effect ubus send fwupgrade '{ "state": "failed" }' broadband red led blinking and then off (this is the only way to stop the green flashing after upgrading)

FrancYescO commented 5 years ago

cp /rom/sbin/status-led-eventing.lua /sbin/status-led-eventing.lua

than try behaviour of restart_led script and ubus commands for upgrade

lorenzocanalelc commented 5 years ago

There isn't any visible change

lorenzocanalelc commented 5 years ago

I fixed it, just add this line fwupgrade_state_done = "green_solid", on the stateMachines.lua after this

            writing_firmware_green_flashing_quickly = {  --status: writing firmware
                fwupgrade_state_failed = "serviceko_red_flashing",
        fwupgrade_state_done = "green_solid",
            }
lorenzocanalelc commented 5 years ago

stateMachines.lua.zip This is the working stateMachines

lorenzocanalelc commented 5 years ago

I think ambient led can only be set by these two commands: ubus send ambient.status '{"state":"active"}' and ubus send ambient.status '{"state":"inactive"}'. Ledfw config files is only used as reference for the current status by the original firmware, changing config file doesn't really do anything. Therefore the GUI ambient switch you introduced should send those command instead of writing on the ledfw file. I discovered by looking at the Tod config generated by the original gui which uses a "ledtodscript" for the ambient timer. I attach them for reference LedTod.zip

FrancYescO commented 5 years ago

Sending these command is a temp solution until a reboot, what i'm trying to do is to replicate what the official GUI was doing..

lorenzocanalelc commented 5 years ago

Ok, I found the option is

option active '0' off
option active '1' on

But it works only after cp /rom/sbin/status-led-eventing.lua /sbin/status-led-eventing.lua