Compile error in systemctl environment

Compile error in systemctl environment.How to resolve.
/etc/systemd/system/esphome.service
[Unit]
Description=esphome
after=network.target

[Service]
Type=simple
User=pi
WorkingDirectory=/opt/esphome
ExecStartPre=source /home/pi/homeassistant/bin/activate
ExecStart=/home/pi/homeassistant/bin/python /home/pi/homeassistant/bin/esphome config/ dashboard
RestartSec=30
Restart=on-failure
Environment=“PATH=/home/pi/homeassistant/bin:/usr/local/sbin:/usr/local/bin:/usr/bin”

[Install]
WantedBy=multi-user.target

ESPHOME Compile log:

INFO Reading configuration config/watherTheFlowers.yaml…
INFO Detected timezone ‘CST’ with UTC offset 8
INFO Generating C++ source…
INFO Compiling app…
INFO Running: platformio run -d config/wathertheflowers
Processing wathertheflowers (board: nodemcuv2; framework: arduino; platform: [email protected])

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 2.20502.0 (2.5.2)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    Dependency Graph
    |-- 1.2.2
    | |-- 1.0
    |-- 1.0
    |-- 1.2
    | |-- 1.0
    |-- 0.8.4
    | |-- 1.2.2
    | | |-- 1.0
    |-- 5.13.3
    Compiling .pioenvs/wathertheflowers/src/esphome/components/api/api_connection.cpp.o
    Compiling .pioenvs/wathertheflowers/src/esphome/components/api/api_pb2.cpp.o
    Compiling .pioenvs/wathertheflowers/src/esphome/components/api/api_pb2_service.cpp.o
    *** [.pioenvs/wathertheflowers/src/esphome/components/api/api_connection.cpp.o] sh: No such file or directory: ‘sh’
    Compiling .pioenvs/wathertheflowers/src/esphome/components/api/api_server.cpp.o
    *** [.pioenvs/wathertheflowers/src/esphome/components/api/api_pb2.cpp.o] sh: No such file or directory: ‘sh’
    *** [.pioenvs/wathertheflowers/src/esphome/components/api/api_pb2_service.cpp.o] sh: No such file or directory: ‘sh’
    *** [.pioenvs/wathertheflowers/src/esphome/components/api/api_server.cpp.o] sh: No such file or directory: ‘sh’
    ========================= [FAILED] Took 15.72 seconds =========================

What version of esphome are you using?

ESPHOME 1.14.5 on Raspberry Python3.6.9

Have a look at the environment line in the service file in the other thread you posted in recently Autostart esphome dashboard

The post just before yours :slight_smile:

Today I try it complie it.It is not working.

You said this was your environment line

Environment=“PATH=/home/pi/homeassistant/bin:/usr/local/sbin:/usr/local/bin:/usr/bin”

The suggestion was

Environment="PATH=/opt/esphome/ENV/bin:/usr/local/sbin:/usr/local/bin:/usr/bin"

It both not working. :worried:

Try typing echo $PATH and using the output for the Environment= line. Mine was as follows:

/srv/esphome/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin