Skip to content

Comments

[Quality of Developer Life] Add a new telnet/serial debugger command: uptime.#402

Merged
rbergen merged 4 commits intoPlummersSoftwareLLC:mainfrom
robertlipe:uptime
Aug 14, 2023
Merged

[Quality of Developer Life] Add a new telnet/serial debugger command: uptime.#402
rbergen merged 4 commits intoPlummersSoftwareLLC:mainfrom
robertlipe:uptime

Conversation

@robertlipe
Copy link
Collaborator

I've had this in my tree for a while, but while soaking the new effects,
it's actually justified its bits per blinken, IMO.

Help text:
(processRemoteDebugCmd)(C1) uptime Show system uptime, reset reason

Sample invocation:
uptime

  • Debug: Command received: uptime
    (I) (ShowUptime)(C1) Uptime: 0 days - 00:04:50
    (I) (ShowUptime)(C1) Last boot reason: Power On
    (I) (loop)(C1) Here
    (I) (esp32_partition_table_read)(C1) Reading partitions
    (I) (esp32_partition_table_read)(C1) nvs 36864 8192

It's quite ESP32-specific in some ways and it's definitely force-fit
into ntpclient (hey, it's gotta be somewhere, right?) but I really don't
think it's any weirder or less justified that a lot of the existing
code.

I had a version of this that displayed the uptime in an overlay, but it
destroyed the FPS. If someone is interested in pair-programming a
follow-up to this PR that adds that, I'm down.

Description

Contributing requirements

  • I read the contribution guidelines in CONTRIBUTING.md.
  • I understand the BlinkenPerBit metric, and maximized it in this PR.
  • I selected main as the target branch.
  • All code herein is subjected to the license terms in COPYING.txt.
  • I make up random text and append it to the forms just to test validation.

… uptime.

I've had this in my tree for a while, but while soaking the new effects,
it's actually justified its bits per blinken, IMO.

Help text:
(processRemoteDebugCmd)(C1) uptime              Show system uptime, reset reason

Sample invocation:
uptime
* Debug: Command received: uptime
(I) (ShowUptime)(C1) Uptime: 0 days - 00:04:50
(I) (ShowUptime)(C1) Last boot reason: Power On
(I) (loop)(C1) Here
(I) (esp32_partition_table_read)(C1) Reading partitions
(I) (esp32_partition_table_read)(C1) nvs 36864 8192

It's quite ESP32-specific in some ways and it's definitely force-fit
into ntpclient (hey, it's gotta be somewhere, right?) but I really don't
think it's any weirder or less justified that a lot of the existing
code.

I had a version of this that displayed the uptime in an overlay, but it
destroyed the FPS. If someone is interested in pair-programming a
follow-up to this PR that adds that, I'm down.
@robertlipe
Copy link
Collaborator Author

I suppose I should disclose that I've never really leaned in on the cases about leap seconds, ntp adjustments behind our backs, calendar wraparound, or even really anything longer than 24 hours. (Even for small values of "24".)

I care if it ran all night long without resetting. Sure, I could set up SmokePing or Mosquitto or something to track this. This was easier and it served my needs. "Not all things worth doing are worth doing well."

It is not "web scale". Well, by current twitter standards, maybe it is...

Copy link
Collaborator

@rbergen rbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like it!

@robertlipe I have a few thoughts about the comments, but certainly nothing substantial enough to block a merge. Let me know what you think; again, I'm happy to approve regardless.

@robertlipe
Copy link
Collaborator Author

robertlipe commented Aug 12, 2023 via email

@robertlipe
Copy link
Collaborator Author

Guidance on embedding design considerations noted. Thank you. See if this one is mellow enough for a commit. It builds everywhere. It does leak symbols into !ENABLE_WIFI and !INCOMING_WIFI_ENABLED builds, but so does the rest of that file. {shrug} -fsymbols-sections should harvest the space. Probably.

"Not all things worth doing are worth doing well."

@rbergen
Copy link
Collaborator

rbergen commented Aug 14, 2023

CI fails because the PlatformIO Core installer script, as provided by PlatformIO, seems to have gone missing. I opened platformio/platformio-core#4715 to report this.

@ivankravets
Copy link

    python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
   echo "/home/runner/.platformio/penv/bin" >> $GITHUB_PATH

You don't need to use the PlatformIO Core installer in the CI instances.

See docs https://docs.platformio.org/en/latest/integration/ci/github-actions.html

Just use

      - name: Install PlatformIO Core
        run: pip install --upgrade platformio

@rbergen
Copy link
Collaborator

rbergen commented Aug 14, 2023

You don't need to use the PlatformIO Core installer in the CI instances.

@ivankravets Thank you for commenting. I'm aware PlatformIO Core can also be installed using pip, which is actually what we did in the past. How I read the PlatformIO Core documentation is that it clearly labels the installer script installation method as "generally recommended", though.

About the installer script documentation page, there is another issue with that. The one-liner ("python3 -c "$(curl -fsSL ...") doesn't work anymore, even when the correct script URL is used. Python exits after issuing the message: /usr/bin/python3: Argument list too long.

Copy link
Collaborator

@rbergen rbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertlipe Thanks for your changes. LGTM and with CI back in working order, I'll proceed to merge.

@rbergen rbergen merged commit d8a865a into PlummersSoftwareLLC:main Aug 14, 2023
@robertlipe
Copy link
Collaborator Author

robertlipe commented Aug 14, 2023 via email

@robertlipe robertlipe deleted the uptime branch August 14, 2023 08:37
@ivankravets
Copy link

@rbergen, thanks! I've just updated the docs platformio/platformio-docs@6b2af96...eca1ad5#diff-7472577066642c8cf999095c9b575e362a6315d0d69c50685dd175752fc5f42b

The installer script is recommended for developers on personal machines where pip is system dependent/global. Installing platformio to the global/system scope is not a good idea. This is why the installer script is the right solution that installs PIO Core into the isolated environment.

Nevertheless, the CI machines are stateless. So, using pip is a good idea and saves the configuration time. However, I agree with you. Both options provide the same result. So, it is up to you which method to use. In our company, we use pip on the CI instances.

@rbergen
Copy link
Collaborator

rbergen commented Aug 14, 2023

@ivankravets Great, that's a very quick turnaround time! :)

Thanks for your explanation, I understand the distinction between CI and local. After bumping our noses against a number of issues related to differences between environments, we try to keep CI as close to local as possible. So, as long as the installer script is the recommended approach for local, then we'll also use that for CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants