No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
}} | }} | ||
= Description = | = 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 [https://en.wikipedia.org/wiki/Power-line_communication Powerline (PLC)] functionality built in in this model, this is why I'm trying to | 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 [https://en.wikipedia.org/wiki/Power-line_communication Powerline (PLC)] functionality built in in this model, this is why I'm trying to something similar as described [https://fredericb.info/2016/02/powerline-plc-support-in-openwrt-for-d.html?m=1 here]. | ||
= Progress = | = Progress = | ||
== Built image with patched kernel == | == Built image with patched kernel == |
Revision as of 21:15, 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 something similar as 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.
Extracting PLC firmware from downloaded router 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/
Loading the firmware
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
Autoload at boot
I simply put following line in /etc/rc.local:
ampboot -i br-wan -P /plc/plc.ceb.pib -N /plc/plc.nvm