keys.h file so firmware can connect as the correct device. This file is generated for a specific device and should be treated as private device credentials.
[image:device detail page showing the Keys (keys.h) card and Download File button]
What keys.h is for
keys.h helps your firmware identify itself to Firmngin and open a secure connection. In normal Arduino firmware, the file is placed next to your sketch and included before the Firmngin library starts.
You do not need to edit the file manually. Download it from the dashboard, place it in the firmware project, then use it when uploading firmware to the matching device.
End-to-end encryption (E2EE)
Firmngin can use E2EE to protect device messages beyond the normal secure connection layer. When E2EE is active for a device, the firmware and platform use device-specific keys so supported device messages are protected while they travel between the device and Firmngin services. For users, this means:- Device commands and device data get an additional protection layer.
- Each device has its own key material, so one device should not share another device’s
keys.h. - The firmware should use the latest downloaded
keys.hfor the device it is uploaded to. - Dashboard users do not need to manage the encryption process manually.
E2EE is handled by the platform and supported firmware library. You only need to keep the correct
keys.h with the correct firmware project.How to download keys.h
- Open the Firmngin dashboard.
- Go to Devices.
- Select the device you want to connect.
- Find the Keys (keys.h) section.
- Click Download File.
- Place the downloaded
keys.hfile next to your Arduino sketch.
Important rules
- Use the
keys.hfile only for the device it was downloaded from. - Do not reuse one device key across multiple physical devices.
- Do not paste the file content into support chats, screenshots, documentation, or public examples.
- Do not commit
keys.hto GitHub or any public repository. - Store production keys only with the people or systems that need to upload firmware.
- If you regenerate device credentials, download the new
keys.hand upload firmware with the updated file.
When you need it
You usually needkeys.h when:
- Uploading firmware for the first time.
- Moving the firmware project to another computer.
- Rebuilding firmware after changing the sketch.
- Preparing a production device before installation.
keys.h with dashboard users who only monitor devices, view logs, manage automations, or review monetization activity.
Good practice
Keep example firmware safe by using placeholders in public code. Show wherekeys.h is included, but never show real device credentials.
For teams, keep each device’s file organized by device name or serial number outside the public source code folder. This makes it easier to avoid mixing credentials between devices.