devolo / dlan-openwrt

[WIP incomplete] This is the devolo dLAN package feed for OpenWrt/LEDE.
11 stars 6 forks source link

Devolo Dlan 1200 Wifi AC device (non-pro version) #3

Open SteveAyre opened 5 years ago

SteveAyre commented 5 years ago

I've successfully built openwrt 18.06.01 for the dlan-pro-1200-ac with dlan-openwrt and the MT2675 PIB & NVM driver from firmware.QCA9882-v2.2.0_2018-07-26.dv and installed this on the white non-pro version.

While it boots fine and LAN and Wireless both work I am having trouble getting PLC to work. All commands appear to give an immediate 'read timeout or network error'.

For example:

root@OpenWrt:~# /usr/bin/plctool -i "$PLC" -B"1" "$MAC"
br-lan 30:D3:2D:C3:FD:D6 Join Network
plctool: PushButton: Read timeout or network error
root@OpenWrt:~# 
root@OpenWrt:~# /usr/bin/plctool -i "$PLC" -B"join" "$MAC"
br-lan 30:D3:2D:C3:FD:D6 Join Network
plctool: PushButton: Read timeout or network error
root@OpenWrt:~# /usr/bin/plctool -i "$PLC" -B"status" "$MAC"
br-lan 30:D3:2D:C3:FD:D6 Fetch Network Status
plctool: PushButton: Read timeout or network error

Is it possible for this device to be supported? Would it require further changes to OpenWRT or should the pro target be suitable?

Any idea what would cause the Read timeout error?

dvlemplgk commented 5 years ago

Hi Steve

The plctools don't work properly on bridge interfaces, you'll have to provide the underlying eth interface where the PLC chip is connected to. In this case it's eth0. And there are stray 'br-lan' and 'Join' arguments in your commandline above. Positional parameters must be MAC addresses.

e.g. /usr/bin/plctool -i eth0 -B 1 "$MAC" /usr/bin/plctool -i eth0 -B join "$MAC"

where MAC = the mac address of the PLC chip, which is configured in the pib during boot up. You can get it with plctool -i eth0 -a

dvlemplgk commented 5 years ago

If you build the packages, the firmware and pib you extracted from firmware.QCA9882-v2.2.0_2018-07-26.dvl must be copied to the directory qca/dlan-pro-1200-ac. Firmware must have extension .nvm pib must end with -mt2675.pib (in your case for MT2675) so the package can be properly built. These names are expected by the Makefile.

The generated fwconfig file should the look similar to this: PLCFW_PATH=/lib/firmware/plc PLCFW_NVM='dlan-pro-1200-ac/MAC-7500-v2.6.0-01-NW6__-X-CS.nvm' PLCFW_PIB='dlan-pro-1200-ac/qca7500-pib15-devolo-mt2675.pib' PLCFW_PIB_2675='dlan-pro-1200-ac/qca7500-pib15-devolo-mt2675.pib' PLCFW_HOST=/usr/bin/plchost PLCFW_SCHEMES=$PLCFW_PATH/dlan-pro-1200-ac

SteveAyre commented 5 years ago

Updated codeblock formatting to separate commands and output better - they weren't stray br-lan/Join arguments but it did appear that way on a single line.

Thanks for the clarification on the br-lan vs eth0 interface.

The MAC also appears to have been the issue as plc.init detects and updates the PIB with 30:D3:2D:xx:xx:xx but plctool reports a 10:0D:7F:xx:xx:xx address.

The commands you gave work so I will now look at how to get plc-pushbtn to use the correct one.

OXINARF commented 5 years ago

@SteveAyre Nice to see someone else attempting this. I now have PLC working with latest OpenWrt stable version (18.06.1). But I haven't found how to save the security-id when using the push button - after a reboot I have to join it to the network again. @dvlemplgk any tips?

