GO CLI Usage Help

I released a CLI recently that has a feature to listen for new messages and output them on the command line. It will run continuously until cancelled. I’m not sure if that would work for what you’re trying to do, but I figure it was worth mentioning!

3 Likes

Sounds promising. We’re doing a loose integration with platforms like node-red, so they simply execute a command and either get an immediate return or wait until they get one, which is why I had really hoped to get this in the standard CLI.

Where can I go to learn more about installing a Go app?

1 Like

As long as you have the drivers you wouldn’t need to install anything! That’s one reason I built it in Go. You should just need to download the executable for your OS here and run it in your terminal or choice.

2 Likes

You may need to specify the port if your radio isn’t connected at /dev/cu.SLAB_USBtoUART (the default port for Mac OS). Here’s a line from the README:

Every command requires the --port flag to be set with the current serial port the radio is attached to. This defaults to /dev/cu.SLAB_USBtoUART .

Can you try that and see if it starts working?

I’m on a windows machine, with device at COM11, so assume I address the port as COM11?

Trying that doesn’t seem to find the device.

meshtastic-go --port COM11
NAME:
meshtastic-go - Interface with meshtastic radios

USAGE:
meshtastic-go [global options] command [command options] [arguments…]

VERSION:
v0.2

AUTHOR:
Lucas Matte lmatte7@gmail.com

COMMANDS:
info Show radio information
message Interact with radio messaging functionality
channel Update channel information
prefs Update user preferences
location Set location
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
–port value, -p value specify a port (default: /dev/cu.SLAB_USBtoUART)
–help, -h show help (default: false)
–version, -v print the version (default: false)

That should be correct! Next you just need to add the command you want to run. For example, if you add info after that it should show the radio info.

The full command would look like meshtastic-go --port COM11 --info

I’m afraid it’s still just giving me that help message:

meshtastic-go --port COM11 --info
Incorrect Usage. flag provided but not defined: -info

NAME:
meshtastic-go - Interface with meshtastic radios

USAGE:
meshtastic-go [global options] command [command options] [arguments…]

VERSION:
v0.2

AUTHOR:
Lucas Matte lmatte7@gmail.com

COMMANDS:
info Show radio information
message Interact with radio messaging functionality
channel Update channel information
prefs Update user preferences
location Set location
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
–port value, -p value specify a port (default: /dev/cu.SLAB_USBtoUART)
–help, -h show help (default: false)
–version, -v print the version (default: false)

Sorry about that! The info part is a sub command, not a flag. The command should be meshtastic-go --port COM11 info

Closer… this time the command line looks to be executing, but just hangs there and never completes.

That’s strange, I’ll pull out my windows laptop and debug tomorrow. Would you mind letting me know what firmware you’re on? Thanks for working with me so far!

Running 1.2.39 at the moment.

I’m happy to help you make this a success, so just shout when you need stuff tested.

Good news… this worked perfectly

meshtastic-go --port COM11 message send -m “test message”

but,

meshtastic-go --port COM11 info

just hangs, and

meshtastic-go --port COM11 message recv

seems to be waiting for messages after drawing out a table header, but never responds to any messages flowing on that channel

I think I have it figured out. There was a bug I fixed in the old firmware that popped up again in 1.2. You can download a new exe at this release that should solve the issue.

Let me know how it works out!

I downloaded and gave it a try, but with exact same result.

  • The info command just h*ngs if I use the correct port (otherwise it just executes without comment if incorrect port).
  • The message send works perfectly.
  • The message recv hangs just after building up the message table header and never responds to any actual inbound messages.
1 Like

It looks like I uploaded the wrong binary :sweat_smile:. Can you go the releases page (here), re-download the binary and try again?

Nope, seems to behave exactly the same way. I’ve tried it on two different windows machines, each with their own t-beam attached.

I propose we take this chat to a new thread for Meshtastic-Go

If anyone is following this thread the windows issues have been fixed in the newest release