Connection Issue

Hello!

I’m having issues having my Tidbyt connect to your services (appears to be mqtt.tidbyt.com to be the issue). I do have my own firewall which had some complications, but my firewall logs don’t even register an attempt to that IP (34.111.11.130). I do see communication with connect.tidbyt.com (35.244.159.214) which appears to be no issue.

I placed the Tidbyt it a DMZ and even exposed every port in/out to just see if the connection would establish, still no success. Note that I am able to get the time connection to sync which I saw was another common issue. I’ve tried with my phone on and off the same Wi-Fi network to see if that makes a difference and no change.

Below are my logs:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7780
load:0x40078000,len:14292
load:0x40080400,len:3688
entry 0x40080678
I (26) boot: ESP-IDF 4.3.0 2nd stage bootloader
I (27) boot: compile time 15:24:13
I (27) boot: chip revision: 1
I (29) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (37) boot.esp32: SPI Speed      : 40MHz
I (41) boot.esp32: SPI Mode       : DIO
I (45) boot.esp32: SPI Flash Size : 8MB
I (50) boot: Enabling RNG early entropy source...
I (55) boot: Partition Table:
I (59) boot: ## Label            Usage          Type ST Offset   Length
I (66) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (74) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (81) boot:  2 app0             OTA app          00 10 00010000 003f0000
I (89) boot:  3 app1             OTA app          00 11 00400000 003f0000
I (96) boot: End of partition table
I (100) boot_comm: chip revision: 1, min. application chip revision: 0
I (108) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=5343ch (341052) map
I (245) esp_image: segment 1: paddr=00063464 vaddr=3ffbdb60 size=049c8h ( 18888) load
I (253) esp_image: segment 2: paddr=00067e34 vaddr=40080000 size=081e4h ( 33252) load
I (267) esp_image: segment 3: paddr=00070020 vaddr=400d0020 size=f55ech (1005036) map
I (646) esp_image: segment 4: paddr=00165614 vaddr=400881e4 size=15314h ( 86804) load
I (684) esp_image: segment 5: paddr=0017a930 vaddr=50000000 size=00010h (    16) load
I (700) boot: Loaded app from partition at offset 0x10000
I (700) boot: Disabling RNG early entropy source...
I (711) psram: This chip is ESP32-D0WD
I (712) spiram: Found 64MBit SPI RAM device
I (712) spiram: SPI RAM mode: flash 40m sram 40m
I (717) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (724) cpu_start: Pro cpu up.
I (728) cpu_start: Starting app cpu, entry point is 0x400825c4
I (0) cpu_start: App cpu up.
I (750) cpu_start: Pro cpu start user code
I (750) cpu_start: cpu freq: 160000000
I (750) cpu_start: Application information:
I (754) cpu_start: Project name:     tidbyt
I (759) cpu_start: App version:      7810
I (764) cpu_start: Compile time:     Oct 20 2021 18:37:35
I (770) cpu_start: ELF file SHA256:  59dd427de54d750a...
I (776) cpu_start: ESP-IDF:          4.3.0
I (781) heap_init: Initializing. RAM available for dynamic allocation:
I (788) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (794) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (800) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (806) heap_init: At 3FFC7B50 len 000184B0 (97 KiB): DRAM
I (812) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (819) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (825) heap_init: At 4009D4F8 len 00002B08 (10 KiB): IRAM
I (831) spiram: Adding pool of 4096K of external SPI memory to heap allocator
I (840) spi_flash: detected chip: gd
I (843) spi_flash: flash io: dio
I (849) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (858) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (868) tidbyt: Entering state BOOT (1).
I (868) tidbyt/boot: Initializing high-resolution timers...
I (878) tidbyt/boot: Initialized high-resolution timers.
I (888) gpio: GPIO[15]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (888) tidbyt/boot: Initializing non-volatile storage...
I (938) tidbyt/boot: Initialized non-volatile storage.
I (938) tidbyt/boot: Initializing configuration system...
I (938) tidbyt/boot: Initialized configuration system.
I (948) tidbyt/boot: ESP chip model: 1
I (948) tidbyt/boot: ESP silicon revision: 1 
I (958) tidbyt/boot: ESP flash size: 8388608
I (958) tidbyt/boot: Build environment: tidbyt-v10
I (968) system_api: Base MAC address is not set
I (968) system_api: read default base MAC address from EFUSE
I (978) tidbyt/boot: Bluetooth MAC: 943CC6676A72
I (978) tidbyt/boot: Initializing display...
I (988) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (998) gpio: GPIO[23]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1008) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1018) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1018) gpio: GPIO[22]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1028) gpio: GPIO[27]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1038) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1048) gpio: GPIO[19]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1058) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
*** ESP32-HUB75-MatrixPanel-I2S-DMA: Memory Allocations Complete ***
Total memory that was reserved: 44 kB.
... of which was used for the DMA Linked List(s): 12 kB.
Heap Memory Available: 4359118 bytes total. Largest free block: 2097152 bytes.
General RAM Available: 4348311 bytes total. Largest free block: 2097152 bytes.
I (1108) tidbyt/display_queue: Updating screen duration to 15000ms
I (1108) tidbyt/boot: Initialized display.
I (1108) tidbyt/sprites: Loading sprite 0 from asset (2806 bytes)
E (1118) tidbyt/display_queue: nothing to draw to the display
I (1128) tidbyt/boot: Initializing wifi...
I (1218) tidbyt: free memory - exec: 126816, internal: 134663, DMA: 125799, malloc: 4309707
I (1218) tidbyt: memory low watermark - exec: 126804, internal: 134591, DMA: 125739, malloc: 4269031
I (1308) wifi:wifi driver task: 3ffdea24, prio:23, stack:6656, core=0
I (1318) wifi:wifi firmware version: c7d0450
I (1318) wifi:wifi certification version: v7.0
I (1318) wifi:config NVS flash: enabled
I (1318) wifi:config nano formating: disabled
I (1328) wifi:Init data frame dynamic rx buffer num: 32
I (1328) wifi:Init management frame dynamic rx buffer num: 32
I (1338) wifi:Init management short buffer num: 32
I (1338) wifi:Init static tx buffer num: 16
I (1348) wifi:Init tx cache buffer num: 32
I (1348) wifi:Init static rx buffer size: 1600
I (1358) wifi:Init static rx buffer num: 8
I (1358) wifi:Init dynamic rx buffer num: 32
I (1378) wifi_init: tcpip mbox: 32
I (1378) wifi_init: udp mbox: 6
I (1378) wifi_init: tcp mbox: 6
I (1378) wifi_init: tcp tx win: 5744
I (1378) wifi_init: tcp rx win: 5744
I (1388) wifi_init: tcp mss: 1440
I (1388) wifi_init: WiFi/LWIP prefer SPIRAM
I (1388) wifi_init: WiFi RX IRAM OP enabled
I (1398) tidbyt/boot: Initialized wifi.
I (1398) tidbyt/boot: Initializing Bluetooth...
I (1428) BTDM_INIT: BT controller compile version [1342a48]
I (1438) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1868) tidbyt/boot: Initialized Bluetooth.
I (1868) tidbyt/boot: Initializing I2C...
I (1878) tidbyt/boot: Initialized I2C...
I (2078) tidbyt/boot: ATCA serial: 0123980c172bc77cee
I (3168) tidbyt/boot: ATCA public key: 4c348c4fc9e9a254dffa5db56035c9102578449eddfb7ce6eba125a799088dd9195de394b2382db3819d06076b1de0292eb10e40468227f13e6730705ba8461c
I (3268) tidbyt: Entering state CONNECT (3).
I (3268) tidbyt/ble: Not sending event (2) since no peer connected
I (3278) tidbyt: free memory - exec: 69568, internal: 71051, DMA: 62187, malloc: 4161047
I (3278) tidbyt: memory low watermark - exec: 69436, internal: 70675, DMA: 61823, malloc: 4139675
I (3368) tidbyt: Entering state CONFIGURE (2).
I (3368) tidbyt/ble: Not sending event (1) since no peer connected
I (3368) tidbyt: free memory - exec: 69568, internal: 71051, DMA: 62187, malloc: 4161047
I (3378) wifi:mode : sta (94:3c:c6:67:6a:70)
I (3378) wifi:enable tsf
I (3378) tidbyt: memory low watermark - exec: 69352, internal: 70591, DMA: 61739, malloc: 4139591
I (3388) tidbyt/wifi: SYSTEM_EVENT_STA_START wifi connecting...
I (3378) tidbyt/sprites: Loading sprite 1 from asset (210 bytes)
I (3398) tidbyt/configure: Wait for Bluetooth connection
W (3408) BT_BTM: BTM_BleWriteScanRsp, Partial data write into ADV
I (3428) tidbyt/ble: advertising data set successfully
I (3448) tidbyt/ble: advertising start successfully
I (25758) tidbyt/ble: connected to 52:80:1f:fc:f3:51
I (25758) tidbyt/ble: Sent event: CONFIGURE
I (25778) tidbyt/sprites: Loading sprite 2 from asset (5614 bytes)
I (25778) tidbyt/configure: Waiting for config via Bluetooth
I (33388) tidbyt: free memory - exec: 65356, internal: 66883, DMA: 58019, malloc: 4140059
I (33388) tidbyt: memory low watermark - exec: 65228, internal: 66367, DMA: 57515, malloc: 4117823
I (46938) tidbyt/configure: Received configuration attributes via Bluetooth
I (46988) tidbyt: Entering state CONNECT (3).
I (46988) tidbyt/ble: Sent event: INIT_CONNECT
I (46988) tidbyt: free memory - exec: 64660, internal: 66639, DMA: 57775, malloc: 4140315
I (46998) tidbyt: memory low watermark - exec: 64648, internal: 65787, DMA: 56935, malloc: 4115803
I (46998) tidbyt/connect: Configuring wifi network: REEDLAB Wireless
I (47018) tidbyt/cloud: using device status topic: /devices/unsteadily-prodigious-convenient-monkey-62d/state
I (47018) tidbyt/cloud: using heartbeat topic: /devices/unsteadily-prodigious-convenient-monkey-62d/events/heartbeat
I (47038) tidbyt/crypto: Parsed private key with bit length 256.
I (47038) tidbyt/crypto: Using ECDSA with public key:
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETViR7L1WV4A+Ei2ATEcMPG7BQmMP
+HEcgZz6d23YZtVfX4GM811z4r0xUX5xjzMF6r8l6dFTAUhGbab6GTx4Cg==
-----END PUBLIC KEY-----

