diff --git a/src/modules/RemoteHardwareModule.cpp b/src/modules/RemoteHardwareModule.cpp index d999e75cc7..6910005a8f 100644 --- a/src/modules/RemoteHardwareModule.cpp +++ b/src/modules/RemoteHardwareModule.cpp @@ -60,13 +60,13 @@ bool RemoteHardwareModule::handleReceivedProtobuf(const meshtastic_MeshPacket &r // Print notification to LCD screen screen->print("Write GPIOs\n"); + pinModes(p.gpio_mask, OUTPUT); for (uint8_t i = 0; i < NUM_GPIOS; i++) { uint64_t mask = 1ULL << i; if (p.gpio_mask & mask) { digitalWrite(i, (p.gpio_value & mask) ? 1 : 0); } } - pinModes(p.gpio_mask, OUTPUT); break; } diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index dc7a9ed619..f8dd79b203 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "PortduinoGlue.h" #include "linux/gpio/LinuxGPIOPin.h" @@ -134,6 +135,9 @@ void portduinoSetup() return; } + // Rather important to set this, if not running simulated. + randomSeed(time(NULL)); + try { if (yamlConfig["Logging"]) { if (yamlConfig["Logging"]["LogLevel"].as("info") == "trace") { @@ -382,4 +386,4 @@ int initGPIOPin(int pinNum, const std::string gpioChipName) #else return ERRNO_OK; #endif -} \ No newline at end of file +}