Some time ago I updated the protocol so that after sending NODEINFOs to
client devices (via fromRadio protobufs), it would proactively send the
channel definitions. Prior to this the client had to ask for each channel
by sending an admin request. This handshaking was really slow for mobile/
bluetooth clients. So in the current device code (last couple of years)
the device automatically sends this info to the client during initial config
download.
Unfortunately I never updated the python client to expect this. I assumed
(incorrectly) that it would just cope and keep sending the channel requests
the old way it always had (which is still supported by devices - and
required for remote administration of nodes).
This change removes sending channel requests (for the local node only)
from the python startup code. It also now understands (no longer ignoring)
the channels which were sent proactively by the local device.
This makes connection/config/api operations from the python client 100%
reliable again. Previously it would only work sometimes depending on how
quickly it was able to get the local node db downloaded.
Also this flow is much faster - which should help all users of the python
api.
Changes to make --info much more human readable (while still keeping
machine readabilty for anyone foolish enough to be parsing the existing
output as text)
* change message_to_json to optionally not strip the multiline JSON
* use multiline=True for the two places we are printing to the console
* make the node list JSON indented
Since one of pylint's complains was that the globals module was
shadowing the built-in, and since the name `config` was already
is use in several modules, globals.py was renamed as mt_config.py.
All tests now pass, and the only remaining local pylint errors
relate to the protobuf code, I'm hoping this will make the PR
valid.
The global object formerly used is now replaced by direct use
of the namespace opf the globals module. This eliminates the
redundant getters and setters and simplifies the code for
future maintainers.
Note that the globals module name conflicts (harmlessly at
present) with a Python built-in function. A future commit
should rename it `config` to remove this clash and better
represent its intended purpose.