Hi,
I’m sure I am making a rookie mistake, but I just received my first ESP8266s and wanted to start playing with ESPHome. I installed the addon for Hass.io, created the first node, but am unable to get hassio see the device so I can select and flash it for the first time (after that over the air can be used as I understand it).
I am running Hassio on an RPI3 and the only options it sees is the over the air and the USB stick plugged in with the Zigbee2MQTT controller.
I have tried:
changing USB cables
changing USB ports in the RPI
pressing the flash button on the ESP.
restarting the addon when doing the above as per the documentation to allow the USB to be seen (although I don’t even see it in the hardware button in the supervisor section).
Is there something basic I forget? I know you can flash through the Arduino IDE, but I’d not be sure how to do that if you are using the ESPHome module and not traditional MQTT protocol to integrate with Home Assistant as the file generated by ESPHome uses us a YAML file, so I am under the impression that I can only flash through the ESPHome module on the RPI… not?
Thanks for any guidance from a newbee in this journey… Eager to get started, to learn more and help others!
You can compile and download generated .bin file.
I do this on my ESP32 devices:
With Arduino IDE load the OTA Web Updater sketch, fill up the infos ( SSID, password ) and upload it to the esp.
Then the esp will be available with a basic http site, just upload that .bin and after the upload it will be visible in esphome/HA.
Thanks for the feedback! This looked like a simple solution, but unfortunately doesn’t seem to work for me. I think the main issue is that the USB is not detected in the hardware part of the supervisor, even prior to (re)starting the add-on…
Duh… wanted to answer @MarkB1, will correct the post. I am looking into your suggestion now, but need to find the scetch and install the board in Arduino IDE.
// I use for my toys simple OTA through a browser.
// When using port mapping on router, it works from anywhere.
// Here is the entire code that is necessary for that.
// The uploaded file must, of course, be in binary form as *.bin
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>
const char* ssid = "YourSSID"; // Set your router SSID
const char* password = "YourPassword"; // Set your router password
#define OTAUSER "admin" // Set OTA user
#define OTAPASSWORD "admin" // Set OTA password
#define OTAPATH "/firmware"// Set path for update
#define SERVERPORT 80 // Server port
ESP8266WebServer HttpServer(SERVERPORT);
ESP8266HTTPUpdateServer httpUpdater;
//-----------------------------------------------------------------
void setup(void) {
WiFi.begin(ssid, password);
/* wait for WiFi connect */
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
}
httpUpdater.setup(&HttpServer, OTAPATH, OTAUSER, OTAPASSWORD);
HttpServer.onNotFound(handleNotFound);
HttpServer.begin();
}
void loop(void) {
HttpServer.handleClient(); // Listen for HTTP requests from clients
// ...
// ...
}
/* Send HTTP status 404 Not Found */
void handleNotFound() {
HttpServer.send(404, "text/plain", "404: Not found");
}
Sorry I was getting ahead of myself before, first as correctly said by Malaga83 create your node.
Below is an example yaml config for one of my Nodemcu webserver and ota enabled.
Thanks both for your great help so far! New discoveries made…
Apparently there are different types of cable for microUSB… I had tried 2 and when trying to connect with these cables to the PC, the PC did not discover the devices either… so I found a few other cables and I found one that makes it discover on the PC!
So with this new cable I connected it to the RPI and Bingo! It discovered the device! Issue now is : When selecting upload for the node in ESPHOme, my RPI crashes and goes in a hung state at complilation… (memory issue?- should this not be possible on an RPI?
When using the same cable on a PC, as said, it detects the device, but I cannot select it in the Arduino IDE as it looks like it is missing a driver to recognize the device.
So both routes seem to be stuck at the moment - I either need to find a driver for the PC or find out why the RPI crashes… Anyone has any idea?
Thanks @MarkB1 and @Malaga82 ! I found the right driver somewhere else and indeed I am now able to compile and flash via the Arduino IDE. I installed the Webupdater and now can upload through that…
I’m however now still stuck with the fact that to generate the file, I have to compile with ESPHome on the RPI and it crashes for me, so don’t get to the point of the file generation. Do you have ESPHome running on an RPI3 with this addon too and works for you or you have a different configuration?
i do have a pi3 b+, but at the moment is off.
Do you have a swap file? Maybe you can try to create one and add it if don’t have it.
I don’t know if you have hassOS installed or supervised ( HA on top of a linux installation ) and if it can be done.
Maybe this is related?
Correct. Hassio (or HassOS indeed) directly on SD and based on the thread @Malaga82 found, it does look as a memory issue. I didn’t think i have that many add-ons running (“heavy ones” I would think are Unifi controller and Zigbee2MQTT).
I’ll look into
Disable addons during compile and see if that works
Dev branch and see if that makes a difference.
the swap file option for sure and if that can be done. I use an SD card larger than the space that is being used by HA.
If that doesn’t work, I guess I’ll just have to flash it through Arduino IDE and use traditional MQTT…
First option already worked! Definitely the issue was memory usage…
I was able to finish the compile and upload only disabling the Unifi controller addon. It used 33% of memory. When disabling, total memory usage went down from 77% to 43% and that was sufficient to complete the compile. So I at least have a workaround now!!
Thanks again for the help!!!
So to completely solve my issue from the beginning of the post :1) use a decent USB microUSB cable and 2) ensure enough available memory to complete the compilation!
You need at least 500 MB of free memory to compile/upload an EspHome module.
Also, not all USB cables transfer data, a lot of them just provide the 5 volts but they do not have the wires to transfer data.
I have the same problem: not detected. Even if I put it on usb to my RPi4, in ESpHome when try to install it, this device not came up at all.
I have 8Gbyte if ram, almost 80 is free when writing these rows.
Maybe driver error? Should be this nodemcu driver isntalled somehow into ESPHome?