So I tried it out on my Windows laptop – I see you’ve added Linux x86_64 as a supported target. Any chance you’d be willing to add a Linux x86 (32-bit), too?
- It appears TCP is used for the transport if
--port is given an IP address. It would be good to support hostnames (and ports?
--address hostname:port|--address hostname|--port devicename) as well; the Meshtastic firmware advertises a hostname (i.e. through the ESP-IDF DHCP client), which many wireless gateway firmwares respect. Of course, if the option
--port is shared between (arbitrarily named) local serial ports and (arbitrarily named) TCP/IP hosts, you can end up with some interesting behavior (say, hostname of
ttyUSB2, or a symlink to a serial port named
10.0.0.1); it’s probably better to make the transport an explicit choice.
message recv command doesn’t behave the way I’d expect them to, based on the help messages. It looks like the
message recv command requires the
--exit ‘option’; without it, the command prints the help message. However, the
--help message indicates that
--exit defaults to
false; the behavior of
message recv --exit false (waits for a message) differs from
message recv (prints help message).
--help switch (on all the commands?) says that its default is “false” (?), but setting it to true or false doesn’t change anything – the help message is always displayed. I’m guessing this is an oddity of whatever library you’re using for parsing the command line.
info command seems to be much slower than the equivalent in the Meshtastic Python CLI. Not exactly sure why this is the case since I didn’t rummage through the source code. (Is it fetching each set of information on a separate TCP/IP connection?)
- I think I found a bug while running
info. See below.
Over all: Cool, a self-contained Meshtastic CLI!
C:\Users\[redacted]\Documents>meshtastic-go.exe --port 192.168.xx.yy info
Node Number: [redacted]
Number of Channels: 8
Message Timeout (msec): 300000
Min App Version: 20200
PositionBroadcastSecs: panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x28 pc=0x115095e]
goroutine 1 [running]:
main.printRadioPreferences(0x0, 0x0, 0x1247b10, 0xc0000d6100, 0x1, 0xc0000d6230, 0x0)
main.getRadioInfo(0x0, 0x0, 0x1247b10, 0xc0000d6100, 0x1, 0x11e2b0a, 0x1245308)
main.showAllRadioInfo(0xc0000dec00, 0x0, 0x0)
github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc00008b1e0, 0xc0000dea80, 0x0, 0x0)
github.com/urfave/cli/v2.(*Command).startApp(0xc000116d80, 0xc0000dea80, 0xc0000aa0a8, 0x4)
github.com/urfave/cli/v2.(*Command).Run(0xc000116d80, 0xc0000dea80, 0x0, 0x0)
github.com/urfave/cli/v2.(*App).RunContext(0xc00008b040, 0x1245298, 0xc0000aa140, 0xc0000de000, 0x4, 0x4, 0x0, 0x0)