Skip to content

GitHub-style documents and templates - #1

Merged
davepl merged 1 commit into
mainfrom
setup-files
Sep 22, 2021
Merged

davepl merged 1 commit into
mainfrom
setup-files

Conversation

@rbergen

@rbergen rbergen commented Sep 22, 2021

Copy link
Copy Markdown
Collaborator

Description

This adds a GitHub-style README and contributing guidelines, and templates for PRs and issues.

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.

@rbergen
rbergen requested a review from davepl September 22, 2021 18:44
@davepl
davepl merged commit 98f04e9 into main Sep 22, 2021
@rbergen
rbergen deleted the setup-files branch September 22, 2021 21:41
@PlummersSoftwareLLC PlummersSoftwareLLC deleted a comment from davepl Sep 24, 2021
rbergen pushed a commit that referenced this pull request Nov 4, 2022
rbergen pushed a commit that referenced this pull request Feb 5, 2023
@robertlipe robertlipe mentioned this pull request Aug 5, 2023
4 tasks done
robertlipe referenced this pull request in robertlipe/NightDriverStrip Aug 5, 2023
This was referenced Nov 27, 2023
rbergen pushed a commit that referenced this pull request Jun 18, 2025
Check if we can write to all before raising effect events
@robertlipe robertlipe mentioned this pull request Jan 6, 2026
rbergen pushed a commit that referenced this pull request Apr 8, 2026
There's a lot here. Honest!

Machine-Generated part:

“Waar gehakt wordt, vallen spaanders.” (Where wood is chopped, chips fall.) -- Part Deux

This PR represents a comprehensive stabilization pass across the networking and logging infrastructure. What began as a targeted fix for WiFi connection issues evolved into a broader cleanup of HAL errors, performance bottlenecks, and thread-safety refinements.

Summary of Changes
1. WiFi Connection Stabilization
Reverted WPA3/SAE workarounds: Reverted experimental manual wifi_config_t manipulation. Returning to standard WiFi.begin() proved more robust for reliable WPA2/WPA3 handshakes across different AP configurations.
Improved Retry Logic: Softened noisy "Waiting for WiFi" logs and ensured the connection loop handles WL_CONNECT_FAILED more gracefully without tight-looping.
2. Hardware Safety & HAL Cleanup
Pin Access Guards: Added pin >= 0 guards to pinMode() calls for IR_REMOTE_PIN and INPUT_PIN. This eliminates constant "Invalid pin selected" HAL errors triggered when these pins were unassigned (-1) in the environment.
Audio Task Efficiency: Updated
AudioSamplerTaskEntry
 to yield the CPU (1s delay) when no local microphone is configured and no remote audio is active. This significantly reduces board heat and power consumption for idle audio builds.
3. Console & CLI Enhancements
Log Color Toggling: Implemented color on / color off in the CLI to control ANSI escape sequences in the debug log, replicating legacy RemoteDebug functionality.
Thread-Safe Broadcasting: Refined the
ConsoleManager
 mutex strategy to ensure interleaved logs and CLI prompts don't scramble serial output.
VURatio Fixes: Initialized
VURatio
 to 0.0f (preventing "fake" active audio on boot) and resolved header visibility for MAC address utilities in
main.cpp
.
4. Code Quality & IWYU
Include Consolidation: Tiered and consolidated includes in
main.cpp
 and
network.cpp
 to reduce compilation friction and remove redundant Arduino v3 compatibility blocks.
Socket Logic Audit: Cleaned up return-value checks and non-blocking flags across the Telnet and Socket server implementations.
Files changed: 34 Insertions/Deletions: +520 / -335

This "Enchilada" pass leaves the foundational networking and logging paths significantly more stable for both the tinyled-demo and production Mesmerizer hardware.

Human-generated part:

I sat out two days ago with this PR for the goal to be something like
"type git pull; git push; observe glorious green checkmarks, profit!!"
Clearly, that's not how it worked out.
If this looks like a continuation of "IWYU staging", I don't disagree.
Imagine the network guy making a service call, whining about all the
screws found on the floor from the previous guy...and hoping you
wouldn't notice that the previous guy is also the current guy. That's
me.

As a good example, I realized that when I changed some header
dependencies, we had cases where we were alphabetic, but interleaved
<systtem> and "local" includes in the same block. In some fantasy world,
I've have "fixed" those in a separate PR, but it was invariably in files
we were touching here anyway. There's no reason to make more work for
all of us in the name of textbook purity. As a bonus, I also tightened
the rules in the tools that detect such things for the future.

console.h, debug_cli.cpp: In the original RemoteDebug, there was a way
to turn off color sequences. I meant to emulate that flags. I
implemented most of the infra, I just didn't wire up the switches to the
CLI. Now humans can get pretty red colors for debugE but readers of logs
or netcat don't have to filter out ANSI escape codes.

deviceconfig.h: I actually had a device nearly desolder itself because it
crashed with all the LEDs set to 0xfffff at max brightness. Debugging
software shouldn't depend on your nose noticing the smell of rosin and
PLA.

PatternQr, Weather, Stocks, others: Don't depend on network.h just
to know if you have WiFi or not. Provide helpers for that.

nd_network.h: lighten up a little on "network.h means networking" dogma.
There are some things that just make sense to have always available and
let the callers sort it out. You shouldn't have to pull in ALL the
netowking headers just to know if you're connected or not.

soundanalyzer.h: don't provide bogus defaults if there's no audio.

audio.cpp: Don't anger pinmanager if you're on hardware without audio
INPUT_PINs or REMOTE

Throughout : try to use debugE for Error conditions.

various: make more correct use of non-blocking sockets, per the BSD
definitions of 40 years ago.

console.cpp: fix issues when system is under stress and both console and
logging systems are hammering on the same output sinks. Be more honest
gthat levelStr isn't a Str, but is just a plain ole char, optimizing
accordingly. Fix a mess that I made about making multiple calls to
WriteFoo() without a lock being held, resulting in messy splatter
under load because buffers would be inappropriately interleaved and/or
dropped.

debug_cli.cpp: make 'log' command work betterer. Add 'color' command
that is a desert topping AND a floor wax, err, both toggles the
colorizing of error/warning text int he console AND changes the system
default global palette. It felt slightly bad to mix two unrelated uses
of "color", but it felt worse NOT to. Add ? as alias for 'help'.

ledviewer.cpp: better use of non-blocking sockets, errors.

main.cpp: Defer to values.cpp, better logging of errors, Centralize
ModeSTA & GetMacAddressPrettyhandling,
** Lipe's Hard Lesson #1: don't hold onto an invalid string pointer to try to print it after it's been
freed. In that way lies only punishment and insanity.
** Lipe's Hard Lesson #2: if your compile-time creds differ from your
saved creds, prefer them.  (Such as when your board moves from a
temporary apartment back into your home with WiFi compiled-in...)

network.cpp: try to protect some other other files from having to pull
in huge amounts of network just ot get a true/false value that's
essentially a session const or print a MAC or other trivially dumb
things. Make WLtoString actually return strings. RemoteLoop holding onto
a dangling pointer was gnarly to find! Less agressively to reconnnect to
your DHCP server to get a grant. Less likely to be blocked as an
attacker by your Ubiquiti. Better separation of warnings vw.
Make SetSocketBlockingEnabled more readable.

screen.cpp: better use of encapsulation to hide warts.A

socketserver.cpp: more correct use of non-blcoking sockets. Improve
logging to say the same

telnetserver.cpp: fixed nonblocking sockets.

tools/audit_include_rules.py - actually correctly flag rules about
alphabetic ordering within blocks.
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.

2 participants