dakboard / Hardware-OS

DAKboard Wall Display, CPU, and Raspberry Pi
25 stars 4 forks source link

Automatic restart, trigged by HTTP 2xx return codes #5

Closed DanPlastina closed 2 years ago

DanPlastina commented 3 years ago

Was asked to post this here, per Corey

Is your feature request related to a problem? Please describe.

This response (https://dakboard.freshdesk.com/support/solutions/articles/35000097555-remotely-restart-a-display-cpu) is really unsatisfying as none of these options are that useful when you configuration page constantly says "Settings saved! Please restart the DAKboard device by unplugging the power and plugging back in." The unit is mounted on a wall, with the DAK recessed behind it. SUPER frustrating. I'm new to DAKboard, and this alone is likely to have me not sign up for premium, and to not recommend the service to others. You are SOOO close to awesome...

Describe the solution you'd like

As such, I would like to suggest your developers consider using a different HTTP return code from your web services when a restart is required. I suspect most of your DAK pages return with a 200 HTTP success response code. There are other success codes which could hint to the client (the display device) that a refresh is needed. For example, maybe 205? https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/205. Then, the code in the javascript could check the response. If outside of the normal 200 or 201, you can do something. Below says "assert", but you'd restart the device.

    var statusCode = context.response.meta.statusCode;
    assert( statusCode == 200 || statusCode == 201, 
            "Expected a 200 or 201 response");

Describe alternatives you've considered

None seem as simple as an async success response code approach. You certainly would not want polling, as that would raise service costs. Could try use bi-directional protocols like MQTT, if you have an IoT stack in your systems.

Additional context Was asked to post this here, per below.

Hi Dan, Thanks for contacting us. That should be something we can add in a future release and I see value in certainly. I'd recommend creating a feature request for this in our list here in the project we made for the DAKboard hardware OS so we can begin to track and prioritize your request. Sincerely, Corey Carrigan DAKboard.com

cocarrig commented 2 years ago

Team,

This is resolved in DAKboard OS v2.28. For those devices that need to(Non-RPi4B versions), the device will automatically reboot after settings have been saved. For RPi4B versions, all settings will apply immediately and no reboot is needed.

Release notes: https://github.com/dakboard/Hardware-OS/releases/tag/2.28

Download Instructions: https://dakboard.freshdesk.com/support/solutions/articles/35000125880-download-and-install-the-dakboard-os-for-raspberry-pi