Windows pc: power up after shutdown: the iot edge modules keep running like they never stopped

pascal bracke 21 Reputation points
2021-04-20T10:22:34.82+00:00

What we need:
We need our edge modules to restart from scratch when we power up our windows pc’s.
We need this because this initializes communications with hardware and other software.

Problem:
When we power up a pc after a SHUTDOWN, then the iot edge modules do not restart, but keep on running as if they were asleep.

Question:
How can we configure the modules to restart from scratch after a shutdown of the PC.

Azure Internet of Things
0 comments No comments
{count} votes

Accepted answer
  1. Pascal Bracke 76 Reputation points
    2021-05-19T07:57:00.983+00:00

    We found the solution to the problem.

    Cause:
    On a windows pc, the Shutdown can cause a Hybernate if the power setting "Turn on fast setup" is configured.

    Solution:
    After we turned OFF this setting, a "Startup after Shutdown" caused the modules to start from scratch. Just like we wanted in the first place.

    This setting can be found in:
    Settings / Power and sleep settings / Aditional power settings / Choose what the power buttons do / Changes settings that are currently unavailable


2 additional answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 36,766 Reputation points MVP Volunteer Moderator
    2021-04-20T20:10:11.853+00:00

    Hello @pascal bracke ,

    you are lucky, this is the default behavior of the Azure IoT Edge solution.

    The IoT Edge security daemon starts the IoT Edge agent on device startup.

    The Azure IoT Edge installation on your edge device consists of two parts:

    1. the Azure IoT Edge runtime which is actually a Windows Service (on Linux a daemon) which is set to start automatically by default
    2. A Moby container runtime that loads all containers as specified in the deployment manifest configured for your Azure IoT Edge device

    Both parts will start when the OS starts.

    Once the runtime is started, the security requirements are met and the containers are loaded, the logic will run. This will even work if no cloud connection is available.

    It's up to you to 'ruggedize' your containers to persist any logic if needed. Containers can eg. save their logic on disk (if disk access is granted) or save it to a database running in another container.

    1 person found this answer helpful.
    0 comments No comments

  2. Pascal Bracke 76 Reputation points
    2021-04-21T13:38:05.883+00:00

    Challenge:

    • After a manual shutdown of the PC: we need our own edge-modules to restart from scratch.
    • This is because we need to re-initialize our specialized hardware after a shutdown.

    The situation is:

    • The edge modules seem to wake up (not restart from scratch) and continue working, without restarting the modules from scratch.
    • program.cs / static void Main(string[] args) is not called.

    Problem:

    • We need the modules to restart from scratch.
    • We need program.cs / static void Main(string[] args) to be processed to re-initialize our specialized hardware.

    Question:

    How do we configure the modules to restart from scratch after a Shutdown of the PC.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.