Closed lorenzocanalelc closed 4 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
debug ledfw is a reale pain....
anyway i think we should first fix the wifi config and the ethernet.
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
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 .
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
it would be better to fix it
Is there anything I can do to help fixing it?
list all the problems in details and what should happen
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 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.
can yu give me a dump of the firmware?
dd if=/dev/mtd3 of=/tmp/mtd3 and give me mtd3 file in /tmp
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?
it's very strange that the gui replace the leds file...
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
can give me output of this ?
uci get -q env.var.prod_friendly_name
MediaAccess DGA4131FWB
you are using dev build right?
Yes
can you give me output of upgradegui ?
Oh you were right it doesn't change the stateMachines.lua file, only the ubus.lua file which breaks the leds
ok i don't need upgradegui
👍
should be good now
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.
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
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
@lorenzocanale-LC nice find !
I don't know what is wrong but the file doesn't get updated
Found the problem, ledfw_support-specificDGA4131.tar.bz2 is not present in the GUI package
WAT!!!!
I don't know how CircleCI works, but in modular there is no trace of DGA4131
Yes my bad... never added the new dir to the shell file
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
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
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
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
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
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
please output of transformer-cli get uci.ledfw.
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
cat /rom/etc/config/ledfw
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'
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" }'
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)
cp /rom/sbin/status-led-eventing.lua /sbin/status-led-eventing.lua
than try behaviour of restart_led script and ubus commands for upgrade
There isn't any visible change
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",
}
stateMachines.lua.zip This is the working stateMachines
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
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..
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
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
How to reproduce (if possible): Install the GUI on DGA4131