Similar to this, but for T-Beam, device firmware v1.2.30.80e4bc6.bin, Python API 1.2.35. (Based off of that, it sounds like this functionality is supposed to work.)
After enabling Wi-Fi STA mode, I’m able to see the device connect to the AP, and I’m even able to access HTTP – only to get a “not yet supported - soon will be included in build” message. Bummer.
So I tried this: meshtastic --host 192.168.29.58 --sendtext hello
and meshtastic --host 192.168.29.58 --info
, only to get this:
Traceback (most recent call last):
File "/usr/local/bin/meshtastic", line 8, 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 506, in common
args.host, debugOut=logfile, noProto=args.noproto)
File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 960, in __init__
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 771, in __init__
self.connect()
File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 793, in connect
self._waitConnected()
File "/usr/local/lib/python3.7/dist-packages/meshtastic/__init__.py", line 422, in _waitConnected
raise Exception("Timed out waiting for connection completion")
Exception: Timed out waiting for connection completion
… Shucks. The serial log hints that the device disconnected from the AP:
??:??:?? 0 booted, wake cause 0 (boot count 1), reset_reason=reset ??:??:?? 0 Filesystem files: ??:??:?? 0 /static/index.html ??:??:?? 0 /prefs/db.proto ??:??:?? 0 /prefs/radio.proto ??:??:?? 0 /prefs/channels.proto ??:??:?? 0 I2C device found at address 0x34 ??:??:?? 0 axp192 PMU found ??:??:?? 0 done ??:??:?? 0 Meshtastic hwvendor=4, swver=1.2.30.80e4bc6, hwver=1.0 ??:??:?? 0 Setting random seed 1570534425 ??:??:?? 0 Total heap: 254884 ??:??:?? 0 Free heap: 220280 ??:??:?? 0 Total PSRAM: 4194252 ??:??:?? 0 Free PSRAM: 4194252 ??:??:?? 0 NVS: UsedEntries 257, FreeEntries 373, AllEntries 630 ??:??:?? 0 Setup Preferences in Flash Storage ??:??:?? 0 Number of Device Reboots: 83 ??:??:?? 0 Initial packet id 1642127983, numPacketId 4294967295 ??:??:?? 0 Setting default channel and radio preferences! ??:??:?? 0 Expanding short PSK #1 ??:??:?? 0 Wanted region 0, using Unset ??:??:?? 0 Loading /prefs/db.proto ??:??:?? 0 Loaded saved preferences version 11 ??:??:?? 0 Loading /prefs/radio.proto ??:??:?? 0 Loading /prefs/channels.proto ??:??:?? 0 Number of Device Reboots: 83 ??:??:?? 0 Expanding short PSK #1 ??:??:?? 0 Wanted region 1, using US
??:??:?? 0 region=1, NODENUM=0xwwxxyyzz, dbsize=1
chip id detect 0x3
Detect CHIP :AXP192
OUTPUT Register 0x5f
??:??:?? 0 AXP192 Begin PASS
??:??:?? 0 DCDC1: ENABLE
??:??:?? 0 DCDC2: ENABLE
??:??:?? 0 LDO2: ENABLE
??:??:?? 0 LDO3: ENABLE
??:??:?? 0 DCDC3: ENABLE
??:??:?? 0 Exten: ENABLE
??:??:?? 0 ----------------------------------------
??:??:?? 0 DCDC1: ENABLE
??:??:?? 0 DCDC2: ENABLE
??:??:?? 0 LDO2: ENABLE
??:??:?? 0 LDO3: ENABLE
??:??:?? 0 DCDC3: ENABLE
??:??:?? 0 Exten: ENABLE
SRC REG:0xc4
Charging enable is enable
Charging target-voltage : 0x2
end when the charge current is lower than 10% of the set value
Charge current : 700.00 mA
??:??:?? 0 Battery: usbPower=1, isCharging=0, batMv=0, batPct=0
??:??:?? 0 Read RTC time as 0 (cur millis 241) quality=0
??:??:?? 0 WANT GPS=1
??:??:?? 0 Setting GPS power=1
??:??:?? 1 Connected to UBLOX GPS successfully
??:??:?? 2 External Notification Plugin Disabled
??:??:?? 2 Starting meshradio init...
??:??:?? 2 (bw=125, sf=12, cr=4/8) packet symLen=32 ms, payloadSize=16, time 2269 ms
??:??:?? 2 Set radio: name=LongSlow, config=3, ch=0, power=0
??:??:?? 2 Radio myRegion->freq: 903.080017
??:??:?? 2 Radio myRegion->spacing: 2.160000
??:??:?? 2 Radio myRegion->numChannels: 13
??:??:?? 2 Radio channel_num: 0
??:??:?? 2 Radio frequency: 903.080017
??:??:?? 2 Short packet time: 2269 msec
??:??:?? 2 Set radio: final power level=17
??:??:?? 2 RF95 init result 0
??:??:?? 2 RF95 Radio init succeeded, using RF95 radio
??:??:?? 2 Waiting for SSL Cert to be generated.
??:??:?? 2 .SSL Cert Ready!
Meshtastic-xxyy
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 2 - STA_START
??:??:?? 3 JOINING WIFI: ssid=example_ssid
??:??:?? 3 Started Joining WIFI
??:??:?? 3 mDNS responder started
??:??:?? 3 mDNS Host: Meshtastic.local
??:??:?? 3 PowerFSM init, USB power=1
[D][esp32-hal-cpu.c:189] setCpuFrequencyMhz(): PLL: 320 / 4 = 80 Mhz, APB: 80000000 Hz
??:??:?? 3 [Power] Battery: usbPower=1, isCharging=0, batMv=0, batPct=0
??:??:?? 3 [GPS] publishing GPS lock=0
??:??:?? 3 [GPS] No GPS lock [742/1812]??:??:?? 3 [GPS] got gps notify time=0, lat=0, bat=0
??:??:?? 3 [GPS] DB update position node=0xwwxxyyzz time=0, latI=0, lonI=0
??:??:?? 3 [GPS] Node status update: 1 online, 1 total
??:??:?? 3 [SerialPlugin] Serial Plugin Disabled
??:??:?? 4 [StoreForwardPlugin] Store & Forward Plugin - Disabled
??:??:?? 4 [RangeTestPlugin] Range Test Plugin - Disabled
??:??:?? 5 [GPS] publishing GPS lock=0
??:??:?? 5 [GPS] No GPS lock
??:??:?? 5 [GPS] got gps notify time=0, lat=0, bat=0
??:??:?? 5 [GPS] DB update position node=0xwwxxyyzz time=0, latI=0, lonI=0
??:??:?? 5 [GPS] Node status update: 1 online, 1 total
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 4 - STA_CONNECTED
??:??:?? 5 ************ [WiFi-event] event: 4 ************
??:??:?? 5 Connected to access point
00:00:05 5 [GPS] Upgrading time to RTC 1621900547 secs (quality 2)
23:55:47 5 [GPS] Read RTC time as 1621900547 (cur millis 5510) quality=2
23:55:47 5 [GPS] publishing GPS lock=0
23:55:47 5 [GPS] got gps notify time=1621900547, lat=0, bat=0
23:55:47 5 [GPS] DB update position node=0xwwxxyyzz time=1621900547, latI=0, lonI=0
23:55:47 5 [GPS] Node status update: 1 online, 1 total
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:418] _eventCallback(): STA IP: 192.168.29.58, MASK: 255.255.255.0, GW: 192.168.29.1
23:55:47 5 ************ [WiFi-event] event: 7 ************
23:55:47 5 Obtained IP address:
192.168.29.58
23:55:47 5 ... Starting network services
23:55:47 5 Initializing Web Server ...
23:55:47 5 Checking if we have a previously saved SSL Certificate.
23:55:47 5 Retrieved Private Key: 1190 Bytes
23:55:47 5 Retrieved Certificate: 780 Bytes
23:55:47 5 Starting Web Servers...
23:55:47 5 HTTP and HTTPS Web Servers Ready! :-)
23:55:47 5 API server listening on TCP port 4403
23:55:48 6 [ApiServer] Incoming wifi connection
Transition powerFSM transition=boot timeout, from=BOOT to=POWER
23:55:48 6 [PowerFSM] Setting bluetooth enable=1
Pre BT: 143524 heap size
23:55:48 6 [PowerFSM] Starting bluetooth
23:55:48 7 [WebServerThread] BLE task running
23:55:48 7 registered service 0x1800 with handle=1
23:55:48 7 registered service 0x1801 with handle=6
23:55:48 7 registered service 6ba1b218-15a8-461f-9fa8-5dcae273eafd with handle=10
23:55:48 7 [WebServerThread] registered service cb0b9a0b-a84c-4c0d-bdbb-442e3144ee30 with handle=18
len 7
len 7
len 7
len 7
len 7
len 7
len 7
len 7
23:55:49 7 [StreamAPI] Client wants config, nonce=2433569836
Transition powerFSM transition=serial API, from=POWER to=SERIAL
23:55:49 7 [StreamAPI] Setting bluetooth enable=0
23:55:49 7 [StreamAPI] BLE advertisting type=0, Private=0, Device Address: xx:yy:zz:xx:yy:zz
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 3 - STA_STOP
23:55:49 7 [StreamAPI] ************ [WiFi-event] event: 3 ************
23:55:49 7 [StreamAPI] WiFi clients stopped
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 3 - STA_STOP
23:55:49 7 [StreamAPI] ************ [WiFi-event] event: 3 ************
23:55:49 7 [StreamAPI] WiFi clients stopped
23:55:49 7 [StreamAPI] WiFi Turned Off
23:55:49 7 [StreamAPI] advertise complete; reason=29error enabling advertisement; rc=30
23:55:49 7 [StreamAPI] Done shutting down bluetooth
Shutdown BT: 158080 heap size
23:55:49 7 [StreamAPI] Starting API client config
23:55:49 7 [StreamAPI] getFromRadio, state=2
[E][WiFiClient.cpp:392] write(): fail on fd 57, errno: 113, "Software caused connection abort"
23:55:49 7 [StreamAPI] getFromRadio, state=3
23:55:49 7 [StreamAPI] Sending nodeinfo: num=0xwwzzxxyy, lastseen=1621900549, id=!wwzzxxyy, name=Yell
23:55:49 7 [StreamAPI] getFromRadio, state=3
23:55:49 7 [StreamAPI] Done sending nodeinfos
23:55:49 7 [StreamAPI] getFromRadio, state=4
23:55:49 7 [StreamAPI] Lost phone connection
Transition powerFSM transition=serial disconnect, from=SERIAL to=ON
23:55:49 7 [StreamAPI] Setting bluetooth enable=1
Pre BT: 159688 heap size
23:55:49 7 [StreamAPI] Starting bluetooth
23:55:49 7 [StreamAPI] Checking if we have a previously saved SSL Certificate.
23:55:49 7 [StreamAPI] Existing SSL Certificate found!
23:55:49 7 [StreamAPI] Waiting for SSL Cert to be generated.
23:55:49 7 [StreamAPI] SSL Cert Ready!
Meshtastic-xxyy
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 0 - WIFI_READY
23:55:49 7 [StreamAPI] ************ [WiFi-event] event: 0 ************
23:55:49 7 [StreamAPI] WiFi interface ready
23:55:49 8 [StreamAPI] BLE task running
23:55:49 8 [StreamAPI] registered service 0x1800 with handle=1
23:55:49 8 [StreamAPI] registered service 0x1801 with handle=6
23:55:49 8 [StreamAPI] registered service 6ba1b218-15a8-461f-9fa8-5dcae273eafd with handle=10
23:55:49 8 [StreamAPI] registered service cb0b9a0b-a84c-4c0d-bdbb-442e3144ee30 with handle=18
23:55:49 8 [StreamAPI] JOINING WIFI: ssid=example_ssid
23:55:49 8 [StreamAPI] Started Joining WIFI
23:55:49 8 [StreamAPI] mDNS responder started
23:55:49 8 [StreamAPI] mDNS Host: Meshtastic.[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 2 - STA_START
local
[E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.
[E][ESPmDNS.cpp:148] addService(): Failed adding service https.tcp.
Transition powerFSM transition=power connect, from=ON to=POWER
23:55:49 8 [StreamAPI] Client dropped connection, suspending API service
The first few messages of timestamp 23:55:49 indicate that the TCP/IP connection via the Python client was received ("23:55:49 7 [StreamAPI] Client wants config, nonce=2433569836
"), but shortly thereafter, the STA connection gets dropped – only to be re-established shortly after.
Am I missing something here, or is this a bug?