No edit summary |
|||
Line 12: | Line 12: | ||
== Built image with patched kernel == | == Built image with patched kernel == | ||
I succesfully built an image that has [https://gist.github.com/frederic/d9d91c2221f04df3a36a#file-mips-ath79-dhp-1565-a1-enable-ar7400-port-diff this patch] applied. Images (18.06-SNAPSHOT, r7853-f6de1fa6c6) can be downloaded [http://space.nurdspace.nl/~dennis/dhp1565/ here]. It looks like the link on port 6 is there, this means the switch can talk to the AR7400 PLC chipset now. | I succesfully built an image that has [https://gist.github.com/frederic/d9d91c2221f04df3a36a#file-mips-ath79-dhp-1565-a1-enable-ar7400-port-diff this patch] applied. Images (18.06-SNAPSHOT, r7853-f6de1fa6c6) can be downloaded [http://space.nurdspace.nl/~dennis/dhp1565/ here]. It looks like the link on port 6 is there, this means the switch can talk to the AR7400 PLC chipset now. | ||
== Add port 6 to a VLAN == | |||
Edit /etc/config/network such that port 6 is in a VLAN you want. I chose VLAN 2, which means the WAN interface. Of course you should be aware of the security implications when your WAN interface is actually connected to the outside world. | |||
== Install open-plc-tools == | == Install open-plc-tools == | ||
Looks like we do not need to build this, since there are packages in the OpenWrt repo's. I started with installing ''open-plc-utils-amptool'' and ''open-plc-utils-ampboot''. | Looks like we do not need to build this, since there are packages in the OpenWrt repo's. I started with installing ''open-plc-utils-amptool'' and ''open-plc-utils-ampboot''. | ||
== Testing and flashing == | |||
The command listed in [https://fredericb.info/2016/02/powerline-plc-support-in-openwrt-for-d.html?m=1 here] did not seem to show that the bootloader is waiting for firmware: | |||
<pre> | |||
# amptool -i eth0.2 -Iar | |||
eth0.2 00:B0:52:00:00:01 Request Version Information | |||
eth0.2 00:B0:52:00:00:01 Fetch Device Attributes | |||
eth0.2 00:B0:52:00:00:01 Device Identity | |||
</pre> | |||
But when we try it on br-lan, it does! | |||
<pre> | |||
# amptool -i br-wan -Iar | |||
br-wan 00:B0:52:00:00:01 Request Version Information | |||
br-wan 00:B0:52:00:00:01 AR7400 BootLoader | |||
br-wan 00:B0:52:00:00:01 Fetch Device Attributes | |||
br-wan 00:B0:52:00:00:01 Device Identity | |||
</pre> | |||
Loading the firmware looked succesful: | |||
<pre> | |||
root@loetje:~# ampboot -i br-wan -P /plc/plc.ceb.pib -N /plc/plc.nvm | |||
br-wan 00:B0:52:00:00:01 Write /plc/plc.nvm (0) (00000040:17256) | |||
br-wan 00:B0:52:00:00:01 Start /plc/plc.nvm (0) (000000C0) | |||
br-wan 00:B0:52:00:00:01 Write /plc/plc.ceb.pib (0) (00200000:16352) | |||
br-wan 00:B0:52:00:00:01 Write /plc/plc.nvm (3) (00341194:423788) | |||
br-wan 00:B0:52:00:00:01 Start /plc/plc.nvm (3) (00341A88) | |||
br-wan 00:01:23:45:67:8B INT7400-MAC-5-2-5203-01-913-20110713-FINAL-B is running | |||
</pre> | |||
== Extracting PLC firmware == | == Extracting PLC firmware == | ||
Line 28: | Line 62: | ||
<pre>binwalk -e DHP1565A1_FW100B35.bin</pre> | <pre>binwalk -e DHP1565A1_FW100B35.bin</pre> | ||
PLC stuff can be found in ''_DHP1565A1_FW100B35.bin.extracted/squashfs-root/plc''. | PLC stuff can be found in ''_DHP1565A1_FW100B35.bin.extracted/squashfs-root/plc''. | ||
* On the device, create ''/overlay/upper/plc/'' | |||
* Copy all .pib and .nvm files to ''/overlay/upper/plc/'' | |||
= Links used in getting stuff working = | = Links used in getting stuff working = |
Revision as of 20:28, 5 September 2019
OpenWrt Powerline Support D-Link DHP-1565 | |
---|---|
Participants | Dennis |
Skills | Reading docs, Building OpenWrt |
Status | In progress |
Niche | Software |
Purpose | Infra |
Tool | No |
Location | |
Cost | |
Tool category |
OpenWrt Powerline Support D-Link DHP-1565 Property "Tool Image" (as page type) with input value "File:{{{Picture}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. {{{Picture}}} {{#if:No | [[Tool Owner::{{{ProjectParticipants}}} | }} {{#if:No | [[Tool Cost::{{{Cost}}} | }}
Description
I bought a D-Link DHP-1565 router. As with al my routers, I'd like to run OpenWrt on it. The official images however do not support the Powerline (PLC) functionality built in in this model, this is why I'm trying to reproduce the process described here.
Progress
Built image with patched kernel
I succesfully built an image that has this patch applied. Images (18.06-SNAPSHOT, r7853-f6de1fa6c6) can be downloaded here. It looks like the link on port 6 is there, this means the switch can talk to the AR7400 PLC chipset now.
Add port 6 to a VLAN
Edit /etc/config/network such that port 6 is in a VLAN you want. I chose VLAN 2, which means the WAN interface. Of course you should be aware of the security implications when your WAN interface is actually connected to the outside world.
Install open-plc-tools
Looks like we do not need to build this, since there are packages in the OpenWrt repo's. I started with installing open-plc-utils-amptool and open-plc-utils-ampboot.
Testing and flashing
The command listed in here did not seem to show that the bootloader is waiting for firmware:
# amptool -i eth0.2 -Iar eth0.2 00:B0:52:00:00:01 Request Version Information eth0.2 00:B0:52:00:00:01 Fetch Device Attributes eth0.2 00:B0:52:00:00:01 Device Identity
But when we try it on br-lan, it does!
# amptool -i br-wan -Iar br-wan 00:B0:52:00:00:01 Request Version Information br-wan 00:B0:52:00:00:01 AR7400 BootLoader br-wan 00:B0:52:00:00:01 Fetch Device Attributes br-wan 00:B0:52:00:00:01 Device Identity
Loading the firmware looked succesful:
root@loetje:~# ampboot -i br-wan -P /plc/plc.ceb.pib -N /plc/plc.nvm br-wan 00:B0:52:00:00:01 Write /plc/plc.nvm (0) (00000040:17256) br-wan 00:B0:52:00:00:01 Start /plc/plc.nvm (0) (000000C0) br-wan 00:B0:52:00:00:01 Write /plc/plc.ceb.pib (0) (00200000:16352) br-wan 00:B0:52:00:00:01 Write /plc/plc.nvm (3) (00341194:423788) br-wan 00:B0:52:00:00:01 Start /plc/plc.nvm (3) (00341A88) br-wan 00:01:23:45:67:8B INT7400-MAC-5-2-5203-01-913-20110713-FINAL-B is running
Extracting PLC firmware
- Download firmware from https://tsd.dlink.com.tw/
- Extract the .rar, it should give you a .bin file
- Install binwalk and sasquatch
apt install binwalk
git clone https://github.com/devttys0/sasquatch cd sasquatch/ ./build.sh
- Run binwalk on the .bin
binwalk -e DHP1565A1_FW100B35.bin
PLC stuff can be found in _DHP1565A1_FW100B35.bin.extracted/squashfs-root/plc.
- On the device, create /overlay/upper/plc/
- Copy all .pib and .nvm files to /overlay/upper/plc/