Installing Openwrt on Devolo Magic 2 wifi next

First, I'm a newbie and have difficulty following this git commit instructions (https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=d3c88811942a9dc9bbb01ca0443ae9cd790d1988 ).

  1. Please; is there any where I could find a clear way to perform the task of installing Openwrt on my adapter for a newbie like me who isn't used to CLI? I know I need putty to access the machine via ssh plus a TFTP server. My problem starts from step 4 to step 6; unfortunately.

  2. If l install Openwrt, do I loose the ability to use Devolo-Cockpit to boot and configure the G.hn chip? Asking because of the Notice at the end of the instructions.

Hi, this device requires changing uboot settings. This has the potential to soft-brick the device if you do not know what you're doing and also means you cannot return to stock.

Also, while I don't have this device, the notes at the end appear to state that the PLC functions are not working in openwrt, if you need these do not proceed. You may want to contact the submitter to see if they have a work around (like installing the non-free components from the original firmware). To do that you will need to get familiar with the command line.

lf this is the first time you've installed openwrt on a device - perhaps try with a device that is better supported first, such as a router and get yourself familiar with ssh and commandline uci - before tackling a more complex device like a PLC access point.

1 Like

@ jdwl1o1
Whoa, l assumed the issue of G.hn had been resolved!! That git commit is over a year old.

I also assumed there was a way to install Openwrt without touching the PLC soft/ hard- ware, like is the case with Tl-wpa8630p.

Thanks for the reply.

Hi, it's possible that the device maintainer did come up with a solution that doesn't require non-free components - but you will be 'rolling the dice' with no clear path back to stock.

The device support was added by the manufacturer, so I think you can assume if it was possible to make it work they would have done so.

Some PLCs present as an ethernet interface to the SOC running openwrt, but this is not always the case, if the committer states it won't work I'd be inclined to think this is one of the 'other' cases.

You can always boot the initramfs and try it out, without impacting the stock OS, but booting initramfs that will require uboot and serial/UART access and can be painful on these plug devices.

I am also interested in the installation process if that makes the device a Wi-Fi router.

I can now explain to you in detail what you want to do and what you want to know.

  1. Configure your network adapter with the IP address 192.168.0.100/255.255.255.0 and also add an alias of 192.168.1.2/255.255.255.0. The 192.168.0.100/24 is for the tftp server while the 192.168.1.2/24 will ultimately help you access the device once it reboots after you install the initial OpenWrt firmware into the device.
  2. Download the TFTP Server application from https://bitbucket.org/phjounin/tftpd64/downloads/Tftpd64-4.64-setup.exe and install it.
    Now you need to configure the TFTP server app (via the settings button) with two parameters:
    (a) The interface for it to listen on - should be 192.168.0.100
    (b) The "Base directory" - Here I created C:\tftpdroot\
    2.1. Download the OpenWrt firmware from here:
    https://firmware-selector.openwrt.org/?version=21.02.3&target=ipq40xx%2Fgeneric&id=devolo_magic-2-wifi-next
    For simplicity, save the two files in C:\tftpdroot
    (a) Rename the Kernel file to "uploadfile"
    (b) Rename the sysupgrade file to sysupgrade.bin
  3. Now open your Devolo Cockpit application and connect to your device. Go to its settings and change the password to manage it to something like "pass987" or whatever. Write this password somewhere or just remember it.
    Now you need to upload the kernel file to the device via TFTP. Basically, connect a cable between your laptop and the device. You can use a switch for that.
    Power off the Devolo device.
    Press and hold the small button next to the Ethernet ports while you plug it into the power socket.
    On your TFTP server app, on the Log Viewer tab, you will see the device fetching the "uploadfile" from the TFTP application.
    Once it has done that, give it about 5 minutes. You can open a CMD prompt on your laptop and do a continuous ping to 192.168.1.1 (ping 192.168.1.1 -t). Once you see the pings are steady, it's time to go to the next step.
  4. Download WinSCP from https://winscp.net/download/WinSCP-5.21-Setup.exe and install it. Create a new site in WinSCP. The site IP is 192.168.1.1, the File Protocol is SCP, the username is root and the password is the one you created earlier.
    Navigate to C:\tftpdroot, right-click on the sysupgrade.bin and from the context menu select "send to -> WinSCP (for upload)". WinSCP will prompt you to connect to the site you had created and also to login. Once it connects, you will see the file destination path as "/root/.". Change it to "/tmp/." then click ok for the file to be uploaded. Once done, we go to the next step.
  5. Using putty, connect to 192.168.1.1 using the username "root" and password "pass987" or whatever you had assigned earlier. Once you login with putty copy and paste/execute this command:
    (a) fw_printenv
    Copy the output of the above command to a text file and save it. Next copy and execute the next command:
    (b) fw_setenv bootcmd 'sf probe && sf read 0x84000000 0x180000 0x400000 && bootm'
    Give the command some time to run, until you see the shell prompt (#) again. Once that is done, it is time to install the sysupgrade.bin file.
    (c) cd /tmp
    (d) sysupgrade -v /tmp/sysupgrade.bin
    At this point, you will probably be thrown out (as happened to me! ), but don't despair. Go back to your CMD prompt on your laptop and wait until you see the pings steady again. Once that happens, you can open your browser and go to http://192.168.1.1 and log in without a password initially. Then you can configure the device from there.

On your 2nd question, my observation is that you do lose the ability to use Devolo-Cockpit to boot and configure the G.hn chip. If you find a solution to this, please let me know also.

BTW, I'd also be happy to find out if there is a way to configure the device as a router - instead of an AP :slight_smile:

Let me know if I missed something in the procedure. I hope I did not.

1 Like

The OEM firmware is also based on OpenWRT. Sources and extractable firmware images are provided by Devolo. Possibly it would be easier to enable the PLC after first getting a shell prompt with that firmware? Maybe ssh or telnet could be enabled for the OEM firmware.

Jschwart
I figured what you just said, but l am still trying to enable ssh, scp and telnet. I know it's locked by Devolo.

Have you or do you know how l could enable this/ these?


@linknetgear I was looking at this yesterday evening.

What you can do to find out more.

  1. Download the image from the Devolo site.
  2. Unpack it with binwalk -Me
  3. There'll be some squashfs file.
  4. Unpack that with 7z x

This should give you a filesystem. Check out:
/etc/init.d/dropbear
/lib/delos-functions.sh
/lib/delos/functions.sh

Now check out the web interface. There is a way to get a back-up of the configuration. This will give you a tarball.

Now it's interesting how restoring from back-up ends up working out. If that simply unpacks the tarball, then possibly the init script could just be overwritten with one that doesn't have a check.

The startup section of the dropbear init script contains a line to just 'return' when some condition is true, which depends on a few more conditions. Those you can derive from the other scripts. Note that some of those conditions also have other side effects.

There's quite a bit to study, maybe you could continue based on this? :slight_smile:

For the PLC, check out the opkg packaging data, you'll find quite some packages related to g.hn that seem to contain the tools needed to set this up.

1 Like

And another resource that might be useful, the source package from Devolo:
https://sl.devolo.global/oss-magic-2-wifi-next

@linknetgear I won't have time myself to look more at this, but I'm curious if you will manage to get somewhere :slight_smile:

Actually, it is quite straight forward: Add this to the configuration tarball:

root@devolo-133:~# cat /etc/config/delos
[...]
config baptization 'baptization'
        option ssh '1'
1 Like

That's a great find! I hope I will be able to try this soon. To move fully to OpenWRT with working G.hn I think the following steps would make sense:

  1. Have one device with SSH access on OEM installation
  2. Have one device on latest/recent OpenWRT
  3. Have a third device that talks to device 1

Step by step investigate what needs to be transplanted from device 1 to device 2 so that also device 2 starts talking over G.hn to device 3.