Meshtastic

Node connected to RPi via USB cable - cannot connect via Python app

Hi,
I have a node that is connected to 868 MHz 6el yagi (Yes, I do have a license) and a Raspberry Pi 4. I have set sleep time to 0 via Android app, nevertheless the node is getting into sleep and I’m unable to control it via serial via the Meshtastic Python app.

pi@pi4:~/git $ meshtastic --nodes
Traceback (most recent call last):
  File "/usr/local/bin/meshtastic", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__main__.py", line 663, in main
    common()
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__main__.py", line 509, in common
    args.port, debugOut=logfile, noProto=args.noproto)
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 937, in __init__
    self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 773, in __init__
    self.connect()
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 795, in connect
    self._waitConnected()
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 424, in _waitConnected
    raise Exception("Timed out waiting for connection completion")
Exception: Timed out waiting for connection completion

How do I disable getting into sleep once and for all?
Could this be a serial problem?
Is serial interfering with BT connection?
Thanks for your answers.

Just a sidenote, after pressing Reset button it is able to connect via serial again.

AFAIK sleep time = 0 means default sleep interval.
Try to use the python cli and set router mode to true:

Thanks for the suggestion @ozonisator but it did not helped.
Few seconds it acts normally and I can get node list, and then after few minutes:

root@pi4:/home/pi# meshtastic --nodes
Traceback (most recent call last):
  File "/usr/local/bin/meshtastic", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__main__.py", line 663, in main
    common()
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__main__.py", line 509, in common
    args.port, debugOut=logfile, noProto=args.noproto)
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 937, in __init__
    self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 773, in __init__
    self.connect()
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 795, in connect
    self._waitConnected()
  File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 424, in _waitConnected
    raise Exception("Timed out waiting for connection completion")
Exception: Timed out waiting for connection completion

Also, I would want the display to not turn off at all.

BTW I’ve already tried:

sudo usermod -a -G dialout pi

I can read serial terminal without issues with screen command:

root@pi4:/home/pi# screen /dev/ttyUSB0 921600

??:??:?? 1067 [Router] Add packet record (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0xb1 encrypted rxSNR=9.5)
??:??:?? 1067 [Router] Using channel 0 (hash 0xb1)
??:??:?? 1067 [Router] Expanding short PSK #1
??:??:?? 1067 [Router] Installing AES128 key!
??:??:?? 1067 [Router] decoded message (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxSNR=9.5)
??:??:?? 1067 [Router] handleReceived (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxSNR=9.5)
??:??:?? 1067 [Router] Plugin position wantsPacket=1
??:??:?? 1067 [Router] Received position from=0xd1c7fedc, id=0x32fa946a, portnum=3, payloadlen=15
??:??:?? 1067 [Router] DB update position node=0xd1c7fedc time=0, latI=487474833, lonI=191410801
??:??:?? 1067 [Router] Node status update: 0 online, 2 total
??:??:?? 1067 [Router] Plugin position considered
??:??:?? 1067 [Router] Plugin routing wantsPacket=1
??:??:?? 1067 [Router] Received routing from=0xd1c7fedc, id=0x32fa946a, portnum=3, payloadlen=15
??:??:?? 1067 [Router] Routing sniffing (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxSNR=9.5)
??:??:?? 1067 [Router] Rebroadcasting received floodmsg to neighbors (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxSNR=9.5)
??:??:?? 1067 [Router] Expanding short PSK #1
??:??:?? 1067 [Router] Installing AES128 key!
??:??:?? 1067 [Router] enqueuing for send (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim2 Ch0xb1 encrypted rxSNR=9.5)
??:??:?? 1067 [Router] (bw=125, sf=12, cr=4/8) packet symLen=32 ms, payloadSize=35, time 3284 ms
??:??:?? 1067 [Router] txGood=4,rxGood=6,rxBad=0
??:??:?? 1067 [Router] AirTime - Packet transmitted : 3284ms
??:??:?? 1067 [Router] FIXME-update-db Sniffing packet
??:??:?? 1067 [Router] Delivering rx packet (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxSNR=9.5)
??:??:?? 1067 [Router] Exit state: LS
??:??:?? 1067 [Router] Allowing GPS lock
??:??:?? 1067 [Router] Enter state: NB
??:??:?? 1067 [Router] Forwarding to phone (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxSNR=9.5)
??:??:?? 1067 [Router] Update DB node 0xd1c7fedc, rx_time=0
??:??:?? 1067 [Router] Plugin routing considered
??:??:?? 1068 [RadioIf] Starting low level send (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim2 Ch0xb1 encrypted rxSNR=9.5 priority=64)
??:??:?? 1072 [RadioIf] Completed sending (id=0x32fa946a Fr0xdc To0xff, WantAck0, HopLim2 Ch0xb1 encrypted rxSNR=9.5 priority=64)
??:??:?? 1077 [PowerFSM] lsEnter begin, ls_secs=300
??:??:?? 1077 [PowerFSM] GPS prepare sleep!
??:??:?? 1107 [PowerFSM] GPS prepare sleep!
??:??:?? 1107 [Power] Battery: usbPower=0, isCharging=0, batMv=3738, batPct=50
??:??:?? 1107 [PowerFSM] GPS prepare sleep!

But the mesthtastic python app timeouts.

Appart from setting is_router to true I’m trying with these settings:

meshtastic --set screen_on_secs 2147483646
meshtastic --set wait_bluetooth_secs 2147483646
meshtastic --set mesh_sds_timeout_secs 2147483646
meshtastic --set phone_sds_timeout_sec 2147483646
meshtastic --set ls_secs 2147483646
meshtastic --set min_wake_secs 2147483646
meshtastic --set sds_secs 2147483646
meshtastic --set charge_current MA550
meshtastic --set is_low_power false

Hope it will make some difference for my fixed node.

is this a T-Beam with the new CH9102F USB chip?

you could try enabling WiFi (with --set wifi_ssid “…” --set wifi_password “…” or softAP) and interfacing through it adding --host tbeam_IP to meshtastic-python.

It’s Lora32 2.1_1.6 with CH9102F chip.
I enabled wifi and now I have no issues connecting to the node.
Thank you for response.

I’ve checked on Lora32 with CP2102 chip on my PC and it’s doing the same thing.
But I want this node to go into sleep, although I’m not able to control it via meshtastic Python app when the node is sleeping.