MQTT string in EspEasy
Moderators: grovkillen, Stuntteam, TD-er
MQTT string in EspEasy
Is it possible to somehow pass a new WifiSSID and WifiKey value to EspEasy using MQTT?
Re: MQTT string in EspEasy
Maybe it is possible by using the plugin MQTT Import.
https://espeasy.readthedocs.io/en/lates ... /P037.html
https://espeasy.readthedocs.io/en/lates ... /P037.html
Re: MQTT string in EspEasy
Maybe you can send it as some kind of event.
See the command options for C005: https://espeasy.readthedocs.io/en/lates ... d-handling
You can then try to formulate an event of which one of the eventvalues are the new credentials.
Another option is to make a build with the provisioning option included.
Then on the Settings Archive page you can define an URL which will then be used as a base URL (http only, not https) and you can then formulate events in the rules to call provisioning commands to fetch settings/credentials/rules from a server.
You can even fetch firmware updates via such provisioning. (tested on ESP32 only)
This is still a work-in-progress, and I still need to write documentation for it.
See the command options for C005: https://espeasy.readthedocs.io/en/lates ... d-handling
You can then try to formulate an event of which one of the eventvalues are the new credentials.
Another option is to make a build with the provisioning option included.
Then on the Settings Archive page you can define an URL which will then be used as a base URL (http only, not https) and you can then formulate events in the rules to call provisioning commands to fetch settings/credentials/rules from a server.
You can even fetch firmware updates via such provisioning. (tested on ESP32 only)
This is still a work-in-progress, and I still need to write documentation for it.
Re: MQTT string in EspEasy
It will prove to be quite hard to send anything to a unit if it isn't connected to a (WiFi)network, if it doesn't yet have the correct credentials...
A valid way to set the credentials is to send the matching commands via USB-serial, you shouldn't forget to save the settings or it won't be able to reconnect after a reboot...
A valid way to set the credentials is to send the matching commands via USB-serial, you shouldn't forget to save the settings or it won't be able to reconnect after a reboot...
/Ton (PayPal.me)
Re: MQTT string in EspEasy
Not if you're making your own custom builds with a deployment SSID included.
For obvious reasons is this only possible for 'custom' builds.
But it is really useful for quick deployment on lots of units, where you have some special AP configured for the initial deployment.
Since you can even let it then update the firmware, you can have a basic FW pre-flashed when ordering the ESP chips and then automatically let it connect to a default AP and let it download settings and a firmware which doesn't have such a deployment AP pre-configured.
For obvious reasons is this only possible for 'custom' builds.
But it is really useful for quick deployment on lots of units, where you have some special AP configured for the initial deployment.
Since you can even let it then update the firmware, you can have a basic FW pre-flashed when ordering the ESP chips and then automatically let it connect to a default AP and let it download settings and a firmware which doesn't have such a deployment AP pre-configured.
Re: MQTT string in EspEasy
It turned out to be implemented by handling the event.
%eventvalue% is used as the WifiSSID argument, but under one condition.
The passed value must start with a digit.
Therefore, I added a number in front of the text transmitted value, and then
%eventvalue% is used as the WifiSSID argument, but under one condition.
The passed value must start with a digit.
Therefore, I added a number in front of the text transmitted value, and then
Code: Select all
WiFiSSID,{substring:1:20:%eventvalue%}
Re: MQTT string in EspEasy
Only the first eventvalue is checked for being a numerical.
So you can add a dummy first eventvalue and then use the 2nd eventvalue.
You can also use an * to make sure it isn't only trying to match numericals.
See: https://espeasy.readthedocs.io/en/lates ... as-command
This can even be used to send commands to be executed in rules.
https://espeasy.readthedocs.io/en/lates ... as-command
But be aware of the security issues that might arise.
So you can add a dummy first eventvalue and then use the 2nd eventvalue.
You can also use an * to make sure it isn't only trying to match numericals.
See: https://espeasy.readthedocs.io/en/lates ... as-command
This can even be used to send commands to be executed in rules.
https://espeasy.readthedocs.io/en/lates ... as-command
But be aware of the security issues that might arise.
Who is online
Users browsing this forum: No registered users and 64 guests