Closed TeDeVPrime closed 10 months ago
Do you want to know for the pro or the non-pro? Because those are 2 completely different devices. for non-pro. if you have Ap an captive portal installed. The esp should provide an so where you can connect to. For the pro. I don’t know.
As far as I know, NSPanel PRO is not ESP based and therefore is not compatible with ESPHome and this project.
But if you are talking about the older NSPanel, are you trying to do this only once or are you planing to do multiple times for redistributing panels? For the first case, the suggestion from @bkbartk should be the way to go. My only addition to that is related to the OTA password, as your WiFi password is used, then I would suggest taking a look at this: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/en/customization.md#custom-ota-password But if you are planing to redistribute, I would suggest something like this: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/pre-built/nspanel_esphome_prebuilt.yaml
sorry i meant NSPanel. not pro.
i want to prepare some nspanels for a couple of friends. so i want to flash them... make sure that they work and then send them to them.
i don't know what the next step would be
The challenge here is due to the fact this project uses the wifi password as OTA password, so this is not very friendly to change networks, but I can try some customization later to remove OTA and then you probably would be fine. If you wanna make the whole thing seamless to them, I would recommend installing your testing firmware first and upload the TFT, as that is the painful part, then you can run all the tests and flash again the "redistributable" firmware (please see the last link on my previous comment). I haven't test that, but my main idea when creating was to make something redistributable, with the captive portal (as suggested by @bkbartk) but also using Improv to make it easier to onboard to a new network, however I couldn't find the memory to implement the Improv BLE yet (maybe your friends don't need Upload TFT 😉 and then is easy to find memory).
Please let me know where you are with this. I will be happy to help. You should run some tests with renaming the device, etc, as your friends/clients will certainly try that.
probably you have to do some customization, I always copy the esphome yaml locally and strip thos component
wifi
captive_portal
web_server
ota
and load them from my own base config. so it's al tease the same as everything else my config in the would look something like this
substitutions:
device_name: "My-name"
packages:
base: !include .base.yaml
device: !include .nspanel.yaml
####
# some custom config per device
but the main goal is that you need to understand how esphome works using wifi, ap and captive_portal. you can try to work with that and once that works like you hope you can just install the full yaml.
I actually thing cahnging wifi to this
wifi:
ap:
ssid: "${device_name}"
password: ${wifi_password}
would work, Keep in mind to not use your own wifi_password here.
@bkbartk well i don't really know how ESPHome works so not that clear for me yet.
at the moment i have 3 places (my main home, office, "weekend house") and two friends' houses that want to flash their nspanel as well.
they don't have the tools or even the skills to flash the device. i have done it three times up until now and it has been a pain every time. i don't want to go to their home in order to flash the device and then pass the parameters through Home Assistant.
i want to find a way to flash it at my place with TFT and then ship it to them. somehow they need to install the device and connect it to their ESPHome and wirelessly install their config to the devices that i will send them.
so if you guys can help me with the steps, it would be great. @edward i saw your last link but i am not sure what's the next step after i flash the device with that.
well, the easiest way, ask your friends for there wifi credentials. and add both yours and theirs, https://esphome.io/components/wifi.html#connecting-to-multiple-networks then you can test and ship, and if it fails to work they should have provided the correct credentials.
but main advise, before helping some friends with something you don't know that much about is to read a little bit of documentation, how does the yaml work and how does https://esphome.io/components/captive_portal.html work if you know that you can help them much better.
thank you i will test it out first with multiple wifi credentials. i suppose that when they power it up, all they have to do is go to esphome.... add new device and then they will discover it.
Can you set the ota password to something different from the wifi with a substitution?
Yeah, you can do that. Not with a substitution, but it is possible.
Please take a look at this: https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Customization#custom-ota-password
Yeah, you can do that. Not with a substitution, but it is possible.
Please take a look at this: https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Customization#custom-ota-password
I had seen that, but that means I have to load the code locally, edit it, then have to repeat every time a new version comes out.
Guess I was thinking out loud, trying to figure out how to break the ota password to wifi password link, cause that sure makes it hard to change wifi networks.
I had seen that, but that means I have to load the code locally, edit it, then have to repeat every time a new version comes out.
Nope. Please see the example at the beginning of that page. You add just those lines to your local yaml, but still with the reference for the server.
Take a look there, if you still have questions,please share here your yaml (hide passwords) and I can propose the changes for you.
Ok I had assumed that as
ota: id: ota_std password: ${wifi_password} safe_mode: true reboot_timeout: 3min num_attempts: 3
was in nspanel_esphome.yaml I couldn't have an ota: section in my code that then loaded nspanel_esphome.yaml, I figured it would either error, or used the last one loaded.
Currently, your OTA password is your Wi-Fi password. In order to change that, you have to send a new OTA, but to sent that you must use the older one otherwise it will fail. Unless you want to flash using serial, as the OTA password is not tested in that case (that is not OTA). To change the OTA, add this to your ESPHome yaml:
##### My customization - Start #####
# change OTA password, remove after flashing
esphome:
on_boot:
- lambda: |-
id(my_ota).set_auth_password("YourNewOTApassword");
ota:
password: !secret wifi_password
id: my_ota
##### My customization - End #####
Flash you device with this, then remove the code above and instead you should have the following (now, using the new OTA):
##### My customization - Start #####
# Use my own OTA password
ota:
password: "YourNewOTApassword"
##### My customization - End #####
Or if you want to keep it in a secrets file (as recommended by ESPHome docs), use password: !secret ota_password
instead.
You will keep this last version of ota customization forever (or at least until you decide to change it again).
I thought I had to put that in the nspanel_esphome.yaml, I ASSumed putting it in mine would get overwritten by the ota: and esp_home: sections in nspanel_esphome.yaml. I thought that was the purpose of substitutions was override variables in other sections of the code.
@TeDeVPrime, any progress on this? I wanna look at this (or I would say in a "redistributable package") in the coming days, but would like to know how far did you got and hear a bit more about what are you trying to achieve.
Another solution that might be easier, IMHO is to build your version with ap/captive
& webserver
component.
Then send the unit to your friends. When powered on, the NSPanel will not be able to connect to your WIFI (nor to your HA) so it will trigger its own AP.
Connect to this AP at your friend's place and then go to 192.168.4.1 to get the webserver page (you might have some credentials to type here)
On this page, you can select a firmware file to flash.
To get the firmware to flash:
I will add this to the new documentation to be released soon, but you can take a look at that in dev
and give some feedback: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/dev/docs/howto.md#updating-wi-fi-and-ota-passwords-in-esphome-with-this-project
Hi,
i am not sure how i can flash an nspanel pro... make sure that it works and then move it to another location to a different wifi and just integrate it to that home assistant.
any guides or do i always have to reflash with cables the entire thing?
thanks