DHP-1565 OpenWrt

From NURDspace

Jump to: navigation, search
OpenWrt Powerline Support D-Link DHP-1565
NoPicture.png
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

"File:{{{Picture}}}" cannot be used as a page name in this wiki.

{{{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

Links used in getting stuff working

Other links

 
Our site is hosted by Site4U
Site4U
Our connectivity is made available by BIT
To BIT's website