Quallenauge / Easybox-904-XDSL

Fork of openwrt with vendor specific changes from open sourced firmware 3.10.
GNU General Public License v2.0
20 stars 8 forks source link

DSL actually working? #6

Open majuss opened 6 years ago

majuss commented 6 years ago

Hi there!

When I enter all my DSL credentials via PPPoE, hit save and apply and reconnect the dsl0 interface, nothing happens and the box can't login into the DSL connection.

Should this be working right now or is it still work in progress?

majuss commented 6 years ago

ohne titel1 ohne titel3 ohne titel4

So I figured that the configuration of the virtual switch (with the VLAN ID 7) is somewhat the problem. But I'am not experienced enough to set this switch up. Could somebody please help?

majuss commented 6 years ago

So this is the output of ifconfig on a original FW easybox. I think with that information someone could reconstruct the Switch settings for openWRT.

What is also wierd: The data rate shows only 20 Mbit... but it should be 100/40 :(

root@easy:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr XXX
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:624541 errors:0 dropped:0 overruns:0 frame:0
          TX packets:370049 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:56594044 (53.9 MiB)  TX bytes:81366278 (77.5 MiB)

br-lan1   Link encap:Ethernet  HWaddr YYY
          inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24690 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:1482544 (1.4 MiB)

eth0      Link encap:Ethernet  HWaddr XXX
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4391218 errors:0 dropped:117 overruns:0 frame:0
          TX packets:13245353 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:556435907 (530.6 MiB)  TX bytes:113289512 (108.0 MiB)

eth0.66   Link encap:Ethernet  HWaddr XXX
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:978680 errors:0 dropped:0 overruns:0 frame:0
          TX packets:370052 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:184983722 (176.4 MiB)  TX bytes:82846724 (79.0 MiB)

eth0.71   Link encap:Ethernet  HWaddr YYY
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24692 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:1581480 (1.5 MiB)

imq1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          UP RUNNING NOARP  MTU:16000  Metric:1
          RX packets:329062 errors:0 dropped:0 overruns:0 frame:0
          TX packets:329058 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:11000
          RX bytes:33462241 (31.9 MiB)  TX bytes:33462033 (31.9 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:57415 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57415 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8897588 (8.4 MiB)  TX bytes:8897588 (8.4 MiB)

ppp50     Link encap:Point-to-Point Protocol
          inet addr:AAA  P-t-P:AAA  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:144027 errors:0 dropped:0 overruns:0 frame:0
          TX packets:328961 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:63227971 (60.2 MiB)  TX bytes:33426084 (31.8 MiB)

ptm0      Link encap:Ethernet  HWaddr ZZZ
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12817835 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3774190 errors:0 dropped:12 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:547722283 (522.3 MiB)  TX bytes:54648004 (52.1 MiB)

ptm0.7    Link encap:Ethernet  HWaddr ZZZ
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:160123 errors:0 dropped:0 overruns:0 frame:0
          TX packets:345062 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:65696950 (62.6 MiB)  TX bytes:42526629 (40.5 MiB)

ra0       Link encap:Ethernet  HWaddr XXY
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ra1       Link encap:Ethernet  HWaddr XXY
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

rai0      Link encap:Ethernet  HWaddr XXZ
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

rai1      Link encap:Ethernet  HWaddr XYZ
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Quallenauge commented 6 years ago

Hi there. Sadly the ifconfig doesn't show the switch settings. Also some settings are set within the vendor kernel. At least I was able to connect to the T-DSL VDSL provider with low speed (20MB/s). I'm not sure, but I guess the speed is a limitation from the used vdsl modem. Maybe a newer release would help, but I don't know. lantiq-vdsl-fw: update to provide recent vectoring firmware I have a look how the setting was made for this, I think it was close to your settings. Try to set also the CPU port 0 to "tagged", see here: https://telekomhilft.telekom.de/t5/Telefonie-Internet/Wie-OpenWRT-Router-am-FTTH-Anschluss-betreiben/td-p/2283926

majuss commented 6 years ago

How did you manage to login?! I tried every combination with and without # etc. it never worked... Could you implement the new modem firmware to your openWRT release?

Quallenauge commented 6 years ago

I think, exactly as described within the post I previously linked. Newer builds should contain the vdsl firmware, but I haven't tried that. https://app.box.com/s/hvqg535dnubt4r2ontpmtodpvt6ydf00/folder/36913951101

majuss commented 6 years ago

I tried the latest image, but no luck. Still 20 mbit and the version is very buggy. Always crashes when you try edit the config. Still couldn't log into my DSL, even with all of the switch settings like in the forum post.

Quallenauge commented 6 years ago

Sorry, I don't develop LuCI so I can't help with this. Maybe a newer version might be better. Also the kind how the switches are connected together isn't and straight forward. (You can easily lock out yourself from the device and have to use the recovery.)

majuss commented 6 years ago

I tried the latest version from 4th of july but no luck, can't log the ppoe in. I cant add a new VLAN id, when I click the add button nothing happens. And its still at 20 mbit.

These are all VLAN settings from a working EB conencted with telekom VDSL with the original image.

enable_vlan@vlan = 1
lan_netdevice@vlan = eth0
wan_netdevice@vlan = eth1
switch_port_num@vlan = 8
logical_port_num@vlan = 7
logical_total_port_num@vlan = 8
logical_cpu_port@vlan = 6
port_phyconf@vlan = 0 0 0 0 5 4 6 7
max_vlan@vlan = 4
lan_vlan_id@vlan = 66
lan_port@vlan = 0 1 2 3 4
wan_port@vlan = 5
wlan_port@vlan = 4
active_vlan@vlan = 3
vlan1_name@vlan = default LAN
vlan2_name@vlan =
vlan3_name@vlan =
vlan4_name@vlan =
vlan1_id@vlan = 71
vlan2_id@vlan = 66
vlan3_id@vlan = 66
vlan4_id@vlan = 4
vlan1_tagged@vlan = 1
vlan2_tagged@vlan = 0
vlan3_tagged@vlan = 1
vlan4_tagged@vlan = 0
vlan1_port@vlan = 4
vlan2_port@vlan = 0 1 2 3
vlan3_port@vlan = 4
vlan4_port@vlan =
vlan1_ssid@vlan = 0
vlan2_ssid@vlan =
vlan3_ssid@vlan =
vlan4_ssid@vlan =
vlan1_brwan@vlan = 0
vlan2_brwan@vlan = 0
vlan3_brwan@vlan = 0
vlan4_brwan@vlan = 0
vlan1_bind_rtwan@vlan = 0
vlan2_bind_rtwan@vlan = 0
vlan3_bind_rtwan@vlan = 0
vlan4_bind_rtwan@vlan = 0
wan_lan_share@vlan = 0
vlan_tagged@lan0 = 0
vlan_1p@lan0 = 0
vlan_id@lan0 = 0
vlan_tagged@lan1 = 0
vlan_1p@lan1 = 0
vlan_id@lan1 = 0
vlan_tagged@wan100 = 1
vlan_id@wan100 = 132
vlan_tagged@wan101 = 1
vlan_id@wan101 = 232
vlan_tagged@wan102 = 1
vlan_id@wan102 = 332
vlan_tagged@wan000 = 0
vlan_id@wan000 = 0
vlan_tagged@wan001 = 0
vlan_id@wan001 = 0
vlan_tagged@wan002 = 0
vlan_id@wan002 = 0
vlan_tagged@wan050 = 1
vlan_id@wan050 = 7
vlan_tagged@wan051 = 1
vlan_id@wan051 = 232
vlan_tagged@wan052 = 1
vlan_id@wan052 = 332
vlan_tagged@wan300 = 0
vlan_id@wan300 = 5
vlan_tagged@wan301 = 1
vlan_id@wan301 = 3
vlan_tagged@wan302 = 1
vlan_id@wan302 = 5
vlan_tagged@wan303 = 0
vlan_id@wan303 = 5
vlan_tagged@wan200 = 0
vlan_id@wan200 = 0
Quallenauge commented 6 years ago

I just tried to get DSL running, with success. Try the following: nano /etc/config/network

Add the following

config switch_vlan
        option device 'switch0'
        option vlan '7'
        option ports '4t'
        option vid '7'

Update the dsl section from

config interface 'wan'
        option ifname 'dsl0'
        option proto 'pppoe'
        option ipv6 '1'
...

to

config interface 'wan'
        option ifname 'dsl0.7'
        option proto 'pppoe'
        option ipv6 '1'
...

Reboot. As DSL firmware I used the vr9_dsl_fw_annex_b.bin (20MBit/s Downstream only). There's also a firmware version which can be downloaded with vdsl_fw_install.sh it connects after a while with ~100MBit/s Downstream but reconnects after a few seconds. Maybe another FW will help.

majuss commented 6 years ago

Thanks for the help with the VLAN setup! I finally got everything working also with 100 Mbit, connection was stable for 6 minutes, intense download, tomorrow I will test it in the long run. What I did:

wget http://download.avm.de/fritzbox/fritzbox-7490/deutschland/fritz.os/FRITZ.Box_7490.113.06.93.image
7z e FRITZ.Box_7490.113.06.93.image -r filesystem.image
7z e filesystem.image filesystem_core.squashfs
unsquashfs4-avm-be filesystem_core.squashfs -e lib/modules/dsp_vr9/

And then use the vr9-B-dsl.bin in openWRT by copying it into lib/firmware/ and then enter the full path in the webGUI. Note that you will need the binary for unsquashfs4-avm-be you can get it by get the freetz source and run make tools.

So this uses the Firmware of a FRITZ!Box 7490 FRITZ!OS 6.93.

majuss commented 6 years ago

So after some intense testing I can say that it works, but you're not able to get 100 Mbit only ~76 Mbit/s. The sirq and ksoftirqd are then eating 100 % CPU, which indicates the CPU can't handle the interrupts fast enough. Thats a pity because everything else seems fine. Maybe I will try a different firmware.

Quallenauge commented 6 years ago

Maybe we can unleash the dual core for this at the cost of that asterisk won't work anymore.

majuss commented 6 years ago

The Asterisk is all the call handling? This would be not a big deal. How can I archieve it? Could you build a version and upload it to appbox? Otherwise I will setup an openWRT build environment :)

https://forum.lede-project.org/t/how-can-we-make-the-lantiq-xrx200-devices-faster/9724 This thread is also quite interesting... They state that the original vendors can use other hw acc. features to get the full 100 Mbit.

Quallenauge commented 6 years ago

I can try to provide an experimental one...

majuss commented 6 years ago

That would be awesome :) I tested 100 Mbit with the Vodafone firmware and the sirq raises to 70%.

