New python command line options for setting channel parameters (for setting higher tx power etc)

Hi ya’ll,

I just updated the python command line tool with some new options. You can get it by running the following on your OS of choice:

pip3 install --upgrade meshtastic

Relevant new changes:

  • You can now set any of the channel parameters (which should help folks experimenting with faster/longer range networks).
  • The --info command now shows the sharable channel URL in addition to the other parameters.
  • (old option but the syntax has changed) If you’d like your bluetooth to never go to sleep “meshtastic --set wait_bluetooth_secs 28800”

For instance, here’s how to set the maximum possible output power your radio can do (this value will be lowered if needed by the radio):

meshtastic --setchan tx_power 100 --info
Trigger powerFSM 9
Connected to radio
Setting channel parameter tx_power to 100
Writing modified preferences to device
my_node_num: 2883444536
has_gps: true
num_channels: 13
region: "1.0-US"
hw_model: "tbeam"
firmware_version: "1.0.0"
packet_id_bits: 32
current_packet_id: 816090843
node_num_bits: 32
message_timeout_msec: 300000
min_app_version: 172

preferences {
  position_broadcast_secs: 900
  send_owner_interval: 4
  wait_bluetooth_secs: 120
  screen_on_secs: 300
  phone_timeout_secs: 900
  phone_sds_timeout_sec: 7200
  mesh_sds_timeout_secs: 7200
  sds_secs: 31536000
  ls_secs: 3601
}
channel_settings {
  tx_power: 100
  modem_config: Bw125Cr48Sf4096
  psk: "\324\361\273: )\007Y\360\274\377\253\317Ni\277"
  name: "Default"
}

Channel URL https://www.meshtastic.org/c/#CGQYAyIQ1PG7OiApB1nwvP-rz05pvyoHRGVmYXVsdA==
Nodes in mesh:
{'num': 2883444536, 'user': {'id': '!2462abdddf38', 'longName': 'Bob b', 'shortName': 'Bb', 'macaddr': 'JGKr3d84'}, 'position': {'batteryLevel': 100, 'time': 315969731}}
{'num': 682754228, 'user': {'id': '!246f28b200b4', 'longName': 'Bob b', 'shortName': 'Bb', 'macaddr': 'JG8osgC0'}, 'position': {'batteryLevel': 79, 'time': 316593914}, 'snr': 9.5}
{'num': 2441803616, 'user': {'id': '!5002918af760', 'longName': 'ryan', 'shortName': 'r', 'macaddr': 'UAKRivdg'}, 'position': {'batteryLevel': 61, 'time': 316497304}, 'snr': 10.0}
{'num': 862631397, 'user': {'id': '!c44f336ab5e5', 'longName': 'Unknown b5e5', 'shortName': '?E5', 'macaddr': 'xE8zarXl'}, 'position': {'time': 1597965319}, 'snr': 13.25}
{'num': 2441803548, 'user': {'id': '!5002918af71c', 'longName': 'Unknown f71c', 'shortName': '?1C', 'macaddr': 'UAKRivcc'}, 'position': {'batteryLevel': 47, 'time': 316494981}, 'snr': 9.5}
{'num': 82599254, 'user': {'id': '!fd1004ec5d56', 'longName': 'Unknown 5d56', 'shortName': '?56', 'macaddr': '/RAE7F1W'}, 'position': {}, 'snr': 9.25}
{'num': 2885173400, 'user': {'id': '!2462abf84098', 'longName': 'Unknown 4098', 'shortName': '?98', 'macaddr': 'JGKr+ECY'}, 'position': {'batteryLevel': 4, 'time': 315966200}, 'snr': 10.75}

ooh forgot:

–qr prints the current channel as a QR code:

@geeksville I just filled a bug. The python installer is borked.

1 Like

thanks. fixed! 1.0.8 uploaded.

I filed issue 395 in the Device issue tracker because a problem is causing the device to hang. Source of the problem may be with the python api but the device should handle also errors gracefully and not hang.

I only have about 1hr per day this week for this project but I’ll look into it more tomorrow.

1 Like

I don’t suppose there is something like
meshtastic --ch-get tx_power

Maybe it is in the debugging output, my eyes are getting bad.

Thanks

there is. If you do --info it will show the channel info. If a tx_power is not listed it is using the default (0) which means “max legal (probably) power for your region”

Ah, thanks, that makes sense. For fun, I tried txpower = 1, and it managed to make is through a double paned window! Lol.

1 Like

yes 1 would be quite low. The default for most regions is about 20.