[Solved] Restoring ESP32 chip license to HT-M00 flash memory

Hi,

A few days ago I received an HT-M00 gateway. It was very nicely working as a TTN gateway. :+1:

Today I connected it to my computer and, while working on an application with another ESP32-based board, I accidentally flashed the application code to the HT-M00 gateway. :man_facepalming:

In order to restore the firmware, I headed to https://resource.heltec.cn/download/HT-M00/firmware and got the “M00_firmware.zip” file. I unzipped it and proceeded to flash the firmware. However, before that, I erased the whole flash memory (this is commonly needed in other environments I usually work on). I believe this erase step actually deleted the chip license that was stored on the flash.

Therefore, after erasing the flash memory (don’t do it!) and successfully flashing the firmware back, I got the device only partially working again: I can boot it into “Configuration mode” and set up the wifi, etc. but, when I boot it into normal operation mode, I get the “GATEWAY STARTING” message on the OLED and the following on the serial port:

Heltec HT-M00 firmware Rev 1.2
WiFi SSID   :  MySSID
WiFi PASS   :  MyPassword
CH0 FREQ    :  868100000
CH1 FREQ    :  868300000
MIN SF      :  7
MAX SF      :  11
SERVER ADDR :  bridge.eu.thethings.network
SERVER PORT :  1700
TIME ZONE   :  UTC+5
GateWayID   :  XXXXXXFFFFXXXXXX
inside license error, check user license
Please provide a correct license! For more information:
http://www.heltec.cn/search/
ESP32ChipID=XXXXXXXXXXXX

I’ve browsed to that page and I’ve gotten the license for the device, but how can I restore it back to the flash?

Thanks!

1 Like

hi,

You can activate your M00 through the AT command of the serial port.

Like this: AT+CDKEY=A8593DDC3******1F023EDE6

series of numbers are the license you found according to the chip id.

Dear jasonXu,

Thank you very much for your help. I issued the AT command you provided:

Heltec HT-M00 firmware Rev 1.3

WiFi SSID   :  MySSID
WiFi PASS   :  MyPassword
CH0 FREQ    :  868100000
CH1 FREQ    :  868300000
MIN SF      :  7
MAX SF      :  11
SERVER ADDR :  bridge.eu.thethings.network
SERVER PORT :  1700
TIME ZONE   :  UTC+2
GateWayID   :  XXXXXXFFFFXXXXXX
inside license error, check user license
Please provide a correct license! For more information:
http://www.heltec.cn/search/
ESP32ChipID=XXXXXXXXXXXX
  => [ AT+CDKEY=_my_activation_code_ ]
The board is actived

and the gateway is working again. Thank you very much for your help and quick reply! :slight_smile:

Just to make it clear, the page https://resource.heltec.cn/search gives a license code like:

0x0AD417DA,0x3372211C,0xD201F111,0xED5F8233

and for the AT command needed to activate the gateway the 0x and the ,s need to be removed:

AT+CDKEY=0AD417DA3372211CD201F111ED5F8233

(Note the numbers above are made up.)