I (47068) tidbyt/sprites: Loading sprite 3 from asset (29868 bytes)
I (47078) tidbyt/ble: Sent event: WIFI_CONNECT
I (47088) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
I (47088) wifi:state: init -> auth (b0)
I (47098) wifi:state: auth -> assoc (0)
I (47108) wifi:state: assoc -> run (10)
I (47148) wifi:connected with REEDLAB Wireless, aid = 6, channel 1, BW20, bssid = 60:38:e0:ca:d0:29
I (47148) wifi:security: WPA2-PSK, phy: bgn, rssi: -46
I (47428) wifi:pm start, type: 1

I (47438) wifi:AP's beacon interval = 102400 us, DTIM period = 3
I (47438) tidbyt/wifi: SYSTEM_EVENT_STA_CONNECTED connected...
I (48628) esp_netif_handlers: sta ip: 10.0.2.75, mask: 255.255.255.0, gw: 10.0.2.1
I (48628) tidbyt/wifi: SYSTEM_EVENT_STA_GOT_IP IP assigned...
I (48638) tidbyt/ble: Sent event: SYNC_CLOCK
I (48638) tidbyt/connect: SNTP synchronizing time...
I (48648) tidbyt/connect: Synchronizing clock with time.google.com (backup: pool.ntp.org)
I (59168) tidbyt/connect: SNTP time synchronized
I (59168) tidbyt/ble: Sent event: CLOUD_CONNECT
I (59188) tidbyt/cloud: Downloading connection profile from: https://connect.tidbyt.com
I (70148) tidbyt/cloud: Received connection profile, attempting to parse
I (70148) tidbyt/cloud: Downloading certificate bundle from: https://connect.tidbyt.com/certs/5b54904cd077be047883e0201855d86cf307e33318c02bfc4ca10b90db99605a
I (70688) tidbyt/cloud: Downloaded 49072-byte certificate bundle
I (73928) tidbyt/cloud: Connecting to MQTT at mqtts://mqtt.tidbyt.com:443 with client ID: projects/tidbyt/locations/us-central1/registries/prod/devices/unsteadily-prodigious-convenient-monkey-62d
I (77008) tidbyt: free memory - exec: 38556, internal: 40167, DMA: 31303, malloc: 2415707
I (77008) tidbyt: memory low watermark - exec: 37816, internal: 38955, DMA: 30103, malloc: 2365831
E (77098) tidbyt/connect: switching back to CONFIGURE since a BLE peer is connected
I (77148) tidbyt: Entering state CONFIGURE (2).
I (77148) tidbyt/ble: Sent event: CONFIGURE
I (77158) tidbyt: free memory - exec: 38688, internal: 40407, DMA: 31543, malloc: 2415971
I (77158) wifi:state: run -> init (0)
I (77158) wifi:pm stop, total sleep time: 24862887 us / 29726090 us

