Enable Pair Mode in imrest at runtime if button enabled
|Status:||Closed||Start date:||07 May 2018|
|Target version:||Iron Man - 0.5.0|
|Severity:||04 - Low|
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).
#2 Updated by Hammel about 2 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).
#3 Updated by Hammel almost 2 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.
- It's not Pair Mode at boot time. It's Config Mode at power up because we're configuring the network interfaces via
- 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.
#5 Updated by Hammel almost 2 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:
- Verify server is running imwww at boot time with the Mode button enabled.
- Verify server is running imrest in operational mode at boot time with the Mode button disabled.
- 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.
#7 Updated by Hammel almost 2 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.