NAM – how to update firmware manually
Nettigo Air Monitor runs firmware developed using Arduino libraries. Today, a few words about how to upload firmware to the device.
Normally, this should not be of interest to anyone – updates are distributed through the update server, and the only thing you need to choose is the update channel: stable or beta. There is also an alpha channel, but I really do not recommend using it unless we specifically ask you to. We use it rarely, usually when diagnosing a particularly unusual problem.
But things are not always “normal”. For example, we recently had a case involving NAM units installed in an isolated network with no internet access. So here I will describe several ways to upload firmware directly to a NAM.
A small note: this guide applies to NAM 0.3 units based on the ESP8266. I will briefly cover ESP32 NAM versions at the end.
PlatformIO – the default choice
The firmware is developed using Arduino libraries, but not in the Arduino IDE. We use PlatformIO CLI, and during testing or development I usually upload firmware using the tools provided by PlatformIO, regardless of whether the upload is done over USB or “over the air” using OTA.
This requires downloading the source code and configuring the environment, although PlatformIO handles most of that automatically. Then a command such as:
pio run -t upload -e lang_pl --upload-port=/dev/ttyUSB0
is enough to compile and upload the firmware via USB.
Without network access, things become slightly more complicated. For example, you need to download all dependencies beforehand before you can compile and upload the code.
When that is not possible, or you simply do not want to deal with compiling for some reason, you can download the correct binary for the required release and upload it directly. The binaries are available in the NAMF GitHub repository. Once downloaded, all that remains is to flash them.
Uploading bin file over USB
In the past, every NAM used a Wemos-type module with a USB port. For quite some time now, NAM PRO units have used Bidamos, a simple ESP-07S-based module without a USB port.
This change was caused by the poor quality of Wemos Pro modules over an extended period. We kept encountering problems with Wi-Fi range, stability or I2C operation, so we have create Bidamos, module in Wemos format but based on ESP07s. However those modules does not have USB port.
For NAM units equipped with Bidamos, USB flashing is still possible, but it requires a USB-to-serial converter.
Regardless of the module variant, you need esptool. It is available as a Python package. Install it using pip:
python -m pip install esptool
If your NAM uses a Wemos module, connecting it to the computer will create a new serial port. On Linux, check dmesg immediately after connecting the device. On Windows, look in Device Manager.
On Linux, the port will usually be USB0, so the full path will be:
/dev/ttyUSB0
On Windows, it may be something like:
COM4
Open a terminal. First, you may erase the flash memory:
esptool --port /dev/ttyUSB0 erase-flash
This step is optional, but it is worth doing.
Then upload the binary itself:
esptool --port /dev/ttyUSB0 --baud 460800 write-flash 0x0 firmware.bin
Here, firmware.bin is the name of the NAMF firmware file downloaded from GitHub, for example latest_en.bin. If the file is stored in another directory, provide the full path. Of course, replace the serial port with the one used by your system.
Help! I do not have a USB port
If your NAM uses Bidamos, the procedure is the same, but you need to connect a USB-to-serial converter operating at 3.3 V logic level to the TX and RX pins, as well as power and ground. Then:
- Press and hold the PRG button on Bidamos.
- Press RST.
- Release RST.
- You may then release PRG.
The ESP8266 on Bidamos is now in programming mode, and you can upload firmware in the same way as with a Wemos module. After flashing is complete, press RST so that Bidamos boots normally.
You can connect directly to Bidamos while it is removed from the NAM using jumper wires, or while it is installed in the NAM.
When it is installed in the NAM, use the EXT connector and connect it as shown in the photo below. The EXT connector maps the Wemos pins one-to-one, exactly as they appear in the NAM.
On the Wemos module inside the NAM, the TX and RX pins are located in the upper-left corner. The same applies to the EXT connector: the first two pins from the left in the upper row are TX and RX.

I have just noticed that the photo angle is not ideal — the GND connection is not visible. So here is a table:
| Converter pin | Pin on the EXT connector |
|---|---|
| RX | TX — upper row, first from the left |
| TX | RX — upper row, second from the left |
| GND | GND — upper row, second from the right |
| VCC — jumper set to 3.3 V | 3V3 — lower row, first from the right |
Remote uploading
In the Arduino world, OTA can mean two different things.
It may refer to downloading new firmware from an update server, or to an upload initiated from a computer on the same local network as the NAM. I will now describe the second method, because this is the one you can use yourself. The update server is under our control.
First, you need a tool capable of uploading firmware to an ESP device over the local network. PlatformIO supports both USB and network uploads. For network uploads, add the following setting to platformio.ini:
upload_protocol = espota
Uploading firmware over the local network is possible when the NAM configuration has:
- an administrator-panel password set,
- authentication enabled,
- OTA activated.
To activate OTA, open in browser:
http://NAM_IP/ota
In the example above, this would be:
http://192.168.1.200/ota
Once activated, firmware uploading will be available for 60 seconds, provided that the password has been configured and authentication is enabled.
Then run:
pio run -t upload -e lang_pl --upload_port=192.168.1.200 --auth=PASSWORD
What if you do not have PlatformIO and do not want to install it and still upload remotely?
The Arduino ESP32 repository includes a Python script called espota.py, which can be used to upload a binary remotely. Although it is stored in the ESP32 repository, it also works perfectly well with the ESP8266.
Download the file using the three-dot menu in the upper-right corner and choose Download. Save it locally as:
espota.py
Then, after enabling OTA on the NAM, run:
python espota.py -i 192.168.1.200 -f ~/PATH_TO_FILE/firmware.bin -a PASSWORD
As I mentioned, I mostly use the OTA mechanism built into PlatformIO, and I have the impression that, at least in my test environment, the PlatformIO version is slightly more reliable.
With the standalone script, the upload process occasionally stalled, although in general it does work.
NAM and ESP32
Newer version (NAM 0.4) are based on ESP32. Uploading using Platformio is exactly the same like with ESP8266. When you want to upload just bin w/o compiling source – grab bin file from GitHub and use espota.py to upload. When uploading via USB and esptool you will need whole flash image not just bin file. In future versions I will try to include also correct flash image alongside of just bin file for ESP32 versions.