I (77158) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
I (77158) tidbyt: memory low watermark - exec: 37816, internal: 38955, DMA: 30103, malloc: 2365831
I (77168) tidbyt/wifi: SYSTEM_EVENT_STA_DISCONNECTED reason code: 8
I (77188) tidbyt/wifi: Unhandled wifi disconnect event 8
I (77168) tidbyt/sprites: Loading sprite 1 from asset (210 bytes)
I (77208) tidbyt/configure: Wait for Bluetooth connection
I (77208) tidbyt/sprites: Loading sprite 2 from asset (5614 bytes)
I (77218) tidbyt/configure: Waiting for config via Bluetooth
I (77218) tidbyt/ble: advertising start successfully
E (87128) esp-tls: couldn't get hostname for :mqtt.tidbyt.com:
E (87128) esp-tls: Failed to open new connection
E (87128) TRANS_SSL: Failed to open a new connection
E (87128) MQTT_CLIENT: Error transport connect
E (87138) tidbyt/cloud: MQTT_EVENT_ERROR
E (87148) tidbyt/cloud: MQTT_EVENT_DISCONNECTED
I (107178) tidbyt: free memory - exec: 54736, internal: 56531, DMA: 47667, malloc: 2481555
I (107178) tidbyt: memory low watermark - exec: 37816, internal: 38955, DMA: 30103, malloc: 2365831
I (137178) tidbyt: free memory - exec: 54916, internal: 56531, DMA: 47667, malloc: 2481363
I (137188) tidbyt: memory low watermark - exec: 37816, internal: 38955, DMA: 30103, malloc: 2365831
I (167188) tidbyt: free memory - exec: 54916, internal: 56531, DMA: 47667, malloc: 2481843
I (167208) tidbyt: memory low watermark - exec: 37816, internal: 38955, DMA: 30103, malloc: 2365831

Looking closely at the log, it looks like the Tidbyt is just about able to connect. However, the connection is slow so it’s taking upward of 30 seconds and the Tidbyt is giving up.

For example, it looks like around 11 seconds are spent synchronizing the clock. This normally takes just a second or so.

Is there any chance you have a Wi-Fi hotspot or another faster network available to use temporarily? If you’re able to get the Tidbyt connected to another network and leave it connected for about 5-10 minutes, it will download a software update that improves the performance.

Thanks. Updated and once the software update happened the issue didn’t persist.

1 Like