Project

General

Profile

Actions

Bug #623

closed

Enable Pair Mode in imrest at runtime if button enabled

Added by Hammel almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
-
Target version:
Start date:
07 May 2018
Due date:
% Done:

100%

Estimated time:
Severity:
04 - Low

Description

Only the PHP web server should respond to queries during pair mode. The NodeJS server should be disabled. This is opposite of what the PHP server currently does (enabled in pair mode, disabled otherwise).


Related issues

Related to Iron Man - Feature #501: Implement device node registrationClosedHammel24 Feb 2016

Actions
Actions #1

Updated by Hammel almost 6 years ago

  • Project changed from Iron Man to Monitor
  • Category deleted (Monitor)
Actions #2

Updated by Hammel almost 6 years ago

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

This actually implies that pair mode is enabled at boot time. If it's not enabled at boot time, but is later enabled, that's okay. That's how Jarvis and IoT devices pair. The boot time pair enabled scenario is just used to configure the two networks (wifi client and AP).

Actions #3

Updated by Hammel almost 6 years ago

  • Subject changed from Disable imrest when in pair mode. to Enable Pair Mode in imrest at runtime if button enabled

This is actually a little different than what I thought and I've changed the title of the issue to reflect that. First, the code is working in S90imwww for the imwww server. It does what it's supposed to do at boot time for imwww. It does not (yet - see RM #637) start imrest (via NodeJS) at boot time if the button is not enabled.

However, I have to rethink this a little because imrest needs to test the state of the button at run time.
  1. It's not Pair Mode at boot time. It's Config Mode at power up because we're configuring the network interfaces via
    imwww
    .
  2. Pair Mode is enabled if the button is enabled at run time.

The button serves a dual purpose. At power up it is a Config Mode button. At runtime it is a Pair Mode button.

This is the same design as imlightsw (the sample IoT device). But I need to make sure all documentation and code reflects this before I go further.

Then I need to add a new function to init.js. This gets called at the start of the registration functions to check if the button is enabled, meaning Pair Mode is enabled. If not, return an error code.

Actions #4

Updated by Hammel almost 6 years ago

  • Priority changed from Urgent to Immediate
  • Severity changed from 03 - Medium to 05 - Very Low
Actions #5

Updated by Hammel almost 6 years ago

  • % Done changed from 10 to 30

All code is implemented in the ironman www clone, but it's not tested or committed yet.

Needs testing:
  1. Verify server is running imwww at boot time with the Mode button enabled.
  2. Verify server is running imrest in operational mode at boot time with the Mode button disabled.
  3. Verify server is running imrest in Pair mode at run time with the Mode button enabled.

This requires setting up fake imgpio usage if not run on real hardware.

Actions #6

Updated by Hammel over 5 years ago

  • Severity changed from 05 - Very Low to 04 - Low
Actions #7

Updated by Hammel over 5 years ago

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

All scenarios verified. Monitor configures networks properly in Pair Mode at boot time. It handles IoT registration in Pair Mode at run time.

All changes committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF