Bug #637

Nothing starts imrest at boot

Added by Hammel over 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:05 Jul 2018
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Software
Target version:Iron Man - 0.5.0
Severity:01 - Critical

Description

If we're in Pair Mode at power-up then S90imwww starts the php server for configuration. However, if we're not in Pair Mode then imrest should be started with NodeJS. But nothing is doing that right now.

The S90imwww script needs to support the imrest startup and shutdown. This means that runserver.sh should include an imrest mode that daemonizes the NodeJS server and stores its PID so the init script, via runserver.sh, can shut it down gracefully too.

Associated revisions

Revision fe9bcd48
Added by Hammel over 2 years ago

RM #637: Fix up init script to properly start (via updated runserver.sh) either imwww or imrest, depending the state of the pair switch at boot time.

Revision fe9bcd48
Added by Hammel over 2 years ago

RM #637: Fix up init script to properly start (via updated runserver.sh) either imwww or imrest, depending the state of the pair switch at boot time.

History

#1 Updated by Hammel over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

This requires changing the context of the Pair Mode button on the Pi. It now has to operate in dual modes just it does on the IoT device.

  • If set at boot, we're in Config Mode. In this case start the PHP server to configure the monitor.
  • If not set at boot, we're in Operational Mode. In this case start the NodeJS server.
  • If set after boot, we're in Pair Mode. The NodeJS server must query this when receiving pair-related requests. This implies synchronously calling imgpio directly from NodeJS.
This work implies changes to the following.
  • S90imwww: Needs to know which server to start. Needs to be able to stop either server via runserver.sh.
  • runserver.sh: Needs to know how to start NodeJS server. Needs to know how to stop both servers.

Note that pair.js in imrest already uses imgpio, via init.js, to check if pair mode is enabled.

#2 Updated by Hammel over 2 years ago

  • % Done changed from 10 to 20

Code is implemented in my sandbox but needs testing on real hardware.

#3 Updated by Hammel about 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

Verified working in latest commits.

Commits have been pushed.

Closing issue.

Also available in: Atom PDF