But another big problem is the WLAN of the easybox... It's unusable with the webinterface. You can only set WEP and nothing else, changig the password also is not working therefore WLAN is completely unusable for normal users. Can a working WLAN network be setted up via ssh?

henning-schild commented 6 years ago

Can this issue be closed? I managed to get DSL working with VLAN as well, this box is not any different than any other OpenWRT router that does pppoe on a VLAN. I could post my /etc/config/network in case anyone still cares.

The high load on a fast DSL could be another issue, same is true for the second core, and the wifi interface to luci.

majuss commented 6 years ago

I will maybe open two other issues for the high CPU usage and one for the WLAN. And yes this can get closed. Is there somekind of official documentation for the VLAN pppoe?

ghost commented 6 years ago

It would be great if you could post your /etc/config/network file. Right now I still have trouble during compilation. (Prebuilt did not work for me, all changes on the Router were deleted after reboot).

But your /etc/config/network could really help me in the future.

Thanks in advance and Prost! (Cheers!)

henning-schild commented 6 years ago

This is for a dslite setup so it looks different to what you will need. Some things might not be required. The key is the ifname in wan . Note that i did not have to add the vlanid (40) to the switch. I just touched "dsl" "wan" "wan6" "wan4"

config dsl 'dsl'
    option annex 'b'
    option tone 'av'
    option xfer_mode 'ptm'
    option line_mode 'vdsl'
    option firmware '/lib/firmware/lantiq-vrx200-b.bin'