@dvlemplgk As far as I can tell, the delos firmware is no longer in development. If that is correct, would @devolo consider open sourcing parts of it? I understand that some parts are proprietary and wouldn't/couldn't be open, but other parts would be nice to have (even if they don't work/build).

dvlemplgk commented 5 years ago

@OXINARF After successful pairing the key (NMK, which is not the security-id) is saved in the PIB file (/lib/firmware/user.pib resp. user.pib.tmp) by plchost. Those files should be persistent and be used after reboot. Only after firmware reset you would have to pair them again. Please check with modpib /lib/firmware/plc/user.pib.tmp -v which NMK is set after pairing,

OXINARF commented 5 years ago

@dvlemplgk Thanks for clarifying! It didn't work (multiple times) before, but first time I connected it today, it indeed connected to the network without having to re-pair.

I still have to properly test Wifi, but I guess the only thing that is broken is the dLan led trigger, it gives an error request_irq failed with error -22. The led works by manually turning it on, but when setting the gpio (for gpio triggering) it gives that error and led stays off.

dvlemplgk commented 5 years ago

Then your Linux kernel gpio driver seems to not support interrupts for ath79 gpios. They were introduced in linux 4.6. And there's a hardware bug which makes edge triggered interrupts unreliable, you have to add this patch to the kernel >=4.6:

` -------------------------- drivers/gpio/gpio-ath79.c -------------------------- index c31f3be289f1..2c69bc7021aa 100644 @@ -131,12 +131,12 @@ static int ath79_gpio_irq_set_type(struct irq_data *data,unsigned int flow_type) case IRQ_TYPE_EDGE_RISING: polarity |= mask; case IRQ_TYPE_EDGE_FALLING:

`

OXINARF commented 5 years ago

Thanks, I'll have to try that later. I'm using OpenWrt 18.06.1, which has kernel 4.9 so it should have support.

Is there any reason why that couldn't be a patch on OpenWrt (or even submitted to kernel)? \ \ \ \ (correctly formatted diff below)

-------------------------- drivers/gpio/gpio-ath79.c --------------------------
index c31f3be289f1..2c69bc7021aa 100644
@@ -131,12 +131,12 @@ static int ath79_gpio_irq_set_type(struct irq_data *data,unsigned int flow_type)
    case IRQ_TYPE_EDGE_RISING:
        polarity |= mask;
    case IRQ_TYPE_EDGE_FALLING:
-   case IRQ_TYPE_EDGE_BOTH:
        break;

    case IRQ_TYPE_LEVEL_HIGH:
        polarity |= mask;
    case IRQ_TYPE_LEVEL_LOW:
+   case IRQ_TYPE_EDGE_BOTH: /* emulate it with level! gpio hw has trouble to recognize the right edges */
        type |= mask;
        break;
dvlemplgk commented 5 years ago

Maybe noone is using led gpio interrupt trigger so it went unnoticed? We didn't upstream this patch yet. Sorry for mangled format. How do you format code properly here (I used 'insert code' button)?

OXINARF commented 5 years ago

Best way is to paste it, then select it and click the insert code button. When it's multiple line you need to use three (or more) backticks and it correctly inserts it if you select multiple lines.

It usually detects the parser correctly but for the above it didn't, so here is what I did there:

```diff

diff patch here

` ``   (space there because I couldn't find how to escape it)
OXINARF commented 5 years ago

~@dvlemplgk Any idea what can lead to the following error starting the PLC interface?~

daemon.err setsid[1614]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/int6x00.nvm (1) (00000040:32064)
daemon.err setsid[1614]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/int6x00.nvm (1) (000000C0)
daemon.err setsid[1614]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/user.pib (1) (00400000:22344)
daemon.err setsid[1614]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/int6x00.nvm (4) (00574464:495516)
daemon.err setsid[1614]: plchost: WriteExecuteFirmware2: Read timeout or network error~

~I have a MT2913 working perfectly but now with two new MT2910 I always have this error.~

EDIT: Nevermind, it was the firmware itself that wasn't working. For some reason, OpenWrt 18.06.2 works well, but 18.06.1 doesn't on MT2910.

SteveAyre commented 5 years ago

Note the trigger requires kmod-ledtrig-gpio (I didn't have it installed at first).

I'm also seeing 'request_irq failed with error -22' even after applying the patch above?

SteveAyre commented 5 years ago

firmware.QCA9882-v2.2.0_2018-07-26.dvl no longer seems to be available on http://devolo.de/

Is there a download for that firmware or a more recent version anywhere on the devolo website?

SteveAyre commented 5 years ago

I have found devolo-firmware-dlan1200-wifiac_5.2.1-2_i386.deb on http://update.devolo.com which contains delos_dlan-1200-ac_5.2.1_2019-02-19.bin.dvl which appears to have the required nvm and pib files. Is this the correct current version?

Molkenbur commented 5 years ago

Yes, you are right. This is the latest firmware for dLAN 1200+ WiFi ac. We deploy it via the Cockpit tool to our customers. Same is valid for dLAN 550 WiFi.

OXINARF commented 5 years ago

Wow I thought that delos firmware was dead, but it's now the official firmware for all the older wireless devices. I'll need to check it out when I have time.

Molkenbur commented 5 years ago

Not all the older wireless devices, to be honest. The cut is for the latest low cost and premium dLAN devices based on HomePlug AV2 And for all new Magic devices based on G.hn as well. BTW: All are using Wi-Fi chipsets from Qualcomm. Maybe, you want to wait for the upcoming version 5.3.0.

mgiganto commented 5 years ago

Do you know where is the serial port on devolo dlan devices? I am working in the openwrt support for devolo magic 2 wifi but most probably, the serial port is common for all dlan devices.

SteveAyre commented 5 years ago

Do you know where is the serial port on devolo dlan devices? I am working in the openwrt support for devolo magic 2 wifi but most probably, the serial port is common for all dlan devices.

I'd be pretty careful looking for the serial port given the proximity to mains AC voltage.

I didn't need serial port access to install openwrt, so I don't know where it's located.

SteveAyre commented 5 years ago

I'd be pretty careful looking for the serial port given the proximity to mains AC voltage.

See the similar warning on https://openwrt.org/toh/devolo/devolo_dlan_pro_wireless_500_plus ;)

Animal-UK commented 3 years ago

Hi,

Does anyone have a refined process to get this to fully work on the non-pro version?

scatman75 commented 3 years ago

Would be really good to have a guide that is describing the process in total. I personally struggled with the selection of all neccessary kernel modules at first. After reading this page and some other sources I managed to get an openwrt version 19.07.3 compiled with dlan-plc firmware. The result is unfortunately not satisfactory in relation to PLC. The LEDs of both dlan-devices (1x dlan 1200+ & dlan 1200+ wifi ac) start showing active connections, but after a short period the led of the dlan 1200+ is off and the led of the dlan 1200+ wifi ac is blinking red and in the system log of openwrt the following error is displayed:

Mon Feb 14 10:23:10 2021 user.notice plc: stop PLC Mon Feb 14 10:23:10 2021 user.notice plc: start PLC Mon Feb 14 10:23:11 2021 user.notice plc: activate PLC Modem Mon Feb 14 10:23:14 2021 daemon.info dnsmasq[1024]: read /etc/hosts - 4 addresses Mon Feb 14 10:23:14 2021 daemon.info dnsmasq[1024]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (1) (00000040:32096) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (1) (000000C0) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/user.pib (1) (00400000:22344) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (4) (0057BD30:506172) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (4) (0057C120) Mon Feb 14 10:23:18 2021 daemon.err setsid[1908]: eth0 F4:06:8D:38:53:D7 MAC-QCA7500-2.8.0.30-01-20190705-CS is running

Can anyone point me into the right direction?

Animal-UK commented 3 years ago

Would be really good to have a guide that is describing the process in total. I personally struggled with the selection of all neccessary kernel modules at first. After reading this page and some other sources I managed to get an openwrt version 19.07.3 compiled with dlan-plc firmware. The result is unfortunately not satisfactory in relation to PLC. The LEDs of both dlan-devices (1x dlan 1200+ & dlan 1200+ wifi ac) start showing active connections, but after a short period the led of the dlan 1200+ is off and the led of the dlan 1200+ wifi ac is blinking red and in the system log of openwrt the following error is displayed:

Mon Feb 14 10:23:10 2021 user.notice plc: stop PLC Mon Feb 14 10:23:10 2021 user.notice plc: start PLC Mon Feb 14 10:23:11 2021 user.notice plc: activate PLC Modem Mon Feb 14 10:23:14 2021 daemon.info dnsmasq[1024]: read /etc/hosts - 4 addresses Mon Feb 14 10:23:14 2021 daemon.info dnsmasq[1024]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (1) (00000040:32096) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (1) (000000C0) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/user.pib (1) (00400000:22344) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (4) (0057BD30:506172) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (4) (0057C120) Mon Feb 14 10:23:18 2021 daemon.err setsid[1908]: eth0 F4:06:8D:38:53:D7 MAC-QCA7500-2.8.0.30-01-20190705-CS is running

Can anyone point me into the right direction?

im interested in this as per my post, i'd also be interested to understand as to how you flash the unit back to official dlan code.

scatman75 commented 3 years ago

im interested in this as per my post, i'd also be interested to understand as to how you flash the unit back to official dlan code.

I doubt that there is an easy way of flashing back the original firmware. I tried flashing the original DVL file from Devolo via the TFTP method but the device was unresponsive afterwards. Nevertheless a new attempt of flashing the OpenWRT firmware went successful. A little digging with an hex-editor showed that the DVL file has at least a custom header and footer. Maybe it would be sufficient to strip off custom header and footer. So I figured that without deeper knowledge of the structure of DVL files this is the bottom line.

garyttirn commented 3 years ago

Would be really good to have a guide that is describing the process in total. I personally struggled with the selection of all neccessary kernel modules at first. After reading this page and some other sources I managed to get an openwrt version 19.07.3 compiled with dlan-plc firmware. The result is unfortunately not satisfactory in relation to PLC. The LEDs of both dlan-devices (1x dlan 1200+ & dlan 1200+ wifi ac) start showing active connections, but after a short period the led of the dlan 1200+ is off and the led of the dlan 1200+ wifi ac is blinking red and in the system log of openwrt the following error is displayed:

Mon Feb 14 10:23:10 2021 user.notice plc: stop PLC Mon Feb 14 10:23:10 2021 user.notice plc: start PLC Mon Feb 14 10:23:11 2021 user.notice plc: activate PLC Modem Mon Feb 14 10:23:14 2021 daemon.info dnsmasq[1024]: read /etc/hosts - 4 addresses Mon Feb 14 10:23:14 2021 daemon.info dnsmasq[1024]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (1) (00000040:32096) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (1) (000000C0) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/user.pib (1) (00400000:22344) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Write /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (4) (0057BD30:506172) Mon Feb 14 10:23:14 2021 daemon.err setsid[1908]: eth0 00:B0:52:00:00:01 Start /lib/firmware/plc/dlan-pro-1200-ac/MAC-7500-v2.8.0-01-NW6-X-CS.nvm (4) (0057C120) Mon Feb 14 10:23:18 2021 daemon.err setsid[1908]: eth0 F4:06:8D:38:53:D7 MAC-QCA7500-2.8.0.30-01-20190705-CS is running

Can anyone point me into the right direction?

You got almost to the goal. Compiling with SETSID support allows for the /etc/init.d/plc script to start the PLC interface (runs plchost process)

What you are probably missing is the PLC Network Key which would be set automatically by the push button pairing. It can be done from shell also. Your PLC settings are stored to /lib/firmware/plc/user.pib

This is what the settings look like after flashing OpenWRT :

root@OpenWrt:~# chkpib -v /lib/firmware/plc/user.pib
------- /lib/firmware/plc/user.pib -------
    PIB 0-0 21384 bytes
    MAC B8:BE:F4:7F:9C:29
    DAK 5C:A6:7E:27:DB:68:AE:67:B3:C6:6F:F5:A5:0F:F0:4F
    NMK 50:D3:E4:93:3F:85:5B:70:40:78:4D:F8:15:AA:8D:B7 (HomePlugAV)
    NID B0:F2:E6:95:66:6B:03
    Security level 0
    NET 
    MFG devolo dLAN 1200+ WiFi ac [MT2910;X]
    USR OpenWrt
    CCo Auto
    MDU N/A

You need to get open-plc-utils to some Linux to fetch your PLC network config from an active PLC device. https://github.com/qca/open-plc-utils

Scan the current PLC network, you need to be connected to the same Ethernet segment as the PLC is via Ethernet/WLAN (not PLC). Interface eth0 depends on your PC.

sudo ./plctool -i eth0 -m all
eth0 FF:FF:FF:FF:FF:FF Fetch Network Information
eth0 30:D3:2D:F3:89:6F Found 1 Network(s)

source address = 30:D3:2D:F3:89:6F

    network->NID = 6E:ED:DF:82:15:A3:03
    network->SNID = 2
    network->TEI = 1
    network->ROLE = 0x02 (CCO)
    network->CCO_DA = 30:D3:2D:F3:89:6F
    network->CCO_TEI = 1
    network->STATIONS = 0

Fetch the config to a tmp-file

sudo ./plctool -i eth0 -p /tmp/remote.pib 30:D3:2D:F3:89:6F
eth0 30:D3:2D:F3:89:6F Read Module from Memory

chkpib -v /tmp/remote.pib
------- /tmp/remote.pib -------
    PIB 0-0 21384 bytes
    MAC 30:D3:2D:F3:89:6F
    DAK 26:CA:8C:A2:D9:08:5F:DD:B5:A6:62:22:2A:17:56:41
    NMK DE:CC:85:24:A5:22:17:71:5F:56:54:3C:9A:6B:3A:F8
    NID 6E:ED:DF:82:15:A3:03
    Security level 0
    NET 
    MFG devolo dLAN 1200+ [MT2853]
    USR Single
    CCo Auto
    MDU N/A

Update the Network Key on OpenWRT PLC

root@OpenWrt:~# modpib -N DE:CC:85:24:A5:22:17:71:5F:56:54:3C:9A:6B:3A:F8 /lib/firmware/plc/user.pib
root@OpenWrt:~# chkpib -v /lib/firmware/plc/user.pib
------- /lib/firmware/plc/user.pib -------
    PIB 0-0 21384 bytes
    MAC B8:BE:F4:7F:9C:29
    DAK 5C:A6:7E:27:DB:68:AE:67:B3:C6:6F:F5:A5:0F:F0:4F
    NMK DE:CC:85:24:A5:22:17:71:5F:56:54:3C:9A:6B:3A:F8
    NID 6E:ED:DF:82:15:A3:03
    Security level 0
    NET 
    MFG devolo dLAN 1200+ WiFi ac [MT2910;X]
    USR OpenWrt
    CCo Auto
    MDU N/A

Restart PLC interface root@OpenWrt:~# /etc/init.d/plc restart

Check PLC network : I'm running the OpenWRT 21.02 via patch (https://github.com/openwrt/openwrt/pull/3892) so in your 19.07 case the interface could be eth0.

root@OpenWrt:~# plctool -i eth0.1 -m all 
eth0.1 FF:FF:FF:FF:FF:FF Fetch Network Information
eth0.1 B8:BE:F4:7F:9B:29 Found 1 Network(s)

source address = B8:BE:F4:7F:9C:29

    network->NID = 6E:ED:DF:82:15:A3:03
    network->SNID = 2
    network->TEI = 8
    network->ROLE = 0x00 (STA)
    network->CCO_DA = 30:D3:2D:E3:89:6F
    network->CCO_TEI = 1
    network->STATIONS = 1

        station->MAC = 30:D3:2D:E3:89:6F
        station->TEI = 1
        station->BDA = 10:C3:7B:9C:A7:C6
        station->AvgPHYDR_TX = 146 mbps Alternate
        station->AvgPHYDR_RX = 158 mbps Alternate

eth0.1 30:D3:2D:F3:89:6F Found 1 Network(s)

source address = 30:D3:2D:F3:89:6F

    network->NID = 6E:ED:DF:82:15:A3:03
    network->SNID = 2
    network->TEI = 1
    network->ROLE = 0x02 (CCO)
    network->CCO_DA = 30:D3:2D:F3:89:6F
    network->CCO_TEI = 1
    network->STATIONS = 1

        station->MAC = B8:BE:F4:7F:9C:29
        station->TEI = 8
        station->BDA = B8:BE:F4:7F:9C:28
        station->AvgPHYDR_TX = 162 mbps Alternate
        station->AvgPHYDR_RX = 146 mbps Alternate
scatman75 commented 3 years ago

@garyttirn Many thanks for the detailed explanation. I give this a shot at next weekend.

scatman75 commented 3 years ago

@garyttirn With your detailed explanations I managed to get it working, see below.

root@OpenWrt:~# plctool -i eth0 -m all eth0 FF:FF:FF:FF:FF:FF Fetch Network Information eth0 F4:06:8D:38:53:D7 Found 1 Network(s)

source address = F4:06:8D:38:53:D7

network->NID = 81:E6:66:90:15:5F:07
network->SNID = 11
network->TEI = 2
network->ROLE = 0x00 (STA)
network->CCO_DA = F4:06:8D:29:0A:76
network->CCO_TEI = 1
network->STATIONS = 1

    station->MAC = F4:06:8D:29:0A:76
    station->TEI = 1
    station->BDA = 00:0C:29:E3:79:38
    station->AvgPHYDR_TX = 356 mbps Alternate
    station->AvgPHYDR_RX = 470 mbps Alternate

eth0 F4:06:8D:29:0A:76 Found 1 Network(s)

source address = F4:06:8D:29:0A:76

network->NID = 81:E6:66:90:15:5F:07
network->SNID = 11
network->TEI = 1
network->ROLE = 0x02 (CCO)
network->CCO_DA = F4:06:8D:29:0A:76
network->CCO_TEI = 1
network->STATIONS = 1

    station->MAC = F4:06:8D:38:53:D7
    station->TEI = 2
    station->BDA = F4:06:8D:38:53:D6
    station->AvgPHYDR_TX = 470 mbps Alternate
    station->AvgPHYDR_RX = 356 mbps Alternate

Thank you very much!

garyttirn commented 3 years ago

Support for the Devolo dLAN pro 1200+ WiFi ac is in the OpenWRT master for target ath79 since this commit. The snapshot image also works with the white, non-pro Devolo dLAN 1200+ WiFi ac variant.

I enhanced the scripts in PLC firmware package @0xFelix made so that setsid is no longer mandatory and one doesn't have to compile the entire OpenWRT from sources.

I'm unaware of any issue the removal of setsid may bring, however if there are any those are likely to be related to push button pairing which may not work and manual pairing as described above with open-plc-tools needs to be used instead.

The OpenWRT PLC firmware package still needs to be build from sources as Qualcomm license doesn't allow distributing the PLC hardware firmware files. After being built those OpenWRT PLC firmware packages can be used for creating OpenWRT images using ImageBuilder without rebuilding the OpenWRT PLC firmware packages.

I added instructions for creating PLC frmware packages and OpenWRT firmware with the PLC firmware packages embedded to my fork of 0xFelix's repository.

Many thanks to @0xFelix for doing the hard work providing the patch for the Devolo dLAN pro 1200+ WiFi ac support.

scatman75 commented 2 years ago

@garyttirn I tried out your scripts and the explanations on your Github site. Everything worked out well and I was able to build a recent snaphot version with included support for PLC. Thank you very much for your ongoing efforts of making the users life easier.

michelsup commented 12 months ago

I tried to flash the firmware by the tftp method, but I can't get the Dlan to uboot with 192.168.1.100. I think I tried all the possibilities, even flashing official firmwares down to 1.2.1 Is there another way to flash Openwrt on a non pro Dlan 1200? I noticed someone have been able to get ssh root somehow?

scatman75 commented 12 months ago

Switch off the Devolo device and hold down the reset button when switching it back on (it is best to use a multiple socket). Wait until the Home/WiFi LED has flashed red/white a few times, then release the reset button. Make sure your TFTP server is up and running and the firmware file is named uploadfile in advance.

michelsup commented 12 months ago

Bloody hell, it's as I was reading back my post after your comment that I noticed I made a mistake on the IP, with 1.100 instead of 0.100. Thank you for your help!

scatman75 commented 12 months ago

Glad to see you sorted your issue out.

michelsup commented 12 months ago

So I've carefully followed the excellent paper https://github.com/garyttirn/dlan-openwrt/tree/master by @garyttirn followed by https://github.com/garyttirn/dlan-openwrt/tree/master/dlan-fw All went well, but the PLC is not connecting.

root@OpenWrt:~# /etc/init.d/plc restart
setting up led dLAN
root@OpenWrt:~# plctool -i eth0 -m all
eth0 FF:FF:FF:FF:FF:FF Fetch Network Information
root@OpenWrt:~# plctool -i eth0.1 -m all
eth0.1 FF:FF:FF:FF:FF:FF Fetch Network Information
root@OpenWrt:~# plctool -i eth0.2 -m all
eth0.2 FF:FF:FF:FF:FF:FF Fetch Network Information

I used the MT2674.pib as stated on the sticker.

ls feeds/dlan/dlan-fw/qca/devolo,dlan-pro-1200plus-ac/
bin
MAC-7500-v2.8.0-01-NW6__-X-CS.nvm
qca7500-pib15-devolo-mt2674.pib

I only have one dlan CPL on my LAN

plctool -i enp3s0 -m all
enp3s0 FF:FF:FF:FF:FF:FF Fetch Network Information
enp3s0 F4:06:8D:AD:4A:38 Found 1 Network(s)

source address = F4:06:8D:AD:4A:38

        network->NID = 9D:DD:E8:03:36:12:06
        network->SNID = 14
        network->TEI = 6
        network->ROLE = 0x02 (CCO)
        network->CCO_DA = F4:06:8D:AD:4A:38
        network->CCO_TEI = 6
        network->STATIONS = 0
chkpib -v /tmp/remote.pib
------- /tmp/remote.pib -------
        PIB 0-0 21384 bytes
        MAC F4:06:8D:AD:4A:38
        DAK 7B:36:2E:AD:8C:C8:8C:FF:C4:2E:96:34:2B:45:E6:20
        NMK 3C:A2:AD:AE:A6:E6:C2:DF:13:3D:19:2F:41:E3:78:DF
        NID 9D:DD:E8:03:36:12:06
        Security level 0
        NET 
        MFG devolo dLAN 1200+ [MT2640]
        USR Devolo Garage
        CCo Auto
        MDU N/A

Yes I have set the NMK with modpib

root@OpenWrt:~# chkpib -v /lib/firmware/plc/user.pib
------- /lib/firmware/plc/user.pib -------
        PIB 0-0 21384 bytes
        MAC 30:D3:2D:19:52:F3
        DAK 65:5E:1F:F4:18:03:73:1F:22:8E:A8:CD:66:54:89:B8
        NMK 3C:A2:AD:AE:A6:E6:C2:DF:13:3D:19:2F:41:E3:78:DF
        NID 9D:DD:E8:03:36:12:06
        Security level 0
        NET 
        MFG devolo dLAN 1200+ WiFi ac [MT2910;X]
        USR OpenWrt
        CCo Auto
        MDU N/A

I'm wondering why it displays [MT2910;X], is it normal if I used a MT2674 pib?

noblemtw commented 12 months ago

The users.pib file is extracted from the device itself, it's showing you've got the MT2910 chipset so I'd try again using the firmware for that chipset. The chipset in my plugs match the sticker, although make sure you check the sticker on the device you are flashing, the wall adaptor is probably different...

It's worth being aware that there's newer firmware available here (The firmware isn't vendor specific, so don't worry that it's a tp-link community site) .You can just drop it into feeds/dlan/dlan-fw/qca/devolo,dlan-pro-1200plus-ac in place of the nvm you have, although probably best to get the basics working first :-)

michelsup commented 12 months ago

Thank you very much for your input. This issue has started to become an helpdesk dedicated to me :-) So as dumb as I'am, I was using the "update firmware" tool while keeping user config. So by wiping all settings while updating I now get

root@OpenWrt:~# chkpib -v /lib/firmware/plc/user.pib
------- /lib/firmware/plc/user.pib -------
        PIB 0-0 21384 bytes
        MAC 30:D3:2D:19:52:F3
        DAK 5D:4B:0B:EE:D2:0E:F5:9F:DB:1A:90:27:0E:14:87:BF
        NMK 3C:A2:AD:AE:A6:E6:C2:DF:13:3D:19:2F:41:E3:78:DF
        NID 9D:DD:E8:03:36:12:06
        Security level 0
        NET 
        MFG devolo dLAN 1200+ WiFi ac [MT2674;X]
        USR OpenWrt
        CCo Auto
        MDU N/A

as it should, and the modem is starting

Tue Sep 19 09:04:36 2023 user.notice plc: start PLC
Tue Sep 19 09:04:37 2023 user.notice plc: activate PLC Modem

but still no luck. I even tried the new nvm from your post. Pulling a new Ethernet cable will be simpler. Is there a way to debug the modem?

noblemtw commented 12 months ago

I remember having all sorts if issues when I set mine up, the documentation wasn't as good back then and got updated just after I got it all working. I'm pretty sure anything we add here will be of use to other people too...

The plctools you've been using are probably your best bet for debugging, although when I set mine up, I found this page quite useful, and the homeplug script does save having to to remember the syntax for the various commands...

The two potential issues that spring to mind are:

I seem to recall that the plctools default to the wrong interface, so adding export PLC=br-lan to root's profile file is a good idea too.

In fact, having just checked your earlier post, you may have the wrong interface set, /etc/config/plc should look like the below, at least mine does...

config plc 'plc'
    option disabled '0'
    option interface 'br-lan'
    option individual_nmk '0'
garyttirn commented 12 months ago

Yes, ethX would no longer work with fw4, br-lan had to used.

The change is reflected in the default config, but I'm afraid I seem to have missed update to the READMEs.

michelsup commented 11 months ago

Ok, I give up. The modem doesn't want to connect to any of my PLC's. I compiled and flashed a dozen of times, I just have anymore enough energy to try to go back to the original firmware. Thank you for patience and your help.

garyttirn commented 11 months ago

As last resort I'd first stop the plchost using /etc/init.d/plc stop and then check with the plchost-command that the /etc/init.d/plc runs to see what if anything is happening by adding the -v argument as shown below :

/usr/bin/plchost -v -i br-lan -N /lib/firmware/plc/devolo,dlan-pro-1200plus-ac/MAC-7500-v2.8.0-01-NW6__-X-CS.nvm -P /lib/firmware/plc/user.pib -n /lib/firmware/plc/user.nvm.tmp -p /lib/firmware/plc/user.pib.tmp

Parameters depend on your hardware, like the firmware provided by -N argument.

plchost manual in github tells more about options and provides example output: https://github.com/qca/open-plc-utils/blob/master/docbook/plchost.1.html

For the record, I'm running the white, non-pro variant with OpenWrt 22.03.5 r20134-5f15225c1e and just the latest firmware from Develo (v2.8.0) and it connects fine to Devolo dLAN pro 1200+ PoE and Devolo dLAN pro 1200+ single & triple, same firmware version on all adapters.

I'm building my images using Imagebuilder and just including the prebuild dlan-package:

wget https://downloads.openwrt.org/releases/22.03.5/targets/ath79/generic/openwrt-imagebuilder-22.03.5-ath79-generic.Linux-x86_64.tar.xz

tar Jxvf openwrt-imagebuilder-22.03.5-ath79-generic.Linux-x86_64.tar.xz

cd openwrt-imagebuilder*-ath79-generic.Linux-x86_64
mkdir -p packages
cp ../dlan-22.03-no-setsid/*.ipk packages

#Add PLC files as custom
sed -i 's/^# src custom.*$/src\/gz custom file:packages/' repositories.conf

make image \
PROFILE=devolo_dlan-pro-1200plus-ac \
PACKAGES="-ppp -ppp-mod-pppoe -wpad-basic-wolfssl -wpad-basic-mbedtls wpad-wolfssl collectd-mod-cpu collectd-mod-interface collectd-mod-netlink collectd-mod-iwinfo collectd-mod-memory collectd-mod-network collectd-mod-conntrack collectd-mod-load collectd-mod-table collectd coreutils-timeout dlan-fw-pro-1200plus-ac dlan-plc etherwake hostapd-utils iperf3 luci-base luci-app-firewall luci-app-commands luci-app-opkg luci-mod-admin-full luci-theme-openwrt-2020 mailsend nano open-plc-utils-modpib open-plc-utils-plcstat sysstat tcpdump uhttpd uhttpd-mod-ubus" \
FILES=../plc \
EXTRA_IMAGE_NAME="plc" \
DISABLED_SERVICES="dnsmasq"
#EOF
mgiganto commented 10 months ago

Which version of openWRT are you using? Or are you using the official firmware? If you are using an official openWRT version, I remember that my chip rom got corrupted, I don't know how, and in order to communicate with the plc chip to load a firmware (plchost looks like just tried to load the firmware in memory each time in the original rom instead of updating the firmware in the plc rom), it required a 100MB speed link connection on the switch, which it was at 1G. I didn't know how to change the switch port speed to 100M to communicate with the chip to at least load the firmware and use it again on the official openWRT, so I got stuck there. You may want to check that, see if you can find a way to change the plc port link speed in the switch to 100M and connect to the plc chip. If you find the way, let us know please, I would love to use it again :D

On Sat, 30 Sept 2023 at 16:28, garyttirn @.***> wrote:

As last resort I'd first stop the plchost using /etc/init.d/plc stop and then check with the plchost-command that the /etc/init.d/plc runs to see what if anything is happening by adding the -v argument as shown below :

/usr/bin/plchost -v -i br-lan -N /lib/firmware/plc/devolo,dlan-pro-1200plus-ac/MAC-7500-v2.8.0-01-NW6__-X-CS.nvm -P /lib/firmware/plc/user.pib -n /lib/firmware/plc/user.nvm.tmp -p /lib/firmware/plc/user.pib.tmp

Parameters depend on your hardware, like the firmware provided by -N argument.

plchost manual in gthub tells more about options and provided example output: https://github.com/qca/open-plc-utils/blob/master/docbook/plchost.1.html

— Reply to this email directly, view it on GitHub https://github.com/devolo/dlan-openwrt/issues/3#issuecomment-1741790306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFB3LF5RUDFRYPINGDW2NXDX5A3CTANCNFSM4GDK3X6Q . You are receiving this because you commented.Message ID: @.***>

TinoKossmann commented 3 months ago

Same problem here, no PLC communication beeween devolo dLAN 1200+ wifi ac (MT2673, OpenWRT) and devolo dLAN 1200+ (MT2639, stock firmware). NMK is identical...

OpenWRT 22.03.6:

root@OpenWrt:~# ubus call system board { "kernel": "5.10.201", "hostname": "OpenWrt", "system": "Atheros AR9344 rev 3", "model": "Devolo dLAN pro 1200+ WiFi ac", "board_name": "devolo,dlan-pro-1200plus-ac", "rootfs_type": "squashfs", "release": { "distribution": "OpenWrt", "version": "22.03.6", "revision": "r20265-f85a79bcb4", "target": "ath79/generic", "description": "OpenWrt 22.03.6 r20265-f85a79bcb4" }

NMK is set identical (4C:45:...E7:37):

root@OpenWrt:~# chkpib -v /lib/firmware/plc/user.pib ------- /lib/firmware/plc/user.pib ------- PIB 0-0 21384 bytes MAC F4:06:8D:56:5D:DB DAK 57:74:08:0A:BF:FC:8B:3E:87:0C:6D:9C:4F:42:6D:3C NMK 4C:45:0B:9B:A2:82:D9:61:89:6C:05:3A:39:81:E7:37 NID 26:D6:A9:96:AD:0C:0A Security level 0 NET MFG devolo dLAN 1200+ WiFi ac [MT2673;X] USR OpenWrt CCo Auto MDU N/A

plctool can see other adapter, MAC F4:06:8D:AF:A9:AD, with same NMK (not the own one, is this correct?):

root@OpenWrt:~# plctool -i br-lan -m all br-lan FF:FF:FF:FF:FF:FF Fetch Network Information br-lan F4:06:8D:AF:A9:AD Found 0 Network(s)

source address = F4:06:8D:AF:A9:AD

root@OpenWrt:~# plctool -i br-lan -p /tmp/remote.pib F4:06:8D:AF:A9:AD br-lan F4:06:8D:AF:A9:AD Read Module from Memory

root@OpenWrt:~# chkpib -v /tmp/remote.pib ------- /tmp/remote.pib ------- PIB 0-0 21384 bytes MAC F4:06:8D:AF:A9:AD DAK 90:3C:38:09:4D:65:9E:01:9D:71:A2:53:10:72:9F:9E NMK 4C:45:0B:9B:A2:82:D9:61:89:6C:05:3A:39:81:E7:37 NID 26:D6:A9:96:AD:0C:0A Security level 0 NET MFG devolo dLAN 1200+ [MT2639] USR dLAN-1200-Ersatz CCo Auto MDU N/A

Manual start plc service:

root@OpenWrt:~# /etc/init.d/plc stop setting up led dLAN

root@OpenWrt:~# /usr/bin/plchost -v -i br-lan -N /lib/firmware/plc/devolo,dlan-pro-1200plus-ac/MAC-7500-v2.8.0-01-NW6__-X-CS.nvm -P /lib/firmware/plc/user.pib -n /lib/firmware/plc/user.nvm.tmp -p /lib/firmware/plc/u ser.pib.tmp 00000000 FF FF FF FF FF FF E0 28 6D 75 DB 39 88 E1 00 00 .......(mu.9.... 00000010 A0 00 B0 52 1C 90 15 77 00 00 00 00 00 00 00 00 ...R...w........ 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000030 00 00 00 00 00 00 00 00 00 00 00 00 ............

00000000 FF FF FF FF FF FF E0 28 6D 75 DB 39 88 E1 00 00 .......(mu.9.... 00000010 A0 00 B0 52 1C 90 15 77 00 00 00 00 00 00 00 00 ...R...w........ 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000030 00 00 00 00 00 00 00 00 00 00 00 00 ............

00000000 FF FF FF FF FF FF E0 28 6D 75 DB 39 88 E1 00 00 .......(mu.9.... 00000010 A0 00 B0 52 1C 90 15 77 00 00 00 00 00 00 00 00 ...R...w........ 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000030 00 00 00 00 00 00 00 00 00 00 00 00 ............ [...]

Does anyone have any ideas?

Some more information about network interfaces (is this correct? I only see MAC ...56:5D:DA, not ...56:5D:DB):

root@OpenWrt:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000 link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff inet6 fe80::f606:8dff:fe56:5dda/64 scope link valid_lft forever preferred_lft forever 4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether f4:06:8d:56:5d:d9 brd ff:ff:ff:ff:ff:ff 5: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether f4:06:8d:56:5d:d8 brd ff:ff:ff:ff:ff:ff 6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000 link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff inet 10.81.0.201/24 brd 10.81.0.255 scope global br-lan valid_lft forever preferred_lft forever inet6 fe80::f606:8dff:fe56:5dda/64 scope link valid_lft forever preferred_lft forever 7: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000 link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff 8: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000 link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff inet6 fe80::f606:8dff:fe56:5dda/64 scope link valid_lft forever preferred_lft forever

garyttirn commented 3 months ago

Since plctool works, there shouldn't be anything wrong with the hardware itself.

Have you made sure you have netfilter firewall running ?

It is mandatory as netfilter also handles tasks of former ebtables and plchost communication depends on punting PLC control packets to the host.

root@plc:~# /etc/init.d/firewall status
active with no instances

Now that I come to think of it, the netfilter rules depend of the br-lan and PLC interface MACs and this could be incorrectly detected by /etc/init.d/plc-script.

This is what MACs and netfilter rules look like on my devolo dLAN 1200+ wifi ac, netfilter tables need to be properly populated with the br-lan and PLC-interface MACs and this is done by the /etc/init.d/plc script. The MAC for the PLC interface is only present in the pib and kernel doesn't see this interface, thus the punting to plchost via netfilter was needed.


root@plc:~# ubus call system board
{
    "kernel": "5.15.150",
    "hostname": "plc",
    "system": "Atheros AR9344 rev 3",
    "model": "Devolo dLAN pro 1200+ WiFi ac",
    "board_name": "devolo,dlan-pro-1200plus-ac",
    "rootfs_type": "squashfs",
    "release": {
        "distribution": "OpenWrt",
        "version": "23.05.3",
        "revision": "r23809-234f1a2efa",
        "target": "ath79/generic",
        "description": "OpenWrt 23.05.3 r23809-234f1a2efa"
    }
}

root@plc:~# cat /etc/config/plc 

config plc 'plc'
    option individual_nmk '1'
    option disabled '0'
    option interface 'br-lan'

root@plc:~# chkpib -v /lib/firmware/plc/user.pib | egrep "MFG|MAC"
    MAC 30:D3:2D:F1:2F:7A
    MFG devolo dLAN 1200+ WiFi ac [MT2910;X]

root@plc:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether 30:d3:2d:f1:2f:79 brd ff:ff:ff:ff:ff:ff
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 30:d3:2d:f1:2f:79 brd ff:ff:ff:ff:ff:ff
    inet 192.168.81.14/24 brd 192.168.81.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet 192.168.81.15/24 brd 192.168.81.255 scope global secondary br-lan
       valid_lft forever preferred_lft forever
    inet6 fe80::32d3:2dff:fef1:2f79/64 scope link 
       valid_lft forever preferred_lft forever
7: phy1-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 30:d3:2d:f1:2f:77 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::32d3:2dff:fef1:2f77/64 scope link 
       valid_lft forever preferred_lft forever
8: phy0-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 30:d3:2d:f1:2f:78 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::32d3:2dff:fef1:2f78/64 scope link 
       valid_lft forever preferred_lft forever

root@rplc:~# nft list table bridge plc-bridge
table bridge plc-bridge {
    chain brouting {
        type filter hook prerouting priority -500; policy accept;
        ether type 0x88e1 jump plc
    }

    chain plc {
        ether saddr 00:b0:52:00:00:01 meta pkttype set host
        ether daddr ff:ff:ff:ff:ff:ff ether saddr 30:d3:2d:f1:2f:7a meta pkttype set host
        ether daddr 30:d3:2d:f1:2f:79 meta pkttype set host
        return
    }
}

root@plc:~# plcstat -i br-lan -t -m all
 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC STA 004 30:D3:2D:F1:2F:7A 30:D3:2D:F1:2F:79 n/a n/a QCA7500 MAC-QCA7550-2.8.0.30-01-20190705-CS
 REM CCO 002 B8:BE:F4:37:BC:D4 58:D5:6E:92:8D:8E 058 127 QCA7500 MAC-QCA7550-2.8.0.30-01-20190705-CS
 REM STA 003 30:D3:2D:F6:E6:C1 9C:8E:CD:1D:CE:52 009 009 QCA7500 MAC-QCA7500-2.8.0.30-01-20190705-CS
 REM STA 005 30:D3:2D:F6:E4:F8 9C:14:63:DE:7E:51 009 009 QCA7500 MAC-QCA7500-2.8.0.30-01-20190705-CS
 NID 6E:ED:DF:82:15:A3:03 SNID 008
 STA TEI 004 MAC 30:D3:2D:F1:2F:7A BDA 30:D3:2D:F1:2F:79
 CCO TEI 002 MAC B8:BE:F4:37:BC:D4 BDA 58:D5:6E:92:8D:8E TX 058 RX 127
 STA TEI 003 MAC 30:D3:2D:F6:E6:C1 BDA 9C:8E:CD:1D:CE:52 TX 009 RX 009
 STA TEI 005 MAC 30:D3:2D:F6:E4:F8 BDA 9C:14:63:DE:7E:51 TX 009 RX 009
TinoKossmann commented 3 months ago

If I interpret it correctly, netfilter is not the problem...

root@OpenWrt:~# /etc/init.d/firewall status active with no instances

root@OpenWrt:~# cat /etc/config/plc

config plc 'plc' option disabled '0' option interface 'br-lan' option individual_nmk '1'

root@OpenWrt:~# nft list table bridge plc-bridge table bridge plc-bridge { chain brouting { type filter hook prerouting priority -500; policy accept; ether type 0x88e1 jump plc }

   chain plc {
           ether saddr 00:b0:52:00:00:01 meta pkttype set host
           ether daddr ff:ff:ff:ff:ff:ff ether saddr f4:06:8d:56:5d:db meta pkttype set host
           ether daddr f4:06:8d:56:5d:da meta pkttype set host
           return
   }

}

There is a rule for MAC ...5D:DB, but ...

root@OpenWrt:~# /tmp/plcstat -i br-lan -t -m all P/L NET TEI ------ MAC ------ ------ BDA ------ TX RX CHIPSET FIRMWARE LOC STA 000 F4:06:8D:AF:A9:AD F4:06:8D:56:5D:DA n/a n/a QCA7500 MAC-QCA7500-2.8.0.30-01-20190705-CS

... this doesn´t look correct for me.

Also i only see one adapter, if i call plctool on my server (while the OpenWRT adapter is reachable by TP, too).

root@vServer01:~# plctool -i ens192 -m all ens192 FF:FF:FF:FF:FF:FF Fetch Network Information ens192 F4:06:8D:AF:A9:AD Found 0 Network(s)

source address = F4:06:8D:AF:A9:AD

root@vServer01:~# ping -c 1 10.81.0.201 PING 10.81.0.201 (10.81.0.201) 56(84) bytes of data. 64 bytes from 10.81.0.201: icmp_seq=1 ttl=64 time=0.342 ms

root@vServer01:~# arp -a | grep "10.81.0.201" OpenWRT (10.81.0.201) auf f4:06:8d:56:5d:da [ether] auf ens192

noblemtw commented 3 months ago

Have you tried with individual_nmk set to 0, thats what I have on my working system. I'm not entirely sure what the setting does, but it feels like you should have the same network management key set on all devices...

The nftables rules look correct, first line is some sort of default mac that the devices use on boot, while 2nd and 3rd line should be the mac of the powerline and ethernet interfaces of the device and my devices at least, the powerline mac is the ethernet mac+1...

The plcstat output looks odd as the local and remote mac addresses are totally different, could you have accidentally duplicated the plc mac on more than one device, that could also explain why it's not working.

TinoKossmann commented 3 months ago

New attempt, from the beginning... Stock firmware on both devices, reset to factory defaults and paired by pressing the buttons. devolo dLAN 1200+ [MT2639] connected to switch by TP, devolo dLAN 1200+ WiFi ac [MT2673;X] only connected by PLC. plctools running on Ubuntu build server (vTest01):

root@vTest01:~# plctool -i ens192 -m all
ens192 FF:FF:FF:FF:FF:FF Fetch Network Information
ens192 F4:06:8D:AF:A9:AD Found 1 Network(s)

source address = F4:06:8D:AF:A9:AD

        network->NID = 08:28:44:0C:6E:EF:07
        network->SNID = 5
        network->TEI = 4
        network->ROLE = 0x02 (CCO)
        network->CCO_DA = F4:06:8D:AF:A9:AD
        network->CCO_TEI = 4
        network->STATIONS = 1

                station->MAC = F4:06:8D:56:5D:DB
                station->TEI = 1
                station->BDA = F4:06:8D:56:5D:DA
                station->AvgPHYDR_TX = 654 mbps Alternate
                station->AvgPHYDR_RX = 627 mbps Alternate

ens192 F4:06:8D:56:5D:DB Found 1 Network(s)

source address = F4:06:8D:56:5D:DB

        network->NID = 08:28:44:0C:6E:EF:07
        network->SNID = 5
        network->TEI = 1
        network->ROLE = 0x00 (STA)
        network->CCO_DA = F4:06:8D:AF:A9:AD
        network->CCO_TEI = 4
        network->STATIONS = 1

                station->MAC = F4:06:8D:AF:A9:AD
                station->TEI = 4
                station->BDA = E0:28:6D:75:DB:39
                station->AvgPHYDR_TX = 657 mbps Alternate
                station->AvgPHYDR_RX = 654 mbps Alternate
root@vTest01:~# plctool -i ens192 -p /tmp/remote-1200.pib F4:06:8D:AF:A9:AD
ens192 F4:06:8D:AF:A9:AD Read Module from Memory

root@vTest01:~# plctool -i ens192 -p /tmp/remote-1200wifi.pib F4:06:8D:56:5D:DB
ens192 F4:06:8D:56:5D:DB Read Module from Memory

root@vTest01:~# chkpib -v /tmp/remote-1200.pib
------- /tmp/remote-1200.pib -------
        PIB 0-0 21384 bytes
        MAC F4:06:8D:AF:A9:AD
        DAK 90:3C:38:09:4D:65:9E:01:9D:71:A2:53:10:72:9F:9E
        NMK 08:B7:BD:F3:76:D3:18:7E:38:E0:A1:D5:29:79:E8:C0
        NID 08:28:44:0C:6E:EF:07
        Security level 0
        NET
        MFG devolo dLAN 1200+ [MT2639]
        USR
        CCo Auto
        MDU N/A

root@vTest01:~# chkpib -v /tmp/remote-1200wifi.pib
------- /tmp/remote-1200wifi.pib -------
        PIB 0-0 21384 bytes
        MAC F4:06:8D:56:5D:DB
        DAK 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 (none/secret)
        NMK 08:B7:BD:F3:76:D3:18:7E:38:E0:A1:D5:29:79:E8:C0
        NID 08:28:44:0C:6E:EF:07
        Security level 0
        NET
        MFG devolo dLAN 1200+ WiFi ac [MT2673;X]
        USR devolo-919
        CCo Auto
        MDU N/A
root@vTest01:~# plcstat -i ens192 -m
 NID 08:28:44:0C:6E:EF:07 SNID 005
 CCO TEI 004 MAC F4:06:8D:AF:A9:AD BDA 00:0C:29:E7:03:B9
 STA TEI 001 MAC F4:06:8D:56:5D:DB BDA F4:06:8D:56:5D:DA TX 722 RX 657

=> both adapter paired, using NMK 08:B7:BD:F3:76:D3:18:7E:38:E0:A1:D5:29:79:E8:C0.

devolo dLAN 1200+ WiFi ac [MT2673;X] taken out of the socket, connected to switch by TP, pluged into socket again, flashed OpenWRT (now actual Snapshot r26592-83311b7470).

Pairing got lost, of course - but server doesn´t see devolo dLAN 1200+ WiFi ac [MT2673;X] anymore:

root@vTest01:~# plctool -i ens192 -m all
ens192 FF:FF:FF:FF:FF:FF Fetch Network Information
ens192 F4:06:8D:AF:A9:AD Found 1 Network(s)

source address = F4:06:8D:AF:A9:AD

        network->NID = 08:28:44:0C:6E:EF:07
        network->SNID = 5
        network->TEI = 4
        network->ROLE = 0x02 (CCO)
        network->CCO_DA = F4:06:8D:AF:A9:AD
        network->CCO_TEI = 4
        network->STATIONS = 0

OpenWRT seems to use default NKM:

root@OpenWrt:~# chkpib -v /lib/firmware/plc/user.pib
------- /lib/firmware/plc/user.pib -------
        PIB 0-0 21384 bytes
        MAC F4:06:8D:56:5D:DB
        DAK AC:04:CB:D4:44:B3:FB:99:E6:12:BF:DE:1D:34:C0:80
        NMK 50:D3:E4:93:3F:85:5B:70:40:78:4D:F8:15:AA:8D:B7 (HomePlugAV)
        NID B0:F2:E6:95:66:6B:03
        Security level 0
        NET
        MFG devolo dLAN 1200+ WiFi ac [MT2673;X]
        USR OpenWrt
        CCo Auto
        MDU N/A

Set correct NMK:

root@OpenWrt:~# modpib -N 08:B7:BD:F3:76:D3:18:7E:38:E0:A1:D5:29:79:E8:C0 /lib/firmware/plc/user.pib

root@OpenWrt:~# /etc/init.d/plc restart
setting up led dLAN

No success, own PLC is still missing:

root@OpenWrt:~# plctool -i br-lan -m all
br-lan FF:FF:FF:FF:FF:FF Fetch Network Information
br-lan F4:06:8D:AF:A9:AD Found 1 Network(s)

source address = F4:06:8D:AF:A9:AD

        network->NID = 08:28:44:0C:6E:EF:07
        network->SNID = 5
        network->TEI = 4
        network->ROLE = 0x02 (CCO)
        network->CCO_DA = F4:06:8D:AF:A9:AD
        network->CCO_TEI = 4
        network->STATIONS = 0

plcstat (which is missing in the flashed image, by the way) looks different, but shows MAC ...5D:DA (not ...5D:DB):

root@OpenWrt:/tmp# ./plcstat -i br-lan -t -m all
 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC CCO 004 F4:06:8D:AF:A9:AD F4:06:8D:56:5D:DA n/a n/a QCA7500 MAC-QCA7500-2.8.0.30-01-20190705-CS
 NID 08:28:44:0C:6E:EF:07 SNID 005
 CCO TEI 004 MAC F4:06:8D:AF:A9:AD BDA F4:06:8D:56:5D:DA

Server still doesn´t see the adapter:

root@vTest01:~# plcstat -i ens192 -t -m all
 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC CCO 004 F4:06:8D:AF:A9:AD 00:0C:29:E7:03:B9 n/a n/a QCA7500 MAC-QCA7500-2.8.0.30-01-20190705-CS
 NID 08:28:44:0C:6E:EF:07 SNID 005
 CCO TEI 004 MAC F4:06:8D:AF:A9:AD BDA 00:0C:29:E7:03:B9

Rest looks good (i think):

root@OpenWrt:~# nft list table bridge plc-bridge
table bridge plc-bridge {
        chain brouting {
                type filter hook prerouting priority -500; policy accept;
                ether type 0x88e1 jump plc
        }

        chain plc {
                ether saddr 00:b0:52:00:00:01 meta pkttype set host
                ether daddr ff:ff:ff:ff:ff:ff ether saddr f4:06:8d:56:5d:db meta pkttype set host
                ether daddr f4:06:8d:56:5d:da meta pkttype set host
                return
        }
}

root@OpenWrt:~# /etc/init.d/firewall status
active with no instances

root@OpenWrt:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff
    inet6 fe80::f606:8dff:fe56:5dda/64 scope link
       valid_lft forever preferred_lft forever
4: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fdaa:9336:f41c::1/60 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::f606:8dff:fe56:5dda/64 scope link
       valid_lft forever preferred_lft forever
5: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff
6: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether f4:06:8d:56:5d:da brd ff:ff:ff:ff:ff:ff
    inet6 fe80::f606:8dff:fe56:5dda/64 scope link
       valid_lft forever preferred_lft forever

root@OpenWrt:~# ll /lib/firmware/plc/*
-rw-r--r--    1 root     root            33 Jun 10 23:12 /lib/firmware/plc/dak
-rw-r--r--    1 root     root            20 Jun 10 23:12 /lib/firmware/plc/security-id
-rw-r--r--    1 root     root             0 Jun 10 23:23 /lib/firmware/plc/user.nvm.tmp
-rw-r--r--    1 root     root         22344 Jun 10 23:23 /lib/firmware/plc/user.pib
-rw-r--r--    1 root     root             0 Jun 10 23:23 /lib/firmware/plc/user.pib.tmp

/lib/firmware/plc/devolo,dlan-pro-1200plus-ac:
drwxr-xr-x    2 root     root           159 Jun 10 23:10 ./
drwxr-xr-x    1 root     root             0 Jun 10 23:23 ../
-rw-r--r--    1 root     root        913944 Jun 10 23:10 MAC-7500-v2.8.0-01-NW6__-X-CS.nvm
-rw-r--r--    1 root     root           344 Jun 10 23:10 fwconfig
-rwxr-xr-x    1 root     root            60 Jun 10 23:10 led_scheme_off*
-rwxr-xr-x    1 root     root            60 Jun 10 23:10 led_scheme_on*
-rw-r--r--    1 root     root         22344 Jun 10 23:10 qca7500-pib15mac28-devolo-mt2673.pib
jrfVP42bLiUWAYOShp5r commented 2 months ago

Heyho... i screwed up my 1200+ WiFi ac by trying to flash the latest stock firmware delos_dlan-1200-ac_6.0.1_2023-09-06.bin over the TFTP-Methode. If i turn on the dLAN 1200+ WiFi ac now, the Powerline Button is just red and nothing else happens. I think i can still use the TFTP Methode to flash a new image, but i have the feeling, that i need a different image. Do you have any advice? can i use the OpenWRT Luci to flash the stock firmware?

TinoKossmann commented 2 months ago

First of all, this is not a general discussion forum, this is a specific issue and should only deal with this topic.

Nevertheless, regarding your problem: You have to press the reset button (inside the small hole) for several seconds while (!) supplying the Devolo with power. The TFTP server must be running on IP 192.168.0.100, reachable by LAN and provide the file "uploadfile" (rename the image).

From https://openwrt.org/toh/devolo/dlan_pro_1200_wifi_ac: - the image on the TFTP server must be called “uploadfile” - setup your TFTP server to use the IP address 192.168.0.100/24 - connect an ethernet cable between your computer and one of the LAN ports - power it up while pushing down the reset button - wait until Home/WiFi-LEDs blink red/white a few times and stay on, then release the reset button - wait until LEDs stop to blink red/white - the device should boot now

howels commented 1 week ago

New attempt, from the beginning... Stock firmware on both devices, reset to factory defaults and paired by pressing the buttons. devolo dLAN 1200+ [MT2639] connected to switch by TP, devolo dLAN 1200+ WiFi ac [MT2673;X] only connected by PLC. plctools running on Ubuntu build server (vTest01):

Did you get anywhere? I am trying to add an OpenWRT DLAN 1200+ ac (MT2765) to an existing network of x2 identical adapters, I can see the network, copy the NMK and successfully restart plc but I don't get the adapter coming online.

I've built the dlan packages from the feed and compiled a v23.05.4 image for devolo_dlan-pro-1200plus-ac, with the dlan-fw-pro-1200plus-ac, dlan-plc and various open-plc-utils items.

TinoKossmann commented 1 week ago

Did you get anywhere?

No, I have given up until further notice.