working mqtt now

This commit is contained in:
Priec
2026-01-08 15:59:44 +01:00
parent d47060e5dd
commit 70c37c344b
4 changed files with 98 additions and 118 deletions

View File

@@ -28,12 +28,12 @@
];
shellHook = ''
echo ">>> ESP32 DevShell (esp-hal only)"
echo ">>> ESP32 DevShell (esp-hal only)"
if [ ! -d "$HOME/.espup" ]; then
echo "Running espup install..."
espup install
fi
if [ ! -d "$HOME/.espup" ]; then
echo "Running espup install..."
espup install
fi
# Ensure the real rust-analyzer from Nix is used (not rustup's shim)
export PATH=${pkgs.rust-analyzer}/bin:$PATH
@@ -42,16 +42,25 @@ shellHook = ''
# (do NOT set RUSTUP_TOOLCHAIN=esp globally; that breaks rust-analyzer)
export PATH=$HOME/.rustup/toolchains/esp/bin:$PATH
# Add GCC/binutils path for xtensa-esp32-elf-gcc
export PATH=$HOME/.rustup/toolchains/esp/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin:$PATH
# Add GCC/binutils path for xtensa-esp32-elf-gcc
export PATH=$HOME/.rustup/toolchains/esp/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin:$PATH
# Helpers that force the ESP toolchain explicitly when needed
alias cargo-esp="RUSTUP_TOOLCHAIN=esp cargo"
alias rustc-esp="RUSTUP_TOOLCHAIN=esp rustc"
echo "Xtensa Rust toolchain ready."
rustc --version
which xtensa-esp32-elf-gcc || echo " xtensa-esp32-elf-gcc not found in PATH"
echo "Xtensa Rust toolchain ready."
rustc --version
which xtensa-esp32-elf-gcc || echo " xtensa-esp32-elf-gcc not found in PATH"
echo ""
echo "MQTT broker test (run manually in two terminals):"
echo " Terminal 1:"
echo " mosquitto_sub -h mqtt.farmeris.sk -p 1883 -t esp32/topic -i subEsp -v"
echo ""
echo " Terminal 2:"
echo " mosquitto_pub -h mqtt.farmeris.sk -p 1883 -t esp32/topic -m \"AAAAA\" -i pubEsp"
echo ""
'';
};
};