- Powerline performance will vary depending on: the age of your home’s electrical wiring, distance between the Powerline adapters, noise on the electrical power lines, if the Powerline signal has to go from electrical phase 1 to electrical phase 2 and going from the main electrical panel to a sub panel.
- Atheros Powerline Toolkit Software Graybox OPC Server Toolkit v.3.0.10 Graybox OPC Server Toolkit lets the programmer to create robust and highly effective OPC Servers within the shortest possible time. Toolkit supports OPC Data Access 1.00, 2.05a, 3.00.
Alliance, H.P.: HomePlug Powerline Networking Technology Hits Maturation as Global Broadband Standard. Qualcomm Atheros Open Powerline Toolkit (2018).
So, I just botched a firmware update on one of my PowerLine couplers. The model I had trouble with is a TP-Link TL-PA4020P. However, this quick guide should work with pretty much any Atheros-based PLC device. It was confirmed working on at least a TL-WPA4220 as well.
Steps to Reproduce
- Download manufacturer’s setup tool
- Download firmware files (“nvm” and “pib” files)
- Refrain from directly connecting the PLC to the computer, instead leave it hooked up to a switch and other hardware.
- Start firmware update using the aforementioned setup tool
- Have a bit of bad luck, or a power outage during the update.
Result
- “Firmware Upgrade failed” error message.
- Next up, “Local device not connected” error message.
- After unplugging and re-plugging the PLC, no lights light up.
- Faint hissing from the device, in normal operation it is silent.
Diagnosis
OK, keep calm. This is a modern piece of hardware, surely it wouldn’t need to be disassembled to flash a firmware. Right? Or so my hopes went as I started panicking. Looks like I’m not getting the manufacturer tool to retry the update on the (hopefully just) soft-bricked device. That piece of software only tells me that it can’t find the local device. A quick web search (“TP-Link PowerLine failed firmware fix” and similar) didn’t come up with anything good right away.
Well then, I thought, let’s see if it gives off any signs of life. I directly connected the PLC to my trusty MacBook and fired up WireShark. When the first packets started appearing I breathed a sigh of relief. The PLC still manages to get an ethernet link up. Amidst the stuff the Mac fires off when detecting a link (DHCP, MDNS, etc.) I finally found what I was looking for: Broadcast packets, “HomePlug AV” protocol, “Atheros_something” MAC, “Action Required Notification (Bootloader)”. Awesome! This thing is even politely asking me to remote-boot it. Let’s figure out how.
![Toolkit Toolkit](https://seidelmusicmanagement.com/img/61f58ee03e43761aa9e47a33094e621d.jpg)
Armed with the right keywords to feed to my preferred search engine, I finally found “” aka “open-plc-utils“. BSD-Licensed tools to set up Atheros-based PLC equipment. And, not really surprisingly, that includes a “plcboot” tool, which does just that – feed the PLC a firmware such that it can proceed to boot.
The Fix
- Connect the PLC’s network port directly to your computer’s.
- Rename the .nvm and .pib files from the manufacturer firmware package to nvm and pib (The atheros utilities are picky when it comes to file names, something I only found out after head-scratchingly reading the code.)
- Download and compile the tools, and boot the PLC:
- Since the pib file shipped with the firmware only contains a default mac address, the adapter will have been set to that, too. I presume the firmware utility reads it beforehand and updates the pib before uploading it. Anyway, to get the correct mac address back onto your PLC, have a look at the label on your plc, and then:
- Finally, flash the firmware again, using the manufacturer tool. plcboot only performs a one-time boot when given the options above. To make the firmware permanent again, the flash needs to be rewritten. (Allegedly, plcboot can do that too, but it needs a “softloader” file, which I couldn’t be bothered to extract from the TP-Link software.)
Atheros Powerline Toolkit Client
Hints and issues
- The plcboot and plctool utility may need root permissions, since they try to write raw packets to the ethernet interface. You may need to put a sudo in front.
- It may not work running the tools inside a VM, depending on your setup. This may be due to the raw packets not being properly forwarded to your physical interface. At any rate, you would need to put the VMs network interface into bridge mode.
- That said, I recommend doing all of these steps on bare hardware (it should be possible using a Linux live CD/stick).
- Depending on how broken the firmware on your device is, it may still try to boot. Therefore you may only have a short time window in which to run plcboot. Try plugging in the device to the power socket, and then as soon as possible press enter on the command line.
- If in doubt, have a look at the tool documentation, which you can view with
- There is a “PLC Recovery.exe” tool for Windows floating around the internet, which seems to do the same things as my tutorial. However, since its origins are not verifiable to me, and it doesn’t seem to come from TP-Link or Qualcomm, I won’t link to it. You’re free to search the web for it yourself, although ultimately it seems the method presented here is more successful than the exe.
Conclusions
I love the fact that chip manufacturers are building in sensible bootloaders, and that there is open source software available to access these. This is for example also the case with the Atmel ARM processor families of Arduino Due fame. I, for one, welcome this trend, making it increasingly hard to turn your hardware into a paperweight. On the downside, OEMs like TP-Link try to hide these as best as they can: the manual just says to return the device to the distributor for service when experiencing the symptoms I’ve encountered.
Bottom line: When a firmware update goes bad, don’t panic. It’s just a matter of finding the right tools. Also, it helps a lot having a general grasp of how things work on the inside to actually know what may or may not be possible.
Qualcomm Atheros Open Powerline Toolkit
Revisions
Nov. 2017: Added a “cd ..” to the command example and changed the path to plcboot to make the example more consistent. The open-plc-utils folder also has an “nvm” an “plc” subfolder, which may have been confusing.
Dec. 2017: Added bullet point on resetting the MAC address, thanks to reader Manfred Lischka for notifying me of the fact the MAC gets changed. Since I only had one broken adapter, I didn’t care too much. But he had two, which after recovery didn’t work since they had the same MAC.
Jan. 2018: I actually got the MAC reset commands wrong, since I didn’t do it myself. Should be better now.
June 2018: Added -i flag to plcboot command line, since the default of eth1 probably won’t work for most people. Added “Hints and issues” section. Thanks to Paolo Fiore for sharing his story, as well as Michael Stornes. Their experiences have inspired some of these changes.
/ *
- Copyright (c) 2013 Qualcomm Atheros, Inc.*
- All rights reserved.*
- Redistribution and use in source and binary forms, with or
- without modification, are permitted (subject to the limitations
- in the disclaimer below) provided that the following conditions
- are met:*
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.*
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.*
- * Neither the name of Qualcomm Atheros nor the names of
- its contributors may be used to endorse or promote products
- derived from this software without specific prior written
- permission.*
- NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
- GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE
- COPYRIGHT HOLDERS AND CONTRIBUTORS
AS IS
AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*--------------------------------------------------------------------/
This package is an open version of the Qualcomm Atheros PowerlineToolkit. It may be distributed as a zip, gzip or bzip2 tarball thatcontains source code and build scripts for Linux, OpenBSD, MAC OSXand Microsoft Windows. It also contains documentation in docbook XML,HTML and plain text format.
We recommend that you open file docbook/index.html with a web browserthe read Chapter 1 before attempting to install or use the toolkitbut the impatient may do the following and survive...
TO INSTALL
- Enter package folder using
cd open-plc-utils
. - Compile all tools using
make
. - Install all tools to /usr/local/bin using
sudo make install
. - Compile and install man pages in /usr/share/man/man1 using
sudo make manuals
.5 Change to the documentation folder usingcd docbook
. - Add page index.html to browser favorites.
- Add page toolkit.html to browser favorites.
Note: 'make' is assumed to be the GNU make command (often available under the name 'gmake').
TO UNINSTALL
- Enter package folder using
cd open-plc-utils
. - Remove installed programs using
sudo make uninstall
. - Remove all package files using
rm -r *
.
Note: 'make' is assumed to be the GNU make command (often available under the name 'gmake').
CONTRIBUTORS
Alejandro Vasquez [email protected] Younes [email protected] Barnes [email protected] Wike [email protected] MaierChristian Aurich [email protected] Fainelli [email protected] Kelleter [email protected] BertolaMathieu Olivari [email protected] Poullet [email protected] Heimpold [email protected] Houghton [email protected] Shang [email protected] Sepehrdad [email protected] Wahren [email protected] Henze [email protected]