...
config interface 'wan'
    option ifname 'dsl0.40'
    option proto 'pppoe'
    option ipv6 '1'
    option username '..'
    option password '..'
    option mtu '1492'

config device 'wan_dev'
    option name 'dsl0'
    option macaddr '..'

config interface 'wan6'
    option proto 'dhcpv6'
    option ifname '@wan'

config interface 'wan4'
    option proto 'dslite'
    option peeraddr '..'
    option mtu '1444'
    option encaplimit 'ignore'
...
majuss commented 6 years ago

Any news regardign the sirq problem? I'am ready to test some build, or build them by myself if somebody can guide me a little.

Quallenauge commented 6 years ago

Any news regardign the sirq problem? I'am ready to test some build, or build them by myself if somebody can guide me a little.

At least I added some builds with "smp" as prefix, which enables the second core.

icke68746 commented 6 years ago

I would also test the new version. I had the bootloop, the last two versions of https://app.box.com/s/hvqg535dnubt4r2ontpmtodpvt6ydf00/folder/36913951101 Hans Mueller. Furthermore, I can't use the WLAN and the DSL, it can also be due to a wrong DSL setting, the original firmware did a lot by itself, I still have to get used to it. @Quallenauge I cannot compile the image. Could you provide the image?

Translated with www.DeepL.com/Translator

Ich würde die neue Version auch testen. Bei mir kam es zum Bootloop, bei den letzten beiden Versionen von https://app.box.com/s/hvqg535dnubt4r2ontpmtodpvt6ydf00/folder/36913951101 Hans Mueller. Des Weiteren kann ich das WLAN und das DSL nicht in Betrieb nehmen, es kann auch an einer falschen Einstellung bei DSL liegen, die Original-Firmware hat vieles selbst gemacht, da muß ich mich noch einarbeiten. @Quallenauge Ich kann das Image nicht kompilieren. Könntest Du das Image zur Verfügung stellen?

majuss commented 6 years ago

Since 30.8. the image contains smp, see the files in the directory. Maybe thats what causes the bootloop. We would need to connect a serial console and look into the bootlog.

I quickly tested the newest build from 2. of september. Not working at all, you can't reboot the device, without it resetting itself. Even ssh thinks it's a new host, so it does a factory reset at every boot.

@icke68746 I didn't got any bootloops or anything.

majuss commented 5 years ago

So after some intense testing hours I can say that you first have to flash the stock image, then the openWrt recovery image, upload the NON-SMP image and flash it via the webinterface. Boot into the NON-SMP fw and then flash the SMP firmware from there. Everything else is creating a zombie-Wrt. I will publish a guide for that exhausting procedure in my repo very soon. 100 Mbit, WLAN etc. is working fine!

henning-schild commented 5 years ago

@majuss it might be more useful to understand why the smp image can not be flashed directly and fix that, maybe bisection could give a clue

Quallenauge commented 5 years ago

