We strongly encourage users to report bugs and other issues in the Issues section of the project Github. You ideas to improve the functionality are also welcome!
The firmware is primarily designed to run on hardware developed and sold from our webshop https://amsleser.no. Our designs are currently based on the Espressif ESP32-S2 micro controller with 4 MB flash memory. Previous models were based on the Espressif ESP8266 micro controller.
The firmware can also be configured to run on user hardware by selecting a “generic” hardware profile during setup - and assigning GPIOs on the Configuration screen.
The firmware connects to the following peripherals:
Micro controller connections
When using the firmware with our devices Pow-K, Pow-U and Pow-P1, the hardware profile is predefined, so the micro controller knows how to address the peripherals.
If the firmware is run on user hardware, GPIO allocation is done by selecting a “Generic” hardware profile, which allows allocation of GPIOs on the configuration screen.
Pow-K: Remove the device from the power meter, press the RESET button available at the back of the board (or just wait 15 seconds for the board to run out of power. The board will work for a short period, powered by the supercapacitor.) Then re-insert the device in the power meter.
In both cases, reboot is confirmed by a short green/yellow/green blink sequence on the RGB LED.
Pow-U and Pow-P1 need external power on the USB port during Access point mode. Failing to do so could result in non-functional device that will need re-flashing.
Pow-K can be in Access point mode while the device is seated in the power meter.
Press and hold the "AP" button until the LED is steady yellow (white on Pow-U and Pow-P1). A factory new device should enter this mode directly after power-up.
Activate "Access point mode" as indicated above. This is confirmed by steady yellow on the LED (white on Pow-U and Pow-P1). A factory new device should enter this mode directly after power-up.
The Device will now set up the Wi-Fi access point AMS2MQTT (with no password). Connect your PC, pad or mobile phone to it.
The Setup page for connecting the device to your Wi-Fi will be displayed:
Connection Select "Connect to WiFi" for a normal setup; most users will use this. Select "Standalone access point" if there is no WiFi on site, and user wants to connect to the device, for instance a cottage ("hytte" / “sommerstuga” / “landsted”) without WiFi.
SSID The detected SSIDs will be shown when you activate this field. Select the preferred Wi-Fi access point. Note: Must be a 2,4 GHz access point (not 5 GHz)
PSK Enter the password for the selected SSID.
Hostname You can replace the proposed default to something that is easier to remember. The hostname can later be changed on the configuration page. Depending on your Wi-Fi router:
1) Hostname is registered in your router DNS service. Device can then be reached on http://hostname.
2) If your router supports mDNS, the Device can be reached on http://hostname.local.
Static IP is recommended, as it will speed up the connection to Wi-Fi.
An alternative to setting Static IP at initial configuration:
Proceed with DHCP (your router will assign an available IP)
When device has rebooted (no longer in Access point mode), consult the Status/Info page, and note the IP address the device is assigned.
Go to the Configuration page and configure Static IP on the assigned IP address
Parameters for configuring static IP:
IP Enter an unused IP address on your network (consult router user panel).
Subnet The "/24" indication means Subnet 255.255.255.0 – which is correct for most users. (Those that need a different setting will surely know what to select!)
Gateway This is your router IP address. (Run "ipconfig" from a PC command window; look for "Default Gateway")
DNS 1.1.1.1 is a publicly available DNS server. Use this if in doubt. You can often also use the IP address of your router.
Press “Save”. The Device will restart, connecting it to your router. The AMS2MQTT access point will no longer be available.
Reconnect your PC/pad/mobile phone to your router and connect to the Device using its IP address or mDNS Hostname. In most cases, this will be automatic; just wait for the browser window to reconnect.
If your device is new, you will be asked whether you accept some data collection that is needed to enable one-click firmware upgrade of your device. This can later be changed from the Status/Info page:
Select and click Save. The main screen will then open, initially without data:
If your device is a Pow-U or Pow-P1, you can now remove the external power and connect the device to your meter using the appropriate cable.
After a few payloads, the device should auto-discover the baud rate and parity used by your meter and display some data on the main screen.
Factory reset: Resets settings to factory default and erases stored consumption records. It's a good idea to make a backup of the settings (Information / Backup & restore) first, to save current configuration. After a Factory Reset, the device will go into access point mode (indicate by yellow LED), as described in paragraph 4.1. The device will be in the same state as when you received it, so you will need to give it access information to you Wi-Fi router again.
Reboot: Reboots the device. If settings have been changed, make sure to click the blue Save button first.
Save: Use this button after making parameter changes. It saves configuration and returns to main page (and reboots if needed, depending on the change).
Hostname: Set an easy-to-remember name that can be used in the URL.
Time zone: Select from drop-down list.
Price region: Select your region from drop-down list. If your country is missing, please write a request issue on the project GitHub page.1 Only countries that are members of Entso-E can be covered. This is mainly European countries, but Turkey and Morocco are also members.
Currency: Select desired energy price currency from drop-down list.
Configure price: See below.
Enable: Activate "Enable price fetch from remote server" to fetch and display energy prices. The field below ("ENTSO-E API key, optional, read docs") can be used to enter your Entso-E API key. If left blank (recommended) you will read prices from our intermediate server, which is a more reliable API.
Security: This is used for password protection of your device. Select from the dropdown list if you want protection of everything, or only the configuration page.
Context: If you have secured your device behind a web proxy and set a path for it, set this here as well. Example: If you proxy from https://mydomain.tld/amsreader, you should set "amsreader" as context.
Examples of price modifiers. They are applied in the order they are listed:
The price configuration gives an option to configure price modifiers that modify the published spot price to fit with the contract you have with your energy supplier, regarding import (consumption) or export (production). Defined modifiers are applied in the order they are configured/listed, and can be configured with restrictions on:
"Import" is power you buy (normal consumption). "Export" is power you deliver to the grid, from solar panels, wind turbine etc. Note that this is not your power production, but what is exported to the grid.
Communication: Should in most cases be stay on "Passive (push)". (The "Pulse" option is for an experimental feature, reading data from pulsed meters.)
Serial conf.: Baud rate and parity should be auto detected, so you should normally not touch these settings.
Buffer size: Size of the payload read buffer. Increase it if you see payload error messages.
Voltage: Select the voltage of your installation: 230 or 400V. If you are uncertain, read all the small text on the front of your power meter. If 400V is at all mentioned, your system is 400V.
Main fuse: Enter the value of your main fuse. This is used only for scaling the current graphic.
Production: If you have solar panels, wind turbine or other energy production: Enter peak power potential from your production installation.
Meter is encrypted: If your meter is encrypted: Activate encryption and enter the two encryption keys (often called GPK60/61) provided by your grid company. Note: If your meter is encrypted, your grid company should provide encryption keys when you request activation of the HAN port. Some meters brands can be configured for more than one encryption format. You must request encryption keys in double-key format (GPK60/61): Encryption key + Authentication key. Enter the keys in the two fields, be careful to copy them correctly!
Multipliers: The multipliers can be used if the data coming from the meter need correction. Typical cases are:
Some larger ("industrial") installations may have current transformer installed. To display correct values on such installations, multipliers can be applied. Consult your grid company if the readings you see in the amsleser user interface are incorrect.
There are some known cases of meters that report an extra digit on some parameters, so that they display wrong values by a factor ten. Use multipliers to correct this. Example: If the displayed current reading is 10 times too high, enter 0.1 as current multiplier.
This section is used if you need to change the Wi-Fi SSID.
Connection: Select "Connect to WiFi" for a normal setup. Select "Connect to WiFi" for a normal setup. Most users will use this. Select "Standalone access point" if there is no WiFi on site, and user wants to connect to the device (for instance a cabin without WiFi). Probably very limited number of use cases. NOTE: Pow-U units must in this case be powered via USB cable.
SSID/Password: Select the SSID and enter its password.
Power saving: Recommended setting: - Pow-P1: Off - Pow-K: Minimum - Pow-U: This is the tricky one; default value is Maximum. If the user interface feels too little responsive, you may want to adjust the setting to Minimum and monitor the device to see if it is able to stay online (not lose voltage). If OK: Stay on Minimum. Additional information: https://amsleser.no/blog/post/25-pow-u-and-power-saving
Power: The ESP module radio transmission power can be adjusted. (This is an "experimental feature", the default value should be fine.)
802.11b legacy rates: Wi-Fi standard 802.11b is an old standard, not needed by newer Wi-Fi routers. Enable it only if you have a very old router and experience issues.
This section provides instructions on enabling and configuring a connection to an MQTT broker.
Server: You can use either an internal (local IP address) or external (cloud-based/hostname) MQTT broker. Please note:
If you enter a domain name instead of an IP address in the Server field, a DNS server is required in the Wi-Fi configuration if a static IP is used.
SSL is verified against the domain name of the server. Therefore, it’s crucial that the domain name in Host matches the name used in the SSL certificate. Please follow your MQTT broker’s guidelines carefully.
SSL requires the clock to be synchronized. If the clock in your device is incorrect, please adjust the NTP configuration.
Note that SSL does not work on ESP8266 based devices due to its limitations.
User/password: Use this if the MQTT broker requires password protection.
Client ID: This is how your device identifies itself to the MQTT broker. It can be freely chosen but must be unique among units connected to the same broker.
Payload: Select your desired payload format from the dropdown list.
Publish topic: Enter the desired MQTT Publish topic.
Update method: - Real time: All payloads are sent on MQTT as they arrive from the meter. - Interval: Allows selecting the time interval (seconds) to reduce the amount of data points in the receiving database
Timeout: MQTT parameter setting: Time (seconds) the client waits for an operation to complete
Keep-alive: MQTT parameter setting: Maximum time (seconds) between messages sent or received by the client
Note: Work in progress, functionality is being developed.
By activating AMS reader cloud the device will send data to our web server which can show a web page that mimics the main page in the user interface. This will allow you to access your user data from any internet-connected browser. Access to the service requires user create an account and log in. Using the service is for the moment free of charge.
How to use the service:
Activate AMS reader cloud on the configuration screen
Select protocol: In most cases the default “UDP” is fine. If connection is unstable, try “TCP” or “HTTP”
Press the blue Save button (bottom right).
When you Return to the configuration screen, a link “Connect to my cloud account” is shown. Click it.
A new browser tab will open
Click “Sign in” (upper right)
If you are a new user, create an account by clicking “Register”, then sign in.
If you are returning to the cloud service you might need to click “Overview” to open the main page.
On first login after device is tied to Cloud service, you will be prompted to give the device a name. This is especially useful if you want to connect to several readers with your account (home + hytte/sommarstuga/cabin etc). This one is named Pow-K at home:
Click Save.
A page similar to the ordinary main page is shown, but initially without historical data, as the history will be built up separately on the web server.
Note: The “Future energy price” graph shows the system price for the selected Price region, it does not yet take into account any Configure price settings/modifiers you may have done on your device.
By activating Energy Speedometer a QR code is displayed that will enable sending data to an Energy Speedometer.
There is no affiliation or links between Utilitech AS / amsleser.no and the company selling the Energy Speedometer. Any inquiries or questions regarding Energy Speedometer must be directed to the seller, using the contact form on their website.
Activation of this options sends data to a third party web server that Utilitech AS / amsleser.no do not have access to, and is not responsible for. Before activating, user must consider and decide whether data safety is sufficiently preserved.
This section is specifically for Norwegian (and some Swedish) users, to support the “Peak power” fee introduced in Norway in 2022 as part of the grid fee. This configuration section will therefore only be visible if a Norwegian or Swedish price region is selected in the “General” section.
If your consumption exceeds a certain threshold, a penalty fee will be added to your next monthly bill. If you also surpass the next threshold, the fee will increase – and so on.
In Norway, the value that is compared with the threshold levels is defined as the average of the highest hour-interval consumption on three different days of a calendar month.
The threshold levels vary between grid companies, so you need to consult the web page of your grid operator and adjust the levels if needed.
See here for an example that shows how to interpret the graph that results from activating this functionality.
This section allows you to customize which sections are displayed on the main page. This is particularly useful if you want to simplify the display for daily use.
From the pull-down menus, select Show, Hide, or Dynamic. The “Dynamic” option means that a section will be displayed if such data is available.
Please note that there is no temperature sensor on Pow-U, Pow-K, or Pow-P1 devices. You can install temperature sensor yourself on newer versions of Pow-K and Pow-P1 that are in sale from end 2023. See the device User manuals.
Device: Identifies your specific Pow-K/U/P1 device type.
MAC: Displays the MAC address of the device during normal operation.
AP MAC: Shows the MAC address of the device when in Access Point (AP) mode.
Last boot: Displays the time of the last reboot.
Reason: Shows the identified reason for the last reboot.
By clicking "Update consents", you can activate or revoke the permission to use one-click firmware upgrade of the device (during which some data is collected).
Pressing the “Reboot” button will reboot the device.
Displays the currently installed firmware version, and the latest version available.
After "Latest version", the version name is a link that turns red if a new version is available. If one-click upgrade is enabled, you can start the upgrade by clicking the symbol/link.
The “Select firmware file for upgrade” button can be used for installing a specific binary file. This is typically used when testing new versions, bug fixes, etc. When using this, only the “firmware.bin” file needs to be selected.
Use this to making and restore backups of the current configuration to/from a text file. This can be useful before installing “experimental” firmware versions, and a safety before upgrades.
You can select which part of the configuration is downloaded or uploaded.
The “Download” button is used for downloading backup of configuration from the device to a text file.
The “Select file” button is used for restoring configuration from a text file to the device.
Device voltage Displays the device operating voltage. Green light indicates correct voltage. If yellow or red, voltage is low.
For Pow-K and Pow-P1, the light should always be green.
For Pow-U, a low voltage (yellow) is relatively common, especially if the GUI is heavily used. Close GUI windows that are not in use. A red light indicates that the device is close to a low-power reset. The device will be unresponsive while recharging from a low-power reset.
HAN Green light indicates that the latest payloads from the HAN-port are read without error. If packages arrive that are rejected, the light will first turn yellow, then red.
Wi-Fi RSSI Shows Received Signal Strength Indication (RSSI) between Wi-Fi router and device. Yellow indicates low RSSI (weak Wi-Fi signal). Red indicates a very weak signal. Yellow level will usually work fine. If the signal is too weak, consider installing an access point (Wi-Fi extender or dedicated Wi-Fi router) close to the device.
MQTT Colour codes:
Green MQTT is activated, and the device is connected to an MQTT broker.
Red MQTT is activated but device cannot connect to the configured MQTT broker. (Check configuration settings!)
Grey MQTT is not activated.
Yellow Could potentially sometimes be seen during connection to MQTT broker.
If a new firmware version is released, there will be a reminder in the top bar:
Users who have accepted one-click upgrade can click on the message to initiate the upgrade. We recommend using the latest published firmware version.
This graph shows the current status on the Norwegian “Peak power” fee. It is only visible if a Norwegian or Swedish price region is selected in the Configuration / General section.
The status shown in above illustration means:
The current Peak Power average is 7.8 kW, and is the average of the highest-hour peak consumption on the dates 16th, 20th and 7th January.
The next "penalty level" (where a higher penalty fee would be applied) is 10 kW (indicated by red line)
This section displays hour by hour future energy prices based on settings in Configuration/General.
The leftmost bar is always the current price ("now"). Prices for next 24-hour period is published between 13 and 14h (CET), and will then be added to the graph.
This section displays energy use [kWh] per clock hour over the last 24-hour interval. There is no bar for the ongoing hour, the rightmost bar shows the previous whole hour.
Example: The bar denoted 15 is the consumption from 15:00:00 to 15:59:59.
The graph goes negative if there is excess energy produced from solar panels etc, meaning the displayed energy is exported to the grid.
This section displays energy use per day/date (24-hour period) during last month. There is no bar for the ongoing date, the rightmost bar shows yesterday’s consumption.
The graph goes negative if there is excess energy produced from solar panels etc, meaning the displayed energy is exported to the grid.
Some power meters (in particular those configured as “HAN-NVE”) report total accumulated energy only once per hour, read at xx:00:00, sent to the HAN port at approximately xx:00:05.
The Realtime kWh-indicator shown in the Power gauge and the Real time calculation tile is an estimate intended to mimic the value shown on the LCD screen of the power meter. It is estimated by integrating the power as follows:
Read and store value read from meter at whole hour
For each accepted payload received from meter, Power*time is added to Accumulated energy.
The value is reset at each whole hour when updated accumulated energy is reported by the meter.
Please note:
If the device experiences numerous HAN read errors, the estimate will become increasingly inaccurate as time since last accumulated value read increases.
After a reboot, the accumulation calculation will be reset, and the indicated value will be wrong until next whole hour has passed.
The firmware includes an option to recover from a lockout (e.g., forgotten password) from an otherwise operational device by performing an Emergency Factory Reset. After a factory reset, all settings will be lost.
The procedure is:
REBOOT the device
On Pow-K: Pull the device from the meter, and power it through the USB socket. Press the RESET button.
On Pow-U and Pow-P1: Press the RESET button.
When the device boots, it starts with a short period of green steady light. Press the AP button while the LED is green, then release it when the LED turns red. The factory reset is confirmed by a short sequence of rapid red blinks.
Certain errors will be indicated on the device LED.
Error codes are indicated with one code each 5 seconds (approximately). If two error codes are active at the same time, error code 1 will be shown, then after 5 seconds error code 2, then code 1 and so on.
One flash: Not reading valid data from power meter
Two flashes: No contact with specified MQTT broker
Three flashes: No contact with specified Wi-Fi access point
If new firmware is available, an indication with a link is shown in the status bar:
Upgrade by clicking the link.
Note: The one-click upgrade will not work unless you have accepted data collection. You can change your preference on the Status/info page by clicking the “Update consents” button in the “Device information” tile.
Download the latest binary file for your device from Github.
Select the file version that contains the name of the micro controller in your device, see the Status/Info screen: Device information.
Download and unzip the file on your computer
You will only need the file firmware.bin (other files used by ESP32 are only needed when flashing a “virgin” microcontroller). ESP8266 only needs one binary file.
If you upgrade a Pow-U or Pow-P1, the device must be powered on the USB socket.
Use the “Select firmware file for upgrade” button, and select the binary file.
Here’s what you need in terms of hardware and tools:
Depending on your device: A USB-C or Micro USB cable connected to your PC. Make sure it is a full cable with data lines, not a cable for just charging devices. Most cables are full cables with data lines.
Follow these steps to flash your device. The description is for a Windows environment. (Mac users need to follow a corresponding procedure for Mac OS.)
Connect the device to the PC with the USB cable. Wait a minute to ensure device is fully charged.
Download the ZIP file made for your device from https://github.com/UtilitechAS/amsreader-firmware/releases . All Pow-K, U and P1 devices that can be flashed over USB cable has an ESP32-S2 microcontroller. You want the file that has "esp32s2" as part of the file name, and you want the ZIP file. Example: ams2mqtt-esp32s2-2.2.4.zip
Extract the files from the zip file (right-click the downloaded file and choose "Extract All…")
Open a command window on the PC
Navigate to the directory where the extracted files are stored. For simplicity, this could be the same folder where esptool.exe is located.
Find out which COM port to use for the flashing:
Open Device Manager (Right-click the Windows symbol in bottom left of the screen and select Device Manager)
Expand the "Ports (COM & LPT)" section:
On your device:
Press and hold AP button
Press and release RES button
Release AP button
A new COM port will now open on the PC, visible in Device Manager. In this case, COM4 is the new port:
Start by erasing what is currently installed on the device, using this command: esptool --port COM4 erase_flash (Use the COM port you found in previous step) This should happen:
You can now flash the firmware, using this command (all on one line). Replace "COM4" with the COM port you use. esptool --port COM4 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin This should be the result:
Press and release the "RES" button on the device.
As the device is not yet configured, please note:
It will start up in Access Point (AP) mode, setting up the Wi-Fi access point AMS2MQTT
The LED will not blink (it looks “dead” - which is normal at this stage).
Connect your PC to the AMS2MQTT access point, and wait for it to connect:
Go to a browser and open http://192.168.4.1 You will see this Initial configuration screen:
Select Board type from the dropdown list. If you select a “generic” profile, you also need to select the GPIO of the device that reads the incoming data signal:
Click "Save"
Proceed with configuration as explained earlier in this document.