mruettgers / SMLReader

ESP8266 based smart meter (SML) to MQTT gateway
GNU General Public License v3.0
289 stars 67 forks source link

How to bring SMLReader into existing network #26

Closed Pewibe closed 3 years ago

Pewibe commented 3 years ago

Help is needed!

  1. My hardware is a Sonoff Basic R3. By using Tasmota the device is running fine.
  2. I flashed both pre-fabricated versions SMLReader_D1mini_v2.2.0[_debug].bin.
  3. I get the configuration page and entered my data. Problem is the field "AP password" because there is no clear description for the necessary content. I entered "ASDFqwer1234".
  4. I received the message "Configuration saved ...".
  5. The device stay in access point mode and do not participate in configured home network. Does it happen automatically or do I have to do something for this next step? I know that the two Wifi parameters are important for this step. But I'm pretty sure to do it correct because with Tasmota software on this device everything works. Thanks in advance!
trosenda commented 3 years ago

AP Password is the WiFi Password when in AP mode (your device unable to connect to given wifi sssid/passwd) make sure you enter wifi ssid, wifi password, ap password. save powercycle

if it doesnt connect, check your dhcp server or flash the debug and share output of serial console.

Pewibe commented 3 years ago

@trosenda Thanks for your answer but I'm still missing hints to go further.

  1. You explained the usage of AP password but not the syntax. Except minimum 8 characters there is no clear documentation for the necessary types of characters. Or easily say if my used password "ASDFqwer1234" should work.
  2. DHCP etc. is double checked by using Tasmota software (everything incl. SSID/PW works fine).
  3. Debug output shows: Updating configuration Value of arg 'iwcThingName' is:SMLReader iwcThingName='SMLReader' Value of arg 'iwcApPassword' is:ASDFqwer1234 iwcApPassword was set Value of arg 'iwcWifiSsid' is:TestSSID iwcWifiSsid='TestSSID' Value of arg 'iwcWifiPassword' is:TestPW iwcWifiPassword was set Value of arg 'mqttServer' is:192.168.0.2 mqttServer='192.168.0.2' Value of arg 'mqttPort' is:1883 mqttPort='1883' Value of arg 'mqttUsername' is: mqttUsername='' Value of arg 'mqttPassword' is: mqttPassword='' Value of arg 'mqttTopic' is:iot/smartmeter/ mqttTopic='iot/smartmeter/' Config size: 685 Saving config 'iwcThingName'= 'SMLReader' Saving config 'iwcApPassword'= Saving config 'iwcWifiSsid'= 'TestSSID' Saving config 'iwcWifiPassword'= Saving config 'iwcApTimeout'= '30' Saving config 'mqttServer'= '192.168.0.2' Saving config 'mqttPort'= '1883' Saving config 'mqttUsername'= '' Saving config 'mqttPassword'= Saving config 'mqttTopic'= 'iot/smartmeter/' Configuration was updated. _Rebooting after 1 second.

    ets Jan 8 2013,rst cause:1, boot mode:(3,0)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d vbc204a9b ~ld Setting up 1 configured sensors... Initializing sensor 1... Initialized sensor 1. State of sensor 1 is 'WAIT_FOR_STARTSEQUENCE'. Sensor setup done. Setting up WiFi and config stuff. Adding parameter MQTT server. Adding parameter MQTT port. Adding parameter MQTT username. Adding parameter MQTT password. Adding parameter MQTT topic. Config size: 685 Wrong config version. Missing or invalid config. MQTT publisher disabled. Setup done. AP password was not set in configuration State changing from: 0 to 1 Setting up AP: SMLReader With default password: AP IP address: 192.168.4.1 State changed from: 0 to 1 Connection to AP.

It looks to me like a bug (see bold lines) that passwords are set but not saved.

mruettgers commented 3 years ago

Could you please post the debug output after reboot? Before you edited your message I noticed something like "Wrong config version". It looks like the Sonoff Basic R3 is driven by an ESP8255 chip. The library used for configuration (IotWebConf) is using EEPROM for storage, maybe there is an issue with the EEPROM of the ESP8255? Unfortunately I don't have any ESP8255 device here to test with.

mruettgers commented 3 years ago

"Wrong config version" indicates, that the version of the config in EEPROM does not match the one that has been written previously, or that there is no config found at all.

Pewibe commented 3 years ago

I added the missed lines to the previous debug output. Sorry for the mess of the font size. I'm sure that you are right concerning 8255. So I cannot use the prefabricated .bin and have to compile.