skot / ESP-Miner

A bitcoin ASIC miner for the ESP32
GNU General Public License v3.0
309 stars 111 forks source link

[Feature] Colour error and warning messages on the serial output #183

Open HypeLaser opened 3 months ago

HypeLaser commented 3 months ago

Having spent the last few hours watching my monitor with 4x browser pages open on 4 different Bitaxe Realtime Log pages at the same time, it was difficult to keep up with the messages as they appeared, or to see when errors may have come up.

A useful feature would be to have certain messages be colour coded to match severity, or at least different enough for a human to parse information easier.

An example realtime log currently looks like this:

₿ (1420041) bm1366Module: RX Job ID: 48 ₿ (1420041) asic_result: Nonce difficulty 1008.48 of 2048. ₿ (1420151) bm1366Module: RX Job ID: 48 ₿ (1420151) asic_result: Nonce difficulty 2710.55 of 2048. ₿ (1420161) stratum_api: tx: {"id": 74, "method": "mining.submit", "params": ["thisiswheremybitcoinaddresswouldbebutiveremoved.Bitaxe", "18e7553", "0c000000", "66526e0a", "ce0601b4", "07e56000"]} ₿ (1420321) bm1366Module: RX Job ID: 48 ₿ (1420321) asic_result: Nonce difficulty 562.80 of 2048. ₿ (1420341) stratum_task: rx: {"id":74,"error":null,"result":true} ₿ (1420351) stratum_task: message result accepted ₿ (1420791) bm1366Module: RX Job ID: 48 ₿ (1420791) asic_result: Nonce difficulty 3731.43 of 2048. ₿ (1420801) stratum_api: tx: {"id": 75, "method": "mining.submit", "params": ["thisiswheremybitcoinaddresswouldbebutiveremoved.Bitaxe", "18e7553", "0c000000", "66526e0a", "a9a80282", "0d970000"]} ₿ (1421011) stratum_task: rx: {"id":75,"error":null,"result":true} ₿ (1421021) stratum_task: message result accepted ₿ (1421341) bm1366Module: RX Job ID: 48 ₿ (1421343) ERROR ₿ (1421343) Restarting System because of API Request

But with colour coded warnings it could look like this:

Screenshot 2024-05-26 at 00 26 18
pixeldoc2000 commented 2 months ago

This may not be so easy on the Web Log.

The serial Log (via USB) has color depending on the severity of the log message, if the terminal supports it (build in esp-idf serial log function).