ESP-AT🔗
Introduction🔗
Instead of developing embedded software directly on the PAN9520, you can use a AT software for controlling the module with a host. The AT firmware is provided by Espressif and is available as pre-built binary set or as source code.
The following web pages are related to the AT software:
The latest release for the PAN9520 is v2.1.0.0_esp32s2
.
Warning
The PAN9520 is a radio certified module. There are conditions on hardware and software which must be met for the modular approval to be valid.
For detailed information please refer to PAN9520 Module Integration Guide at
Overview🔗
There are different ways you can use the AT software:
-
Pre-build AT software with supplied configuration files
-
AT software built from source code with supplied configuration files
-
Pre-build AT software with manual changes to configuration files
The recommended way is to use the pre-built software with the supplied configuration files as explained in Pre-Build Binary Supplied Configuration.
As of today you can choose between a sets of configuration files for Europe (RED) and US / Canada (FCC / IC).
Whenever you program the AT software, it is mandatory for you to use the configuration files factory_param.bin
and phy_init_data.bin
that match PAN9520. If you do not follow this requirement the modular approval of PAN9520 may be void.
Other ways are also possible, for example to build the AT software from source code and make the necessary changes directly in the source code. This is not explained in this guide, but you can refer to Modify Factory param data for details.
Pre-Build Binary / Supplied Configuration🔗
You can download the latest pre-built binaries for PAN9520 from ESP-AT ESP32-S2 Binaries.
Note
It is recommended to use the Espressifs WROVER Wi-Fi module binaries, because the WROVER features the same memory densities as the ENW49D01A1KF.
Then you have to download your desired set of configuration files from the Downloads page.
After you have unzipped all archives you should have the following set of files available:
-
factory_WROVER.bin
-
factory_param_RED.bin
(orfactory_param_FCC_IC.bin
) -
phy_init_data_RED.bin
(orphy_init_data_FCC_IC.bin
)
You can program the AT software now by following the instructions in Programming.
Source Code / Supplied Configuration🔗
If you do not want to use a pre-built AT software, you compile it from the source code that is provided at ESP-AT Source Code (v2.1.0.0_esp32s2).
Prerequisites🔗
The following instructions show you how to do the compilation on a minimal installation of Ubuntu Server LTS 22.04 with no prior installation of the Espressif IoT Development Framework (ESP-IDF).
The compilation requires the Python interpreter to be available as python
, but this is not the case on Ubuntu Server LTS 22.04 anymore.
- You can make
python
available by adding a system-wide symbolic link:sudo ln -s /usr/bin/python3 /usr/bin/python
The compilation requires the cmake
, git
and other tools to be available, but they might not be installed yet.
- You have to install some tools in your system:
sudo apt install cmake git python3-pip
Compilation🔗
In order to compile the AT firmware carefully execute the following steps:
-
You have to create a suitable environment in your system
mkdir -p ~/esp cd ~/esp
-
You have to retrieve a specific version of the repository for the Espressif IoT Development Framework (ESP-IDF)
git clone --recursive --single-branch -b v4.2 https://github.com/espressif/esp-idf.git
-
You have to enter the newly created directory and finish the installation
cd ~/esp/esp-idf ./install.sh esp32s2
-
You have to return to top of the environment and clone the ESP-AT Source Code (v2.1.0.0_esp32s2)
cd ~/esp git clone --recursive --single-branch -b v2.1.0.0_esp32s2 https://github.com/espressif/esp-at.git
-
You have to enter the AT software repository and prepare the environment
cd ~/esp/esp-at . ~/esp/esp-idf/export.sh export ESP_AT_PROJECT_PLATFORM=PLATFORM_ESP32S2 export ESP_AT_MODULE_NAME=WROVER-32 export ESP_AT_PROJECT_PATH=$(pwd)
-
The Espressif IoT Development Framework (ESP-IDF) modifies the Python search path, so it is possible that the
xlrd
Python module is not found correctly. You may have to manually install thexlrd
Python module locallypip install xlrd
-
Finally you can build the software
idf.py -DIDF_TARGET=esp32s2 build
You can find the resulting AT software in ./build/factory/factory_WROVER-32.bin
.
Then you have to download your desired set of configuration files from the Downloads page.
After you have unzipped the archive you should have the following set of files available:
-
factory_WROVER-32.bin
-
factory_param_RED.bin
(orfactory_param_FCC_IC.bin
) -
phy_init_data_RED.bin
(orphy_init_data_FCC_IC.bin
)
You can program the AT software now by following the instructions in Programming.
Pre-Build Binary / Manual Configuration🔗
You can download the latest pre-built AT software for PAN9520 from ESP-AT ESP32-S2 Binaries.
Note
It is recommended to use the Espressifs WROVER Wi-Fi module binaries, because the WROVER features the same memory densities as the ENW49D01A1KF.
You are not forced to use the the provided set of configuration files from the Downloads page.
But if you decide to use the configuration files from the official release, you have to modify them first to make them fit to PAN9520.
RF Power Settings and Limits in phy_init_data.bin
🔗
The PAN9520 has been certified and received a modular approval. As a requirement for this approval to be valid, you must limit the power for different modulations and channels depending on the location the device is operated in. The related settings are configured by the file phy_init_data.bin
.
You have to use a phy_init_data.bin
file that complies with the regulations instead of the original phy_init_data.bin
.
For details on the necessary changes that you have to apply to phy_init_data.bin
from the pre-built AT software refer to the PAN9520 Module Integration Guide at
Default Settings in factory_param.bin
🔗
On the PAN9520 evaluation board, the standard UART1 pins (GPIO17 to GPIO20) are connected to the FT232 USB to UART interface.
However, the default factory_param.bin
for the WROVER module configures GPIO21 as pin RX instead of GPIO18.
For a convenient usage of the pre-built AT software with the PAN9520 evaluation board you should modify factory_param.bin
to compensate these changes.
If you want to adapt the original factory_param.bin
, the following requirement must be met:
-
A Hex Editor is installed. In the following explanations the tool HxD is used.
-
You have unpacked the lasted release of the AT software to a convenient location.
-
Navigate to the folder customized_partitions.
-
Open either
factory_param.bin
orfactory_param_WROVER.bin
with HxD. -
Copy the bytes (hexadecimal format)
FC FC 02 05 40 01 01 0D 45 55 00 00 00 C2 01 00 11 12 14 13
-
Right-click on position 00 (1) > Paste write (2) to paste the bytes.
-
Click File (1) > Save (2) to save the changes.
For details on how you can adapt factory_param.bin
please refer to How To Create Factory Parameter Bin.
Please note that the provided data set contains the following default country code settings:
Setting | Default value | Byte position |
---|---|---|
Country Code | EU | bytes 8 to 11 |
Start Channel | 1 | byte 6 |
Number of Channels | 13 | byte 7 |
Maximum Power | 64 (64x0.25=16 dBm) | byte 4 |
Putting Everything Together🔗
After you have modified the configuration files you should have the following set of files available:
-
Original
factory_WROVER.bin
-
Your modified version of
factory_param.bin
-
Your modified version of
phy_init_data.bin
You can program the AT software now by following the instructions in Programming.
Programming🔗
The following requirements must be met:
- You have installed a flash download tool. In the following description the tool "Flash Download Tools" is used. You can download this from Espressif's Download Area.
If you need more information about programming you can also refer to Espressif's Downloading Guide.
AT Software🔗
First you have to program the original AT software.
-
Open ESP DOWNLOAD TOOL.
-
Select the AT software file
factory_WROVER.bin
(1). -
Enter the address 0x0 (2).
-
Enable the option DoNotChgBin (3).
-
Click Start (4) to program the AT software.
You have programmed the AT software.
Configuration Files🔗
Afterwards you have to overwrite parts of the AT software with the configuration files for PAN9520.
-
Select the configuration files
factory_param_RED.bin
andphy_init_data_RED.bin
(1). -
Enter the address 0x2D000 (2) and address 0xF000 (2).
-
Disable DoNotChgBin (5).
-
Click Start (4) to start programming.
You have programmed the configuration files. The AT software is now ready to be used.