That's really weird that this doesn't work :-( I thought I switched from normal to smp and vice versa in the past without such problems. Sure Asterisk won't work due missing vpe cababilities but the other things should work, since the image contains all needed components (kernel + drivers). The remaining components doesn't rely on a smp/no-smp compiled kernel.

majuss commented 5 years ago

I think it has something to do with the partitioning. The SMP image can't create the partitions correctly and if you first flashed the non-SMP one the partitions are already set up in some wierd way (I hope that makes sense somehow).

Are you sure that the asterisk (so fixed line telephony?) is not working anymore? For me it seemed pretty alive :D I will maybe test it.

majuss commented 5 years ago

Still not able to get a reproducible working openWrt with smp -.-

root@OpenWrt:~# dmesg | grep mount
[    3.972340] Waiting 7 sec before mounting root device...
[   19.161224] mount_root: loading kmods from internal overlay
[   21.034874] [<801ce084>] ubifs_mount+0x1034/0x1850
[   21.039678] [<8012a06c>] mount_fs+0x20/0xc4
[   21.043839] [<8014f114>] vfs_kern_mount.part.9+0x60/0x170
[   21.049230] [<80152ab0>] do_mount+0x9dc/0xe58
[   21.053587] [<801532d4>] SyS_mount+0xb8/0xfc
[   21.149069] [<801ce084>] ubifs_mount+0x1034/0x1850
[   21.153857] [<8012a06c>] mount_fs+0x20/0xc4
[   21.158036] [<8014f114>] vfs_kern_mount.part.9+0x60/0x170
[   21.163435] [<80152ab0>] do_mount+0x9dc/0xe58
[   21.167779] [<801532d4>] SyS_mount+0xb8/0xfc
[   21.480181] CPU: 1 PID: 638 Comm: mount_root Not tainted 4.14.72 #0
[   21.571560] [<801ce084>] ubifs_mount+0x1034/0x1850
[   21.576356] [<8012a06c>] mount_fs+0x20/0xc4
[   21.580519] [<8014f114>] vfs_kern_mount.part.9+0x60/0x170
[   21.585917] [<80152ab0>] do_mount+0x9dc/0xe58
[   21.590264] [<801532d4>] SyS_mount+0xb8/0xfc
[   21.609096] CPU: 1 PID: 638 Comm: mount_root Not tainted 4.14.72 #0
[   21.686183] [<801ce084>] ubifs_mount+0x1034/0x1850
[   21.690979] [<8012a06c>] mount_fs+0x20/0xc4
[   21.695148] [<8014f114>] vfs_kern_mount.part.9+0x60/0x170
[   21.700544] [<80152ab0>] do_mount+0x9dc/0xe58
[   21.704896] [<801532d4>] SyS_mount+0xb8/0xfc
[   21.728806] mount_root: failed to mount -t ubifs /dev/ubi0_1 /tmp/overlay: Bad message
[   23.182035] [<801ce084>] ubifs_mount+0x1034/0x1850
[   23.186839] [<8012a06c>] mount_fs+0x20/0xc4
[   23.191002] [<8014f114>] vfs_kern_mount.part.9+0x60/0x170
[   23.196402] [<80152ab0>] do_mount+0x9dc/0xe58
[   23.200748] [<801532d4>] SyS_mount+0xb8/0xfc
[   23.296232] [<801ce084>] ubifs_mount+0x1034/0x1850
[   23.301024] [<8012a06c>] mount_fs+0x20/0xc4
[   23.305197] [<8014f114>] vfs_kern_mount.part.9+0x60/0x170
[   23.310593] [<80152ab0>] do_mount+0x9dc/0xe58
[   23.314944] [<801532d4>] SyS_mount+0xb8/0xfc
[   23.340512] mount_root: unable to set filesystem state
[   23.344460] mount_root: switching to ubifs overlay
[   23.349311] mount_root: switching to ubifs failed - fallback to ramoverlay
root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

The overlay fs cant mount and so the config is getting lost after reboot.

majuss commented 5 years ago

@Quallenauge could you look into the issue or hint me in a direction? I'am somewhat lost right now.

Quallenauge commented 5 years ago

Not really. But can you let me know the steps in detail how to to reach your current state; what steps are needed (in detail please). Actually I use the non-smp version.

majuss commented 5 years ago

This is my current step by step guide but it's mostly unusable for you because it's for abolute newcomers. You basically can flash the SMP image and it will not work.


Prerequisities:

Step by step guide for openWrt installation.

If you already have a computer with Linux and a working internet connection with it, jump to step 4.

  1. Create a working Ubuntu Live-stick according to this guide and shutdown your computer when finished.
  2. Start your computer with the stick plugged in. Ubuntu should now start. Click on "try Ubuntu" never ever install Ubuntu on your machine! You will loose all your data!
  3. Test you Internet connection in Ubuntu by opening a browser and go to github.com/majuss/easybox904.
  4. First of all we need to install the needed software. Open a terminal and enter: sudo apt update to update the package index. Then run: sudo apt install git autoconf g++ pkg-config libz-dev gcc-multilib g++-multilib make automake gawk libtool libtool-bin bison flex libncurses5-dev imagemagick libacl1-dev libcap-dev tftp-hpa tftpd-hpa net-tools ssh -y.
  5. After that we have to install bsdiff and 7zip manually by downloading the package: wget http://launchpadlibrarian.net/293344635/bsdiff_4.3-19_amd64.deb and then run: sudo dpkg -i bsdiff_4.3-19_amd64.deb. And run: wget http://launchpadlibrarian.net/328946338/p7zip-full_16.02+dfsg-4_amd64.deb and sudo dpkg -i p7zip_16.02+dfsg-6_amd64.deb. Just ignore the error messages
  6. Then clone the freetz repository: git clone https://github.com/Freetz/freetz.git freetz-devel.
  7. Change your working directory into freetz-devel with: cd freetz-devel and run make tools. If the make command does fail some requirements are missing, just google for the error message or open an issue. The compiling should take some time.
  8. After the tools were successfully build keep the terminal open and go to your browser. Visit the website: https://ftp.avm.de/fritzbox/fritzbox-7490/deutschland/fritz.os/in a browser and copy the download link of the latest image file. Now go back to the terminal and enter: wget and paste the download link (mind the gap between command and URL) and hit enter.
  9. We now extract the download image with multiple tools. First of all with 7zip: p7zip e Downloads/FRITZ.Box_7490.*.image -r filesystem.image and once again: 7z e filesystem.image filesystem_core.squashfs. Now we are using the unsquash utility from freetz: tools/unsquashfs4-avm-be filesystem_core.squashfs -e lib/modules/dsp_vr9/. You can now find the modem-firmware in squashfs-root/lib/modules/dsp_vr9. We only need to patch it with: cd squashfs-root/lib/modules/dsp_vr9/ then: bspatch vr9-B-dsl.bin vr9-A-dsl.bin vr9-A-dsl.bin.bsdiff and bspatch vr9-B-dsl.bin release-vr9-B-dsl.bin release-vr9-B-dsl.bin.bsdiff. Congratulations, the hard part is done.
  10. Now we can flash the OpenWrt starter-image to the EasyBox. Download the newest starter-image (fullimage) from here
  11. Also download the most recent firmware images from: https://app.box.com/s/hvqg535dnubt4r2ontpmtodpvt6ydf00/folder/36913951101 download DATE_openwrt-lantiq-xrx200-lantiq_vgv952cjw33-e-ir-squashfs-sysupgrade.bin AND the one which ends with .bin_smp: DATE_openwrt-lantiq-xrx200-lantiq_vgv952cjw33-e-ir-squashfs-sysupgrade.bin_smp.
  12. Now pull your LAN caple from your linux machine and disable WIFI. Click the grid icon in the bottom left corner of your desktop and enter settings to open the system settings. Then in the network tab click the gear icon behind your eno1 interface. Then go to IPV4 and choose manual. Enter 192.168.2.100 as IP and 255.255.255.0 as Netmask, leave everything else blank.
  13. Now run: sudo cp Downloads/fullimage.img /var/lib/tftboot in a new Terminal window to copy the firmware image to the tftp-directory (close the old one).
  14. Connect your EasyBox (yellow port) with your PC with a LAN cable. Turn the box on while pressing the reset button. Release the button after 5 seconds. You now should see the red recovery screen. When it states that rescue process is complete, turn it off and on.
  15. Change the IP addres of your computer to 192.168.1.2 (see step 12 on howto) and the gateway to 192.168.1.1. Always check in the terminal if the IP was really set successfull with: ifconfig. If it wasn't close and open the settings menu again and turn off the LAN and turn on again til the IP was set.
  16. Now open a browser and browse to: 192.168.1.1 click the Browse button and choose the image WITHOUT smp from your downloads directory. Click Flash Image and wait. Then on the new site click Proceed. The router will now flash the firmware image. Wait 5 minutes and then open the website https://192.168.1.1 in a private window of firefox to avoid caching problems. He will tell you that the connection is not secures. Just hit Advanced -> Add exception -> Confirm Security Exception.
  17. You're now on the openWrt webinterface. Just hit the Login button and then choose System -> Backup/Flash Firmware. Uncheck the check-mark at the bottom and click the Browse button. Now choose the image WITH smp and hit Flash image after that Proceed.
  18. Just wait until the website refreshs and hit the login button.
  19. Now open a terminal and run: ssh root@192.168.1.1 type yes and hit enter. You now are connected to the EasyBox via the terminal.
  20. Run: nano /etc/config/network and scroll with the arrow keys to the section: config interface 'wan'. Enter your ISP-login to option username. For Telekom customers it is: [Anschlusskennung][T-Onlinenummer]#0001@t-online.de and your password into option password. Also set the ipv6 option at the bottom to 0. Then comment out the complete section config interface 'wan6' like so:
    #config interface 'wan6'
    #   option ifname '@wan'
    #   option proto 'dhcpv6'

    This disables IPV6 completely which is not needed in private networks. Then scroll to the bottom and paste the following switch config:

    config interface 'wan'
        option ifname 'dsl0.7'
        option proto 'pppoe'
        option ipv6 '0'

    Exit nano by hitting strg + x and then y and enter. Then type the command passwd root and enter a new password for your box which is also used in the webinterface. Now simply type reboot and hit enter.

  21. Your easybox is now successfully setted up. You can reach it's webinterface at https://192.168.1.1

Since the firmware for the EasyBox modem (lantiq xrx200) is closed source and licensed I'am not able to upload it here. We will extract the firmware from a firmware image of a Fritz!Box 7490 (If you want another firmware, check this page: https://xdarklight.github.io/lantiq-xdsl-firmware-info/)


majuss commented 5 years ago

So any news? Did you had the chance to try the smp image?

Did this commit (https://github.com/Quallenauge/Easybox-904-XDSL/commit/18cddf8148b14f3f11b02bedab379498f8449724) maybe fixed the problem with attaching the ubifs? Could you please provide new images.

Quallenauge commented 5 years ago

Hi there, I think with the latest patches fomr @arnysch the smp should work now. ~Should I compile and upload a new image or do you test this by yourself?~ Update: Ok :) I upload a new one next days.

majuss commented 5 years ago

I compiled one myself yesterday but the Box was bricked when applying the image. Maybe I need to reflash the original fw, fullimage and then upload the SMP image. I will test it today.

arnysch commented 5 years ago

Hi majuss, I guess you have no console connected to the internal serial connector. Because this is the best thing for debugging. I myself 'bricked' the box several times when coding and debugging my changes, but with console access it was very easy for me to fix this. I have the feeling that installing an UBI system is a delicate thing. Without the possibility to debug we are in the dark. Anyway, I guess your suggestion is the best you can do for the moment.

majuss commented 5 years ago

I have a serial console and I know how to connect it, but I could just wait til Quallenauge releases a compiled image :D I guess my config was a little of and thats why it don't boot.

arnysch commented 5 years ago

That's good. As I perpetrated the recent changes, I am eager to hear how they work out. If you are up to it, when flashing/upgrading, you could connect a console and save a log. Just in case it fails...

majuss commented 5 years ago

I'm also very ecited because the easybox would get a reliable character :) I'am up for debugging when stuff goes bad.

majuss commented 5 years ago

The latest snapshot from 26th of november is resulting in the same bootloop as my own image. So I guess it's debugging time... If I find the time I will upload the bootlog tomorrow.

Quallenauge commented 5 years ago

Hi! I connected my development box and was trying to update from a previous version - with no luck. It is complaining about the wrong ubi VID header, which was previously set to 2048 and is now 512 due the recent patches (which are more streamlined, though).

[    3.444198] UBI: auto-attach mtd12
[    3.446509] ubi0: attaching mtd12
[    3.450047] ubi0 error: validate_ec_hdr: bad VID header offset 2048, expected 512
[    3.457279] ubi0 error: validate_ec_hdr: bad EC header

and crashes.

Update 1: I tried the fullimage from @arnysch fullimage.img to restore the image with no luck. It indeed reformats the partition and reboots. Now I get __nand_correct_data: uncorrectable ECC error.... Performing a `dd if=/dev/zero of=/dev/mtd12 bs=2M' now.

Update 2: As I read, dd was a bad idea. The mtd is stressed now a little bit.... ;) Anyway, @arnysch I following your steps at: http://arny.tjps.eu/OpenWrt/EasyBox904xDSL/U-Boot/NAND-Subpage-Size.txt

# ubiformat /dev/mtd12 -y
....
# reboot
....
# mount  -t ubifs  /dev/ubi0_0  /mnt/
[  143.809023] UBIFS (ubi0:0): default file-system created
[  143.814118] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1520
[  143.897082] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "MyImportantStuff"
[  143.903989] UBIFS (ubi0:0): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[  143.913925] UBIFS (ubi0:0): FS size: 303335424 bytes (289 MiB, 2351 LEBs), journal size 15224832 bytes (14 MiB, 118 LEBs)
[  143.924930] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[  143.931530] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 2277914E-2369-408A-976E-34E4E9540FB7, small LPT model
root@OpenWrt:/sys/class/mtd# echo 'Hello World!'  > /mnt/echo.txt
root@OpenWrt:/sys/class/mtd# umount /mnt
[  158.701398] UBIFS (ubi0:0): un-mount UBI device 0
[  158.704801] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stops
root@OpenWrt:/sys/class/mtd# ubidetach -m 12
[  163.607859] ubi0: detaching mtd12
[  163.612685] ubi0: mtd12 is detached
root@OpenWrt:/sys/class/mtd# ubiattach -m 12
[  203.758616] ubi0: attaching mtd12
[  203.855677] __nand_correct_data: uncorrectable ECC error
[  203.859675] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 525:0, read only 64 bytes, retry
[  203.871001] __nand_correct_data: uncorrectable ECC error
[  203.876297] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 525:0, read only 64 bytes, retry
[  203.887662] __nand_correct_data: uncorrectable ECC error
[  203.892921] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 525:0, read only 64 bytes, retry
[  203.904256] __nand_correct_data: uncorrectable ECC error
[  203.909517] ubi0 error: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 525:0, read 64 bytes
[  203.919576] CPU: 1 PID: 1526 Comm: ubiattach Not tainted 4.14.78 #0
[  203.925775] Stack : 00000000 0000020d 870df200 8007b3fc 80650000 805f81bc 00000000 00000000
[  203.934127]         805becd8 870cbc5c 875c4cec 80632687 805b9e70 00000001 870cbc00 74ab3c53
[  203.942486]         00000000 00000000 80970000 00010000 00000000 00000000 00000007 00000000
[  203.950839]         000000f6 ac800000 000000f5 00000000 80000000 80650000 00000000 00000000
[  203.959195]         00000000 041a0000 00000000 0000020d 00000002 00000000 00000004 80960004
[  203.967550]         ...
[  203.969982] Call Trace:
[  203.972455] [<80011404>] show_stack+0x58/0x100
[  203.976901] [<804af374>] dump_stack+0xe4/0x120
[  203.981345] [<80310798>] ubi_io_read+0x248/0x330
[  203.985951] [<80310b14>] ubi_io_read_ec_hdr+0x8c/0x228
[  203.991087] [<80316a3c>] ubi_attach+0x1e4/0x1528
[  203.995692] [<8030a02c>] ubi_attach_mtd_dev+0x6a4/0xc28
[  204.000921] [<8030b820>] ctrl_cdev_ioctl+0xdc/0x1d0
[  204.005789] [<80142bd8>] do_vfs_ioctl+0x7b4/0x854
[  204.010494] [<80142cc8>] SyS_ioctl+0x50/0x98
[  204.014759] [<8001c118>] syscall_common+0x34/0x58
....
^C[  207.510005] ubi0: scanning is finished
[  207.512821] ubi0 error: ubi_read_volume_table: the layout volume was not found
[  207.520727] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd12, error -22
arnysch commented 5 years ago

To narrow down the problem, some questions:

There was a problem with the fb_ili9341_eb904.ko driver for the display: it used the ebu bus at the same time as the nand driver, thereby corrupting nand data while writing. This is (hopefully) fixed with the latest commit in the lede-feeds-easybox904 repository. The saga is recorded here.

Apropos: in the meantime I am relaxed about nand wear. I have rewritten my mtd12 maybe 30 times. Samsung claims "extended reliability of 100K program/erase cycles by providing ECC(Error Correcting Code)". Though I wonder: does this mean 100K cycles per every erase block, or is it the total for all blocks?

Quallenauge commented 5 years ago

Did you erase mtd12 before ubiformatting? (though I think this is usually not necessary)

First, I tried to update from my previous image, which has the 2048 as VID header. After a reboot there where many complaints and errors - the kernel (which is now upstreamed to 512) wasn't able to handle the new UBI format. I expected this. So I don't compiled a new image, but I used the fullimage.img from your site (see link above). So I don't think the fb904.ko is included there and causes some confusions - or?

Good to know about the mtd lifetime, but I have some bad blocks already so I think the mtd is getting slowly aging ;) But this isn't a problem for me now.

Did you erase mtd12 before ubiformatting? (though I think this is usually not necessary)

I was using dd, and since the flash_eraseall command was not compiled in. I thought it would be sufficient, but you're right, I should try this! (Yesterday I came to the point, that I have only to scp' this command to the box to be able to test this).

arnysch commented 5 years ago

Hi Qauge, in case you wonder about some of my questions: I missed that it is you who reported the problem. I thought it were majuss. Did not read careful, and it was just too late last night...

Quallenauge commented 5 years ago

No problem at all =) The main goal is that we hopefully we can track down this, so if others encounter this too, we could help! Not to mention that I'm able (after solving this issue) to test new images on my dev box =)

arnysch commented 5 years ago

I uploaded a new version of initramfs/fullimage.img which includes the nand utilities.

Wonderung what is the problem with dd and mtd? Maybe the default bs=512 causes an eraseblock completely overwritten for every 512 bytes? Then it might help to use bs=131072 perhaps?

Also does anyone know if "mtd erase" works with nand, too?

Quallenauge commented 5 years ago

Thanks! =) I tried the following commands:

flash erase /dev/mtd12 0 2448
ubiformat  /dev/mtd12
ubiattach -m 12
ubimkvol  -N MyImportantStuff  /dev/ubi0  -m
mount  -t ubifs  /dev/ubi0_0  /mnt/
echo 'Hello World!'  > /mnt/echo.txt
umount /mnt && ubidetach -m 12

After that I wanted to mount this ubi partition via ubiattach -m 12 but encountered errors:

root@OpenWrt:/# ubiattach -m 12
[  748.784744] ubi0: attaching mtd12
[  748.879419] __nand_correct_data: uncorrectable ECC error
[  748.883442] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:0, read only 64 bytes, retry
[  748.895101] __nand_correct_data: uncorrectable ECC error
[  748.900039] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:0, read only 64 bytes, retry
[  748.911762] __nand_correct_data: uncorrectable ECC error
[  748.916677] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:0, read only 64 bytes, retry
[  748.928337] __nand_correct_data: uncorrectable ECC error
[  748.933299] ubi0 error: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:0, read 64 bytes
[  748.943338] CPU: 0 PID: 1485 Comm: ubiattach Not tainted 4.14.78 #0
[  748.949513] Stack : 00000000 00000201 86c3aa00 8007b3fc 80650000 805f81bc 00000000 00000000
[  748.957865]         805becd8 87a73c5c 871a71ac 80632687 805b9e70 00000001 87a73c00 e0faf949
[  748.966221]         00000000 00000000 80980000 00010000 00000000 00000000 00000007 00000000
[  748.974577]         0000031e dd800000 0000031d 00000000 80000000 80650000 00000000 00000000
[  748.982933]         00000000 04020000 00000000 00000201 00000002 00000000 00000000 80970000
[  748.991289]         ...
[  748.993728] Call Trace:
[  748.996180] [<80011404>] show_stack+0x58/0x100
[  749.000622] [<804af374>] dump_stack+0xe4/0x120
[  749.005054] [<80310798>] ubi_io_read+0x248/0x330
[  749.009667] [<80310b14>] ubi_io_read_ec_hdr+0x8c/0x228
[  749.014804] [<80316a3c>] ubi_attach+0x1e4/0x1528
[  749.019415] [<8030a02c>] ubi_attach_mtd_dev+0x6a4/0xc28
[  749.024636] [<8030b820>] ctrl_cdev_ioctl+0xdc/0x1d0
[  749.029513] [<80142bd8>] do_vfs_ioctl+0x7b4/0x854
[  749.034209] [<80142cc8>] SyS_ioctl+0x50/0x98
[  749.038477] [<8001c118>] syscall_common+0x34/0x58
[  749.045189] __nand_correct_data: uncorrectable ECC error
[  749.049180] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:512, read only 64 bytes, retry
[  749.061058] __nand_correct_data: uncorrectable ECC error
[  749.065982] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:512, read only 64 bytes, retry
[  749.077828] __nand_correct_data: uncorrectable ECC error
[  749.082779] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:512, read only 64 bytes, retry
[  749.094691] __nand_correct_data: uncorrectable ECC error
[  749.099584] ubi0 error: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 513:512, read 64 bytes

Maybe we have to stuck with the 2048 VID header size on some devices? This works:

root@OpenWrt:/# ubiformat  /dev/mtd12 -s 2048
ubiformat: mtd12 (nand), size 320864256 bytes (306.0 MiB), 2448 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 2447 -- 100 % complete  
ubiformat: 2448 eraseblocks are supposedly empty
ubiformat: formatting eraseblock 2447 -- 100 % complete  
root@OpenWrt:/# ubiattach -m 12 -O 2048
[ 1260.165660] ubi0: attaching mtd12
[ 1260.603068] ubi0: scanning is finished
[ 1260.623196] ubi0: attached mtd12 (name "ubi", size 306 MiB)
[ 1260.627443] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1260.634283] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[ 1260.640964] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1260.647948] ubi0: good PEBs: 2448, bad PEBs: 0, corrupted PEBs: 0
[ 1260.654025] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[ 1260.661260] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 165631139
[ 1260.670297] ubi0: available PEBs: 2364, total reserved PEBs: 84, PEBs reserved for bad PEB handling: 80
[ 1260.680649] ubi0: background thread "ubi_bgt0d" started, PID 1491
UBI device number 0, total 2448 LEBs (310837248 bytes, 296.4 MiB), available 2364 LEBs (300171264 bytes, 286.2 MiB), LEB size 126976 bytes (124.0 KiB)
root@OpenWrt:/# ubimkvol  -N MyImportantStuff  /dev/ubi0  -m
Set volume size to 300171264
Volume ID 0, size 2364 LEBs (300171264 bytes, 286.2 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "MyImportantStuff", alignment 1
root@OpenWrt:/# mount  -t ubifs  /dev/ubi0_0  /mnt/
[ 1278.303449] UBIFS (ubi0:0): default file-system created
[ 1278.332898] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1496
[ 1278.393886] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "MyImportantStuff"
[ 1278.400811] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 1278.410722] UBIFS (ubi0:0): FS size: 298520576 bytes (284 MiB, 2351 LEBs), journal size 14983168 bytes (14 MiB, 118 LEBs)
[ 1278.421661] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 1278.428278] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID B5DC6CA5-DF6F-4F57-BD05-528BC13A9697, small LPT model
root@OpenWrt:/# echo 'Hello World!'  > /mnt/echo.txt
root@OpenWrt:/# umount /mnt && ubidetach -m 12
[ 1286.815612] UBIFS (ubi0:0): un-mount UBI device 0
[ 1286.819056] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stops
[ 1286.834675] ubi0: detaching mtd12
[ 1286.838998] ubi0: mtd12 is detached
root@OpenWrt:/# ubiattach -m 12 -O 2048
[ 1293.996833] ubi0: attaching mtd12
[ 1294.434360] ubi0: scanning is finished
[ 1294.455432] ubi0: attached mtd12 (name "ubi", size 306 MiB)
[ 1294.459683] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1294.466521] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[ 1294.473203] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1294.480141] ubi0: good PEBs: 2448, bad PEBs: 0, corrupted PEBs: 0
[ 1294.486282] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 1294.493498] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 165631139
[ 1294.502537] ubi0: available PEBs: 0, total reserved PEBs: 2448, PEBs reserved for bad PEB handling: 80
[ 1294.512806] ubi0: background thread "ubi_bgt0d" started, PID 1505
UBI device number 0, total 2448 LEBs (310837248 bytes, 296.4 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)

Short Info:

root@OpenWrt:/# mtdinfo /dev/mtd12
mtd12
Name:                           ubi
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          2448 (320864256 bytes, 306.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:24
Bad blocks are allowed:         true
Device is writable:             true

Kernel log:

# dmesg | grep nand
[    4.648060] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xdc
[    4.652962] nand: Samsung NAND 512MiB 3,3V 8-bit
[    4.657577] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Quallenauge commented 5 years ago

Found this... https://lists.infradead.org/pipermail/linux-mtd/2018-January/078629.html Maybe this is a hint? I got exactly the same error messages, when applying the commands listed in the patch report.

henning-schild commented 5 years ago

hey guys, could you please double check that you are still on topic with this issue. It is generally a good idea to open a new issue for new problems and keep the discussions focused.

arnysch commented 5 years ago

Oki, I continue the NAND stuff in that older other thread.

majuss commented 5 years ago

Meeh I'am having troubles with the latest image. It can only connect with 50 Mbit, I'am still using the same FritzBox 7490 modem-firmware. Any idea why it's so slow now? Tomorrow I will build a new modem-firmware from the latest beta release. screenshot 2018-12-12 at 19 37 23