UtilitechAS / amsreader-firmware

ESP8266 and ESP32 compatible firmware to read, interpret and publish data to MQTT from smart electrical meters, both DLMS and DSMR is supported
Other
379 stars 72 forks source link

Lost connection after upgrade to 2.1.9 #330

Closed rtollevik closed 1 year ago

rtollevik commented 1 year ago

I upgraded my Pow-K+ from amsleser.no to v2.1.9, and lost connection with the reader :-( Apparently, it failed to reconnect to my wifi network. Alternating green and yellow flashes on the led. I was able to reset the device and connect using my mobile as access point. After downgrade to v2.1.8 it connected to my ordinary wifi network. I don't known whether it is the longer ssid name and password on my ordinariy network which is the problem, or something else with that network. I'll experiment more tomorrow and update with what I learn.

gskjold commented 1 year ago

Wow, this is a pretty serious problem, I'd like to know if there are more people who experience this in case I have to remove this version.

ArnieO commented 1 year ago

I updated now, it restarted as it should. image

ArnieO commented 1 year ago

I upgraded my Pow-K+ from amsleser.no to v2.1.9, and lost connection with the reader :-( Apparently, it failed to reconnect to my wifi network. Alternating green and yellow flashes on the led. I was able to reset the device and connect using my mobile as access point. After downgrade to v2.1.8 it connected to my ordinary wifi network. I don't known whether it is the longer ssid name and password on my ordinariy network which is the problem, or something else with that network. I'll experiment more tomorrow and update with what I learn.

Yes, it would be great if you could do some experiments, and be very precise on each step, in case you manage to recreate same or similar issue. Did you use one-click update, or did you download files and update from them? If so, are you sure you used the right files? (ESP32 files will not work on Pow-K+, you need ESP32S2 files).

Alternating green and yellow flashes sounds very peculiar.

SVH-Powel commented 1 year ago

Wow, this is a pretty serious problem, I'd like to know if there are more people who experience this in case I have to remove this version.

Yes, me too. I spent an hour yesterday to get 2.1.9 working. I could get the initial setup working, but after adding wifi configuration and doing a restart, it was lost. I finally gave up and installed 2.1.7

Edit: I also erased the flash on my generic esp32 before flashing 2.1.9 in case there was some issues with the configuration.

gskjold commented 1 year ago

OK, I have deleted 2.1.9 now. I will investigate what may cause this problem.

rtollevik commented 1 year ago

I upgraded using the GUI link. It appear to be something with my wifi, the same SSID and password works when I use my mobile as access point. Any way I can access the serial debugger on a mac? A video showing the flashes is attached.

https://user-images.githubusercontent.com/17461471/196131605-099615eb-369d-4347-9c64-6eaeb966fbec.mp4

gskjold commented 1 year ago

This is a reboot loop, wonder what that could be... Anything special configured, or does this happen for å "blank" configuration just after initial config?

henrikkoch commented 1 year ago

I downloaded the file from and uploaded the file manually in the UI. Without having any issues. The software is running fine

Den man. 17. okt. 2022 kl. 10.40 skrev Stig Vidar Hovland < @.***>:

Wow, this is a pretty serious problem, I'd like to know if there are more people who experience this in case I have to remove this version.

Yes, me too. I spent an hour yesterday to get 2.1.9 working. I could get the initial setup working, but after adding wifi configuration and doing a restart, it was lost. I finally gave up and installed 2.1.7

— Reply to this email directly, view it on GitHub https://github.com/gskjold/AmsToMqttBridge/issues/330#issuecomment-1280495630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5EA6CY24SY6NU6SKLUD2TWDUGHDANCNFSM6AAAAAARGRLTJE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Med venlig hilsen / Kind regards

Henrik Johansen KochHans Erik Nielsens Vej 7, DK 3650, Ølstykke, Denmark

T +45 4710 0305 F +45 7734 0307 M +45 4068 0305E-mail @. @.**>

rtollevik commented 1 year ago

It happened also after a full reset. My wifi is in access mode, don't know if that have anything to do with it. I could try it in router mode if you could make the v2.1.9 binary accessible somewhere. I can reach the reader when I configure my mobile hotspot with the exact same ssid and password. For the record, my wifi is tp-link deco mesh, with telia as internet provider.

gskjold commented 1 year ago

Attached is a ESP32-S2 firware where I have made a slight modification that may make a difference. If any of you could try it that would be great.

esp32s2.zip

rtollevik commented 1 year ago

I can try, but need some guidance. Can I upgrade using this file, or should it be one of the .bin within?

gskjold commented 1 year ago

Extract and use the firmware.bin file inside

ArnieO commented 1 year ago

It happened also after a full reset. My wifi is in access mode, don't know if that have anything to do with it. I could try it in router mode if you could make the v2.1.9 binary accessible somewhere. I can reach the reader when I configure my mobile hotspot with the exact same ssid and password. For the record, my wifi is tp-link deco mesh, with telia as internet provider.

To understand the issue, it would for sure be interesting if you could do a test with your mesh network in Router mode with same firmware. @gskjold : can you provide a link to 2.1.9 for such a test?

I also have a tp-link deco mesh system, in router mode. I have updated two devices to 2.1.9 ; no issues.

gskjold commented 1 year ago

The original 2.1.9 firmware: ams2mqtt-esp32-2.1.9.zip ams2mqtt-esp8266-2.1.9.zip ams2mqtt-esp32s2-2.1.9.zip

rtollevik commented 1 year ago

Bad luck with the firmware.bin. Couldn't access it at all. It blinked 3 red, then went into alternating 1 and 3 reds. And I do think I saw a sequence with 1 and 2 reds as well. And then it apparently rebootet (green/yellow flash). Managed to downgrade using reset and 192.168.4.1/firmware. Can try my deco in router mode with the original v2.1.9 if you could post that.

gskjold commented 1 year ago

OK, Then we avoided the reboot loop, but apparently it is then unable to reconnect to your wifi (3 red) and of course does not have HAN data (1 red). I'm not sure how my change in 2.1.9 prevents you from connecting, but I'll do some research.

Device auto reboots if not connected within three tries (30s sleep in between)

SVH-Powel commented 1 year ago

FYI: My wifi network is Google Wifi 1. generation

larserhardsen commented 1 year ago

As soon as I saw the release email last night, I initiated the upgrade through the UI, and the unit did not seem to come back online. However, after considering for some time to go outside and yank the Pow-K+ out of the Kamstrup meter (we had quite strong winds here, so the thought of going outside was not something I really felt like doing), somehow it resurfaced and has been stable since.

SVH-Powel commented 1 year ago

I upgraded using the GUI link.

Yes, I did also start with the gui link. I think I waited 5 minutes for it to come online. Then I flashed it with esptool.py without success. I then used esptool to erase the flash and I flashed 2.1.9 again. No success. I was able to enter the wifi configuration after the erase, but it never connected to my wifi after the reboot. I then flashed my previous version, 2.1.7 and it was up and running as soon as wifi configuration was entered and a reboot done.

gskjold commented 1 year ago

somehow it resurfaced and has been stable since.

Interesting, that could mean that this problem could appear suddenly for users that have already installed 2.1.9... I think I will make a new version 2.1.10 where I revert the changes around WiFi, then I have more time to figure out the problem.

gskjold commented 1 year ago

@SVH-Powel Do you also have Pow-K+?

gskjold commented 1 year ago

Here is a version that has all the changes for 2.1.9, but WiFi_connect() have been reverted:

esp32s2.zip

Just to be certain that this actually is the problem, does this firmware fix your issue?

SVH-Powel commented 1 year ago

@SVH-Powel Do you also have Pow-K+?

No, it is a generic esp32

gskjold commented 1 year ago

No, it is a generic esp32

OK thanks, was just curious if this was isolated to ESP32-S2. Here is the same version I posted above, just for ESP32: esp32.zip

rtollevik commented 1 year ago

Apparently ok with this release, identifying itself as 8ac1e03

stigvi commented 1 year ago

No, it is a generic esp32

OK thanks, was just curious if this was isolated to ESP32-S2. Here is the same version I posted above, just for ESP32: [esp32.zip]

I tried it and it works as expected.

ArnieO commented 1 year ago

@gskjold : This may help debugging:

Running 2.1.9 since this morning. It had now disappeared from wifi, no answer to ping on its fixed IP.

LED:

Reverted to 2.1.8

gskjold commented 1 year ago

Got it. 2.1.10 with wifi_connect from 2.1.8 is on its way.

gskjold commented 1 year ago

What hardware specifically @ArnieO ?

ArnieO commented 1 year ago

What hardware specifically @ArnieO ?

Pow-K+

retrov commented 1 year ago

Running [AMS reader v2.1.10] now and seems fine on my network.

oz1iio commented 1 year ago

Its still the same error. This morning’s I updated to v2.1.9 and it was stop reading the meter and were slow Now I updated to v2.1.10 and it’s still the same issue, it’s reset again and agin 75DEB315-5ABD-4D65-ACC1-32593B1CF929 I use a kamstrup and a esp32 board. Anker

tronde-ams commented 1 year ago

Both 2.1.9 and 2.1.10 have been OK for me. Aidon 3p IT, Chinese ESP32 configured as Lolin D32 and no mesh WiFi. MQTT active.

oz1iio commented 1 year ago

This morning is the same, up few seconds. 2CADB4EF-3B9F-4A14-9DDB-67A1077604FF V2.1.8 and back has worked grate, and I use it together with home assisted

gskjold commented 1 year ago

@oz1iio Do you also use HomeAssistant payload? Trying to find a pattern

gskjold commented 1 year ago

This sounds like a different error than the original problem btw. So I am curious to know if this only happens when it is connected to the meter, or if it also happens when unplugged.

gskjold commented 1 year ago

You know what, for those who still have problems with 2.1.10, fill out this template: Country: Meter: Hardware: MQTT payload:

ArnieO commented 1 year ago

No problem here with 2.1.10 (up 16 hours)

retrov commented 1 year ago

Seeing it being restarted after 3-5 hours after 2.1.10 install last night.

Norway
Kamstrup
Pow-K
MQTT payload: Home-Assistant
knakkwurst commented 1 year ago

Instability (system hangs when entering mqtt config) on 2.1.9 and 2.1.10 In HA, I am missing energy column every 4th hour. Norway Aidon 6525 Pow-U MQTT : Home Assistant

retrov commented 1 year ago

I've reverted back to [AMS reader b420a0e] that was stable and had all the sensors correctly in Home Assistant.

stigvi commented 1 year ago

I saw that "average of top" X hours was set to 68 after I upgraded to the latest version. Could it be that which is slowing it down on your unit?

ArnieO commented 1 year ago

What is "config hours"?

stigvi commented 1 year ago

What is "config hours"?

Sorry, I changed my post to make it more clear and correct.

revellion commented 1 year ago

I have issues with connecting to the PowK+ since upgrading from 2.1.8.

Though it could also be to poor wifi conditions with the meter on a pole behind the garage.

Country: Sweden Meter: Kamstrup Hardware: Pow-K+ (ESP32S2) MQTT payload: Home Assistant

ArnieO commented 1 year ago

I saw that "average of top" X hours was set to 68 after I upgraded to the latest version. Could it be that which is slowing it down on your unit?

I found now that mine was also very high after the upgrade: image I changed it back to 3, and that value sticks.

retrov commented 1 year ago

I've reverted back to [AMS reader b420a0e] that was stable and had all the sensors correctly in Home Assistant.

My uptime is a day now, so this one seems stable compared to the later builds I tried.

revellion commented 1 year ago

I saw that "average of top" X hours was set to 68 after I upgraded to the latest version. Could it be that which is slowing it down on your unit?

I found now that mine was also very high after the upgrade: image I changed it back to 3, and that value sticks.

Did the same on my PowK+ with 2.1.10 on. And it made it stop rebooting. Which i suspected since I got WiFi signal measurements in MQTT but no meter payloads before it rebooted again. The web UI was never reachable. But if I removed the module from the meter then it was accessible

gskjold commented 1 year ago

This is very interesting!

I really appreciate you all for testing and giving good feedback like this. I now have a better idea on what to test and hopefully reproduce this issue at home.

Stewart555 commented 1 year ago

Hi there, Just want to add my experience with v 2.1.10 so far. It seems to be related to this 2.1.9 bug (?) and I rather add it to this thread than add a new one.

While using "ams-leser.local" to access the web-gui, the connection times out. Refreshing the page 4 or 5 times brings the page up. When then for example accessing the "Meter"-menu, it times out again. Sometimes the ESP icon is red and the other ones are grayed out. If I access the reader via its IP-address, there are no connection issues. (Maybe this is an issue with my network setup, but accessing the reader through the mDNS address was never a problem before) MQTT-payload to HA, seems to be working fine.

The uptime is 3hrs now, but I did not reboot the reader since I updated it 2 days ago.

Country: Norway Meter: Kamstrup Hardware: Pow-K+ (ESP32S2) MQTT payload: Home Assistant