Mashing up yours and Uwe's excellent recipes (on Ubuntu*) for a bit more granularity/elaboration, for folks with slightly less experience, as our audience will likely include all backgrounds . . . certainly, I had to interpolate a bit . . .
[*= Win will have a different default directory location, and possibly different MAC address syntax, and Win MAC notation generally uses hyphens '-' rather than colons ':' as byte separators for MACs.]
The open-plc-utils: programs to manipulate the AR7420 IC in the TL-PA4010
There is a .deb package available for install -- no compiling from source -- for Linux distributions that can use .deb packaging. If you are comfortable installing from a PPA (a non-secured repository), the package lives on
https://launchpad.net/~roguescholar/+archive/ubuntu/snapshots. I have not used it.
AFAICT, aside from that .deb, the open-plc-utils are not available as precompiled binaries, meaning the sources have to be downloaded and compiled for the target system (unless someone knows of precompiled binaries, in which case I'll edit this out). Obtain the open-plc-utils by cloning (copying) the source files from its Git repository. Assuming you have git installed ("
sudo apt install git"), the following command will copy the source files to a new directory that will be created:
asavage@Ubuntu1:~$ git clone https://github.com/qca/open-plc-utils
Copying a snippet from its README:
[ . . . ]
1. Enter package folder using "
cd open-plc-utils".
2. Compile all tools using "
make".
3. Install all tools to /usr/local/bin using "
sudo make install".
[ . . . omitting steps for documentation installation, which isn't really necessary unless getting into the nitty-gritty stuff . . . ]
Now you have actual utilities that can be run.
Connect the hardware to your host
The RL-PA4010 needs power, and it needs an enet cable from it to your host. Make sure you have an LED lit on the unit (power is on).
For enet, use a std cable to your host or your host's network. I plugged into a local enet switch, but plugging directly into your host will be fine with modern hardware (I remember when
Auto-MDIX didn't exist . . . ).
Take a copy of your unit's Parameter Information Block (PIB)
From the open-plc-utils folder . . .
asavage@Ubuntu1:~$ int6klist -ieth0 -v
Note: I don't have "eth0", I have "enp6s0", so be aware that your ethernet interface name may vary. If, when you run the above line, your output is something like:
try
to find your active ethernet interface name, and use it instead of "eth0". It will almost certainly begin with 'e'. If you have multiple interfaces whose name begins with 'e', you'll have to try them sequentially to figure out which one your TL-PA4010 is connected to. Here's the output on my system:
The output of int6klist should be similar to this:

- Sample output of "int6klist -ieth0 -v"
. . . and the MAC address is listed in two places.
Alternatively, use:
asavage@Ubuntu1:~$ plcstat -t -i eth0
Output for my unit:
Code: Select all
P/L NET TEI ------ MAC ------ ------ BDA ------ TX RX CHIPSET FIRMWARE
LOC CCO 001 F4:F2:6D:BA:3C:FA 18:03:73:45:8C:8E n/a n/a QCA7420 MAC-QCA7420-1.0.0.337-01-20120309-FINAL
Copy the the MAC address (including the ':' separators), and use this command read the configuration (the PIB) from the PLC adapter and write it to a .pib file:
asavage@Ubuntu1:~$ plctool -ieth0 -p original.pib F4:F2:6D:BA:3C:FA // Change the blue text to
your adapter's MAC address.
You can name this PIB file anything you like, and if you'll be working with multiple units, possibly from multiple markets (UK, EU, US, etc.) you may want to be more creative with the filename, to keep them discrete.
Updating the firmware
Take a copy of your unit's Parameter Information Block (PIB) before changing the firmware! (see above).
I chose to update the firmware at this step. My unit's firmware is dated 2012. TP-Link lists firmware for "V1" and "V3" versions, and while there's no way for me to determine which version of hardware I have . . . and because I see sporadic issues with people having seemingly unrecoverable issues with upgrading the TL-PA4010 when starting from very old firmware, and because I've lived a long time and have seen a few things, I upgraded in steps: first to a 2015 firmware, then to the 2020/latest. Turns out, while the two "V1" and "V3" firmware at TP-Link's site both installed OK -- I updated them sequentially -- they both have the same firmware date after flashing, though when inspecting hex they have small internal diffs.
I obtained the 2015 firmware from
https://www.tp-link.com/us/support/download/tl-pa4010-kit/v1/#Firmware:
https://static.tp-link.com/TL-PA4010(US)_V1_160316.zip. I extracted the NVM & PIB files from it, to the open-plc-utils folder (though that's not necessary, but I like shorter commandlines). The following command will write the new firmware (NVM) and configuration (PIB) to the unit:
asavage@Ubuntu1:~$ plctool -i eth0 -P QCA7420-WallAdapter-HomePlugAV_CE-ClassB.pib -N MAC-7420-v1.3.0-00-CS.nvm -R F4:F2:6D:BA:3C:FA // Change the blue text to
your adapter's MAC address.
The update process took about ten seconds to complete. Lots of output on the screen, but summarizing:
Code: Select all
enp6s0 F4:F2:6D:BA:3C:FA Start Module Write Session
enp6s0 F4:F2:6D:BA:3C:FA Flash QCA7420-WallAdapter-HomePlugAV_CE-ClassB.pib
RESERVED 0x00000000
NUM_OP_DATA 1
MOD_OP 0x11
MOD_OP_DATA_LEN 1423
[ snipped lots, mostly repeating stuff ]
MODULE_LENGTH 1148
MODULE_OFFSET 0x047C0000
enp6s0 F4:F2:6D:BA:3C:FA Close Session
enp6s0 F4:F2:6D:BA:3C:FA Reset Device
enp6s0 F4:F2:6D:BA:3C:FA Resetting ...
Checking using plcstat again:
asavage@Ubuntu1:~$ plcstat -t -i eth0
Code: Select all
P/L NET TEI ------ MAC ------ ------ BDA ------ TX RX CHIPSET FIRMWARE
LOC CCO 001 F4:F2:6D:BA:3C:FA 18:03:73:45:8C:8E n/a n/a QCA7420 MAC-QCA7420-1.3.0.2134-00-20151212-CS
2015: looks good.
I have been unable to locate catphish's QCA7420-MAC-QCA7420-1.5.0.26-02-20200114-CS as a package (ie NVM + PIB files), but the NVM alone can be found at
https://mega.nz/file/ocNDhYzK#xuSQXd-b6CzzfpSXaK7r5BV4i3pXmnstYMjZX5WEWHc and he also uploaded it to OI earlier in this thread:
https://openinverter.org/forum/download/file.php?id=19195. AFAICT, having a replacement PIB is not strictly necessary, as long as you have saved a copy of your unit's, or can locate a compatible one, and then only in the event of something screwing up. If you update the firmware, you'll want to pull another PIB from your unit to use anyway (read on).
asavage@Ubuntu1:~$ plctool -i eth0 -P QCA7420-WallAdapter-HomePlugAV_CE-ClassB_us_401030.pib -N FW-QCA7420-1.5.0.0026-02-CS-20200114.nvm -R F4:F2:6D:BA:3C:FA // Change the blue text to
your adapter's MAC address.
asavage@Ubuntu1:~$ plcstat -t -i eth0Code: Select all
P/L NET TEI ------ MAC ------ ------ BDA ------ TX RX CHIPSET FIRMWARE
LOC CCO 001 F4:F2:6D:BA:3C:FA 18:03:73:45:8C:8E n/a n/a QCA7420 MAC-QCA7420-1.5.0.26-02-20200114-CS
2020, yea.
Modifying the PIB to enable EVCC use
I renamed "original.pib", which was in the unit with 2012 firmware, to something else. Then I took another copy of the PIB from the unit with 2020 firmware: it's different. Rather than modifying the early PIB, I used the later one. Use the same step as earlier:
asavage@Ubuntu1:~$ plctool -ieth0 -p 20200114_original.pib F4:F2:6D:BA:3C:FA // Change the blue text to
your adapter's MAC address.
Use the setpib tool to modify this PIB for EVCC use:
asavage@Ubuntu1:~$ setpib 20200114_pev.pib 74 hfid "PEV"
asavage@Ubuntu1:~$ setpib 20200114_pev.pib F4 byte 1
asavage@Ubuntu1:~$ setpib 20200114_pev.pib 1653 byte 1
asavage@Ubuntu1:~$ setpib 20200114_pev.pib 1C98 long 10240 long 102400
Write the configuration file to the PLC adaptor:
asavage@Ubuntu1:~$ plctool -ieth0 -P TL-PA4010_20200114_pev.pib F4:F2:6D:BA:3C:FA // Change the blue text to
your adapter's MAC address.
This takes about one second to accomplish, mostly the reset.
Code: Select all
enp6s0 F4:F2:6D:BA:3C:FA Start Module Write Session
eth0 F4:F2:6D:BA:3C:FA Flash TL-PA4010_20200114_pev.pib
[ . . . ]
enp6s0 F4:F2:6D:BA:3C:FA Close Session
enp6s0 F4:F2:6D:BA:3C:FA Reset Device
enp6s0 F4:F2:6D:BA:3C:FA Resetting ...
At this point, you're done with configuring the AR7420 on the TL-PA4010