Open matheustms opened 7 years ago
Hi, Thank you for your feedback.
#define TLS
(line 65).WiFiManagerParameter custom_mqtt_server("mqtt-server", "MQTT Broker IP", "m21.cloudmqtt.com", STRUCT_CHAR_ARRAY_SIZE, "disabled");
with your broker's IP address
WiFiManagerParameter custom_mqtt_server("mqtt-server", "MQTT Broker IP", "<YOUR BROKER ADDRESS>", STRUCT_CHAR_ARRAY_SIZE, "disabled");
and the lines 67 and 71, with the CN and the fingerprint of your broker's certificate:
// TLS support, make sure to edit the fingerprint and the broker address if
// you are not using CloudMQTT
#define TLS
#ifdef TLS
const char* broker = "m21.cloudmqtt.com";
// SHA1 fingerprint of the certificate
// openssl x509 -fingerprint -in
I'll modify the sketch to work without an active Wi-Fi connection.
Sam
Thank you so much, bro.
If not too much to ask, can you implement the input settings of MQTT topics too when we are setting up the network and entering the MQTT username, password, broker IP address and broker port. So we can setup everything on the web configuration portal.
Another question is when I long press the button, reset the relay or all the configurations to default?
Thanks so much again
Find another problem (rsrs), there is no auto reconnect function. When I turn restart my router and not restart sonoff, it calls the wifi manager again, to set another wireless credentials.
If not too much to ask, can you implement the input settings of MQTT topics too when we are setting up the network and entering the MQTT username, password, broker IP address and broker port. So we can setup everything on the web configuration portal.
Implemented now.
Another question is when I long press the button, reset the relay or all the configurations to default?
6-7 seconds. If the LED doesn't blink, unplug/plug the Sonoff from power.
Find another problem (rsrs), there is no auto reconnect function. When I turn restart my router and not restart sonoff, it calls the wifi manager again, to set another wireless credentials.
The module will restart now if no IP address is assigned to it. It's not easy to test if the module is connected to the internet. My Wi-Fi is always on.
void reconnect() {
// test if the module has an IP address
// if not, restart the module
if (WiFi.status() != WL_CONNECTED) {
DEBUG_PRINTLN(F("ERROR: The module isn't connected to the internet"));
restart();
}
...
Man, you are the best. Really, the best. I will try when I get home. I don't know how to implement functions because I'm new on this. Thanks for help me. If I found another thing, I will tell you for sure. Rsrs
Did you did this "I'll modify the sketch to work without an active Wi-Fi connection."?
Did you did this "I'll modify the sketch to work without an active Wi-Fi connection."?
Not yet. It's complicated because I use the WiFiManager library and if the connection to the router isn't successful, the module restarts. I control it only with MQTT and Home Assistant and I'll probably not implement this feature.
Alternative firmwares:
I understand. I use MQTT and Home Assistant too, but I need to implement this because if my router gets dead, for example, I can't ativate the relay and my house will stay in dark, if it's night. I use sonoff as my light switch. I will study on this, I really like your firmware. Thanks Man.
newbies here, how to get the fingerprint ?
if you have the public certificate, just use the following command :
// SHA1 fingerprint of the certificate
// openssl x509 -fingerprint -in <certificate>.crt
https://knowledge.symantec.com/support/identity-protection-support/index?page=content&id=SO28771&actp=RSS&viewlocale=en_US or https://www.grc.com/fingerprints.htm
How to assign different Fingerprints for each sonoff (with tasmota fw) device to connect CloudMqtt? For secure connection, each device has a particular Fingerprint.
I don't want to use CloudMQTT and I dont know what I need to change to set my raspberry ip as local broker. When I'm setting up the wifi credentials, the space for ip broker are defined as CloudMQTT and I can't change it.
Another problem is when I reset the Sonoff, I can't do direct relay operation through on board button without setting up the wifi credentials first. Thats bad because I cant operate the sonoff if I don't have wireless in home, at least for instance.
If I'm saying shit, sorry for my ignorance on this theme.