Flash ESP8266 on RPi3?

Hi all. ESPHome/Arudino noob here. I’ve ordered a CH340 I plan to use to connect and flash an ESP8266 that I plan to use to control relays for irrigation valves. If I understand things correctly, I will use Device Builder to flash the device via the USB. Sorry if this is a stupid question but I am running HA on a RPI3. Will the USB ports on that do the job?

Yes, you understand it well, but I’m afraid that the Rpi3 has little memory and it won’t be enough for compilation.

I’m with @pepe59. It may work. I’ve done it on my RPi 3B+. But it’s really pushing that poor little thing hard. And HA is my production machine. I don’t like loading it up like that.

I run ESPHome command line on my laptop, and do my compiling there. I can still create new YAML files on HA in the ESPHome add-on, for example, if I’m starting a new project. But after that they live on my laptop.

So I should install HA on another machine and do the flashing from that. Will that process install the YAML & devices on my other copy of HA running on the RPi3? I’m going to use it just for this irrigation control task so as long as it has enough memory for that I’d rather not get a new RPi set-up.

Also the tutorial warns me to install device drivers for the serial programmer. I’ve no clue how I’d do that on an RPi flashed with HA.

That’s for Tasmota, not ESPHome.

Install ESPHome on your Mac or PC. You will need to carefully manage your yaml files, but other than that it works reasonably well.

https://esphome.io/guides/installing_esphome

The device will be discovered as normal by HA, but you will need to update them on the other platform.

1 Like

Just to clear up any possible confusion, the ESPHome “add on” for HA is now formally called the “ESPHome Device Builder.” This lets you develop and maintain the ESPHome device configuration right in the HA user interface.

Sounds great, right? Not always. As in the OP’s (and my) case, it’s better to separate the development/test environment from the production HA environment. Most of my HA (and just about all other) development and testing is done from my laptop, with a comfortable screen and keyboard.

Eventually I realized there’s a version of ESPHome (see the post above) I can run locally on my laptop to do all my development and testing from. Why connect to HA and force all that development onto my production machine, remotely, when I’m already sitting at a machine that’s more than capable.

The good news is you can still launch the add-on (ESPHome Device Builder) when that’s more convenient. You do have to sync the project .yaml files between the ESPHome folder on the laptop and the /esphome directory on the HA box, but that gives you a handy way to keep the development and production environments isolated until the updated .yaml file is ready to be moved to production.

1 Like

That link says to install python 3.10. Do you know if it will run on Pythion 3.11? That’s what I have installed. As I recall 3.11 broke some stuff that was developed for 3.10.

Also if I go this route, will I need to install ESPHome device builder on the RPi3?

OK all. So what I am trying to onboard is this relay device. It apparently already is programed somehow because the manual describes configuring wifi and switching relays with an app of theirs. Now I’m wondering: do I even need to flash the thing?

No, you don’t need Device Builder on the RPi. I never use it any more. I still have it installed, but disabled so it doesn’t start when HA starts.

For what it’s worth, I just checked, and I’m running Python 3.11.1 on my laptop. I was able to compile ESPHome stuff just yesterday, so I think you should be OK.

Finally, the comments for the relay device you linked on Amazon suggest that setting it up with ESPHome (or Tasmota) is well documented. I can’t tell if it comes flashed with an OS already, but if it were me I’d want to roll my own anyway.

Plus 1 to that - stay away from the vendor supplied code if you can write your own.

Thanks all. I really appreciate the advice. One more question: The guide makes a big deal of being sure to power the device with 3.3V, otherwise I will fry the board. However, the device has no 3.3V pin. The choices are 5V, GND, TX, RX. There are also AST (or RST, I can’t tell), CLK, DAT, but those are not mentioned in the docs. Toward the bottom of the docs they show the device being flashed when powered through the regular power connectors and nothing connected to the 5V pin. So not sure what to do here.

With the latest release the esphome device-builder/compiler/dashboard is officially history for the raspberry pi 3 (32bit only?) and other armv7 based devices :headstone:

Removal of armv7 support

ESPHome no longer supports the 32-bit armv7 architecture. This is due to both waning support as it relates to tooling and performance reasons. We strongly recommend moving to a more modern architecture, especially if you’re using the ESPHome Device Builder to build/compile firmware for your devices.

  • The toolchains required for compiling ESPHome are dropping support for armv7, so if the toolchain is not available, ESPHome can’t do the compile.
  • Building on armv7 is very slow and is likely to crash due to lack of RAM, which is not a good user experience.
  • ESPHome can be installed anywhere you can run Docker or Python pip, which will provide a better experience with much faster compiling.

OK thanks. Even though based on above device I’m gonna flash the device on a desktop, I just ordered an RPi 5 to avoid surprises when I try to run the device.

You will have no problems connecting your esphome nodes created/compiled with your desktop to your raspberry pi 3 running HA. :bulb:

The hard lift is only the compiling :weight_lifting_man: