daniel-jong / esp8266_p1meter

DSMR5 P1 meter to mqtt using esp8266
GNU General Public License v3.0
145 stars 54 forks source link

How to reconfigure MQTT/Wifi settings? #4

Closed Mario-H closed 3 years ago

Mario-H commented 3 years ago

Just wondering: How do you reconfigure the MQTT/ Wifi settings after the initial configuration in case you want to switch over to another MQTT Broker or Wifi access point? I tried connecting to the DHCP-assigned IP address but the ESP doesn't respond on port 80. It does reply on a ping request. (I'm using a D1 mini)

daniel-jong commented 3 years ago

Mhmm, this is currently a bit unwieldy. If I ever get around to it i might look into an option to reset settings using dupont cables.

But to help you out right now. If you are able to reflash the ESP than it should be possible with either of these options:

Option A; (Simplest, but I have not tested this) In Arduino IDE flash the software using the option tools -> Erase Flash -> All flash content

Option B: Uncomment line the line wifiManager.resetSettings(); in esp8266_p1meter.ino on line number 599 and reflash the ESP, Let it boot once and verify its in "wifi configuration mode" then recomment the line and flash again..

This might sound odd, but going true the whole wifi setup process again allows you to configure the MQTT server again.

Let me know if that helps

Mario-H commented 3 years ago

Hi,

Thanks for your quick response. Currently I don't have an issue where I need to reconfigure the settings, but I'm sure in time the need for it will present itself.

The options I can think of (in order of nicest solution):

nsenica commented 3 years ago

Also, piggybacking on this ticket, after flashing and configuring the ESP via the web interface, its standalong wifi network is still accessible, however I can't access the configuration page anymore. Is there a way to deactivate the wifi network once it is connected and using a different wifi network ? Or did I do anything wrong ?

From @Mario-H suggestions, I think that the first option would be really awesome :)

Thanks.

daniel-jong commented 3 years ago

Most of the configuration stuff is handled by WifiManger. To be sure I've been able to check the following.

I'll look into adding an option to reset the configuration with grounding a certain pin in the future. But first I have to work on getting my branch merged back into flipphess's base.

@nsencia I'm not sure as to what has happened in your case. Are you perhaps able to show me the serial monitor's output? If you could open a seperate issue fot that it might prevent crosstalk :)