You need the program 'ar' from xtensa-lx106-elf found here

I am trying to connect a AiThinker Nodemcu 8266 to hivemq. I am referring the tutorial

But when I try to generate the certificate using “” , I get following error:

Traceback (most recent call last):
  File "c:\Users\sri\Downloads\", line 28, in <module>
    raise Exception("You need the program 'ar' from xtensa-lx106-elf found here: (esp8266-arduino-core)/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/bin/ar")
Exception: You need the program 'ar' from xtensa-lx106-elf found here: (esp8266-arduino-core)/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/bin/ar

I checked in my whole system, but there is no folder


Also there is no file “ar.exe” in whole system.

Any pointer to resolve the issue would be great help.

@logicallimit ,
Great to see your interest in MQTT and HiveMQ, welcome to our community !

Could you please confirm:

  • did you follow all steps from the tutorial or you skipped some?
  • did you find the ar.exe anywhere on your machine or it is missing completely?
  • are you executing the script with python or python3?
  • what is your python --version and python3 --version ?

Dasha from HiveMQ team

I have a project compiled and running using Arduino with Visual Studio Code on a D1 Mini NodeMcu board with a ESP8266-12F module. The archiver was installed via the Arduino Library Manager to here:


FYI, my project is using the following includes:

  • ESP8266WiFi
  • CertStoreBearSSL
  • DallasTemperature
  • FS
  • GDBStub
  • LittleFS
  • MQTT or PubSubClient
  • OneWire
  • time
  • TZ
  • U8g2lib
  • Wire

The above is too much for the SSL to work properly with limited RAM available. The certificate store processing crashes when it runs out of heap. I managed to get it initialising, displaying sensor reading on an 128x64 I²C OLED display and sending data to a HiveMQ broker by disabling SSL security checking. This is achieved by un-commenting the setInsecure call from the HiveMQ example code.

If you manage to find the archiver, get the file system uploaded, have anything more than the basic example and it is still crashing then please remember to try the setInsecure call for testing.

1 Like

Hello, @Daria_H I am facing the same problem so I am trying to use the same thread :slightly_smiling_face: In may case, I followed all the steps with lots of attention. No I don’t have the ar.exe file in my machine. Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32 is the version I am using. I hope you can help me with that!

Problem solved! Thank you

In my case, it was a problem of recognizing the path/ program.
I’ve solved this by changing the script to search for the path I wanted and directly using the binary.
As follow:

  1. if which(‘xtensa-lx106-elf-ar’) is None and not os.path.isfile(‘./xtensa-lx106-elf-ar’) and not os.path.isfile(‘./xtensa-lx106-elf-ar.exe’):
    raise Exception(“You need the program ‘ar’ from xtensa-lx106-elf found here: (esp8266-arduino-core)/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/bin/ar”)
  2. arCmd = [‘./xtensa-lx106-elf-ar.exe’, ‘q’, ‘data/’] + derFiles;
  3. run the script directly from the path ( c:\Users\XXX\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc…)