Project Thumbnail

Automated Firmware Recovery Tool

In 2020, during the rise of the COVID-19 pandemic, the company I work for began selling a large number of autonomous access control devices with temperature detection. These devices were designed to identify people with fever and automatically block access to certain areas, adding an extra layer of health safety.

However, the devices turned out to be quite fragile, and the firmware would often get corrupted, leaving them unusable. To avoid the high cost and delay of sending the devices for repair, the manufacturer (based in Asia) offered remote support. They would connect to our network, access the broken devices via Telnet, and manually restore the firmware.

This process worked, but it was very slow: only 3 or 4 devices could be recovered per day, while we were receiving over 10 faulty devices daily. As a result, the number of broken devices was quickly piling up.


After fully understanding the process the manufacturer followed, I decided to automate the entire procedure. The idea was to build a Python script that would connect to the devices via Telnet, upload the firmware using TFTP, and apply it automatically.

The main goal was to eliminate the need for external support and to scale the recovery process, so we could fix all the devices faster and more efficiently.


I developed the solution using Python, and used libraries to manage Telnet connections and TFTP transfers. The script automates these steps:

  • Telnet login: It tries different passwords automatically, since not all devices share the same credentials.

  • Firmware upload via TFTP: Once logged in, the script transfers the new firmware to the device.

  • Firmware installation: Using Linux shell commands, it applies the firmware to restore the system.

  • User options: The script allows the user to customize the device IP, and choose between a basic or advanced recovery mode (the latter includes several reboots for deeper recovery).

Technical challenges

  • Password variability: Solved by trying a list of known passwords.

  • Simple but flexible interface: I added command-line options for different recovery scenarios.

  • Network stability: Added automatic retries in case of temporary connection issues.

Results or Impact

Thanks to this script, we achieved:

  • Full independence from the manufacturer for device recovery.

  • An increase in recovery speed: from 3–4 to over 10 devices per day.

  • A significant reduction in downtime and backlog of broken devices.

  • Improved service quality for our clients due to faster recovery times.

Lessons Learned

Technically

  • Learned to work with Telnet and TFTP protocols in Python.

  • Gained experience automating low-level tasks on embedded Linux systems.

  • Improved at writing robust and customizable scripts for real-world operations.

Professionally

  • Took a proactive role in solving urgent technical issues.

  • Improved in independent decision-making and clear documentation for teammates.

Personally

  • Gained confidence in identifying and solving operational bottlenecks.

  • Confirmed the value of fully understanding manual processes before automating them.

Technologies

Recent Projects

About Me

about-me-user-img

Francesco Esposito

Data Scientist

Data enthusiast turning messy information into meaningful insights. I mix creativity, code, and curiosity to make data work.