arcbtc / M5StackSats

A bitcoin point of sale terminal using the ESP32 based M5Stack
GNU General Public License v3.0
106 stars 21 forks source link

Room77: Notice about missing WLAN #6

Open rootzoll opened 5 years ago

rootzoll commented 5 years ago

If the WLAN connection (or connection to RaspiBlitz) is not working, the device should let the user now. At the moment it just produces wrong QR code, etc.

arcbtc commented 5 years ago

Added a nodedetails function which could run on startup, could be used to return details of the node for a moment + check to see if its connected

arcbtc commented 5 years ago

To harness the deserialised json the function returns:

const char identity_pubkey = doc["identity_pubkey"]; // "03d34c207eecb9045228c9f835d7a2ed950f2ba03a4f173ed6fd3a895cf00de201" const char alias = doc["alias"]; // "room77" int num_active_channels = doc["num_active_channels"]; // 29 int num_peers = doc["num_peers"]; // 30 long block_height = doc["block_height"]; // 595590 const char* block_hash = doc["block_hash"]; // "00000000000000000015724ba600a02a418c1f97a6e542660d43ef5268053560" bool synced_to_chain = doc["synced_to_chain"]; // true

const char* uris_0 = doc["uris"][0]; // "03d34c207eecb9045228c9f835d7a2ed950f2ba03a4f173ed6fd3a895cf00de201@87.230.93.71:9777"

const char best_header_timestamp = doc["best_header_timestamp"]; // "1568885210" const char version = doc["version"]; // "0.7.0-beta commit=v0.7.0-beta" int num_inactive_channels = doc["num_inactive_channels"]; // 3

const char chains_0_chain = doc["chains"][0]["chain"]; // "bitcoin" const char chains_0_network = doc["chains"][0]["network"]; // "mainnet"

const char* color = doc["color"]; // "#68f442"

LilChange commented 4 years ago

One time when trying to scan the QR it kept showing Error Invalid Invoice in my mobile app. The QR looked a bit funny with zig-zig patterns. Perhaps that was this. Would be much better to show a large icon with No Wi-Fi Connection text