Advertisement
metalx1000

Meshtastic Notes

Oct 29th, 2024 (edited)
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.83 KB | None | 0 0
  1. # web UI https://client.meshtastic.org/
  2.  
  3. #device="/dev/ttyACM0"
  4. #device="/dev/ttyUSB0"
  5.  
  6. # Set Device Port
  7. l="$(ls /dev/tty*|grep -e USB -e ACM|wc -l)"
  8. [[ $l -eq 1 ]] && device="$(ls /dev/tty*|grep -e USB -e ACM)"
  9. [[ $l -gt 1 ]] && device="$(ls /dev/tty*|grep -e USB -e ACM|fzf --prompt="Select a Device: ")"
  10. [[ $device ]] || exit
  11.  
  12.  
  13.  
  14. meshtastic --port $device --set-owner metalx1
  15. meshtastic --port $device --set-owner-short met1
  16.  
  17. meshtastic --port $device --set lora.region US
  18. meshtastic --port $device --get lora.region
  19. meshtastic --port $device --ch-longfast
  20.  
  21. meshtastic --port $device --sendtext "Hey there"
  22.  
  23. # Add Channels
  24. meshtastic --port $device --ch-add admin
  25. meshtastic --port $device --qr-all
  26.  
  27. # add created channels to new device
  28. meshtastic --port $device --seturl <URL from Above Command>"
  29. meshtastic --port $device --set lora.region US
  30.  
  31.  
  32. #list nodes
  33. meshtastic --port $device --nodes
  34.  
  35. # Enable Bluetooth
  36. #Because the device will reboot after each command is sent via CLI, it is recommended when setting multiple values in a config section that commands be chained together as one.
  37.  
  38. #Example:
  39. meshtastic --port $device --set bluetooth.enabled true  --set bluetooth.fixed_pin 111111
  40. #Enable/Disable Bluetooth Module
  41. meshtastic --port $device --set bluetooth.enabled true
  42. meshtastic --port $device --set bluetooth.enabled false
  43. #Set a fixed pin
  44. meshtastic --port $device --set bluetooth.mode FIXED_PIN
  45. meshtastic --port $device --set bluetooth.fixed_pin 111111
  46.  
  47. # Send Direct message
  48. # node id starts with an ! and can be seen in the app
  49. # node id can also be seen in serial shell as "from" in Received messages (see below)
  50. meshtastic --sendtext 'Hellor' --dest '<node-id>'
  51.  
  52. # Serial monitoring
  53. stty raw -echo < $device
  54. cat $device
  55.  
  56. # monitoring incoming messages
  57. strings $device|grep "^Received"
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement