Can't connect to mdash


Hi All…

I have gone through the demos and had no trouble connecting to mDash with my esp32 board. I have now written a simple C app but I have been unable to get mDash to see my device. However the logsseem to show success:

[Oct  3 11:18:05.232] mgos_deps_init.c:106    init dash...
[Oct  3 11:18:05.238] mg_rpc.c:539            0x3ffc1b34 'wss://' WSS_out
[Oct  3 11:18:05.244] mgos_dash.c:203         Dash init ok, server: wss://

In the mos tool I entered:

mos config-set dash.enable=true dash.token=redacted

The dashboard just reports “never connected” for the device. I am using a free account so only 3 devices, and I have created and deleted more than that. Currently I have only one device, but could the problem be that I created too many?


After the lines

11:18:05.232] mgos_deps_init.c:106    init dash...
[Oct  3 11:18:05.238] mg_rpc.c:539            0x3ffc1b34 'wss://' WSS_out
[Oct  3 11:18:05.244] mgos_dash.c:203         Dash init ok, server: wss://

you should see something like this

[Oct  3 20:19:29.546] mgos_net.c:89           WiFi STA: connected
[Oct  3 20:19:29.576] mgos_rpc_channel_ws:261 0x3ffc76bc Connecting to wss://, SSL? 1
[Oct  3 20:19:29.714] mg_ssl_if_mbedtls.c:35  0x3ffc80d8 ciphersuite: TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
[Oct  3 20:19:30.218] SW ECDH curve 3
[Oct  3 20:19:31.532] mg_rpc.c:293            Sys.GetInfo via WSS_out

The line numbers in my log are for mos latest. If you are using a different version, they might be different.

Tested with the empty application with the following libs:

  - origin:
  - origin:
  - origin:
  - origin:
  - origin:
  - origin:
  - origin:
  - origin:
  - origin:

  - origin:

Thanks very much…

I didn’t have all those libraries, but I added them, in the same order, still no joy. I don’t see those log entries, rather I see:

[Oct  3 14:46:40.890] mgos_deps_init.c:122    init i2c...
[Oct  3 14:46:40.890] mgos_deps_init.c:122    init atca...
[Oct  3 14:46:40.896] mgos_deps_init.c:122    init ota-http-client...
[Oct  3 14:46:40.902] mgos_deps_init.c:122    init shadow...
[Oct  3 14:46:40.902] mgos_deps_init.c:122    init ota-shadow...
[Oct  3 14:46:40.907] mgos_ota_shadow_lib:102 OTA over shadow initialised
[Oct  3 14:46:40.913] mgos_deps_init.c:122    init wifi...
[Oct  3 14:46:40.913] mgos_wifi.c:458         WiFi mode: AP
[Oct  3 14:46:40.919] esp32_wifi.c:231        cur mode: 0
[Oct  3 14:46:40.926] esp32_wifi.c:196        WiFi mode: AP

Which makes me thing my wifi config is setting the wifi up as an access point instead of a client, and therefore not talking to the cloud. On my phone, I see it listed as an AP. Can it be both an AP and client simultaneously?

From searching, I can’t figure out how to configure it as a station vs an AP.


I think I figured that out:

mos config-set wifi.sta.enable=true wifi.sta.ssid='Jim LAN' wifi.sta.pass=password

Gives me:

[Oct  3 15:11:00.997] mgos_wifi.c:136         WiFi STA: Connected, BSSID 44:94:fc:61:24:f0 ch 1 RSSI -47
[Oct  3 15:11:01.004] mgos_event.c:135        ev WFI2 triggered 0 handlers
[Oct  3 15:11:01.009] mgos_net.c:89           WiFi STA: connected
[Oct  3 15:11:01.017] mgos_event.c:135        ev NET2 triggered 2 handlers
[Oct  3 15:11:02.233] e[0;32mI (3958) event: sta ip:, mask:, gw:[0m
[Oct  3 15:11:02.240] mgos_event.c:135        ev WFI3 triggered 0 handlers
[Oct  3 15:11:02.248] mgos_net.c:101          WiFi STA: ready, IP, GW, DNS
[Oct  3 15:11:02.252] mgos_sntp.c:127         SNTP next query in 1017 ms
[Oct  3 15:11:02.258] mgos_event.c:135        ev NET3 triggered 2 handlers
[Oct  3 15:11:03.277] mg_net.c:928            0x3ffbae44 udp:// -,-,-
[Oct  3 15:11:03.283] mg_net.c:928            0x3ffbaf80 udp:// -,-,-
[Oct  3 15:11:03.289] mg_net.c:796            0x3ffbaf80 udp://
[Oct  3 15:11:03.289] mgos_sntp.c:95          SNTP query to
[Oct  3 15:11:03.295] mgos_sntp.c:127         SNTP next query in 2042 ms
[Oct  3 15:11:03.302] mg_net.c:811            0x3ffbaf80 udp:// -> 0
[Oct  3 15:11:03.319] mg_net.c:796            0x3ffbae44 udp://
[Oct  3 15:11:03.319] mg_net.c:811            0x3ffbae44 udp:// -> 0
[Oct  3 15:11:03.325] mgos_sntp.c:48          SNTP sent query to
[Oct  3 15:11:03.383] mgos_sntp.c:59          SNTP reply from time 1570129863.770411, local 54.407325, delta 1570129809.363086
[Oct  3 15:11:03.389] mgos_event.c:135        ev MOS3 triggered 2 handlers
[Oct  3 15:11:03.395] mgos_sntp.c:78          SNTP close

Still no connection to mDash though…


Fixed it! Once I got wifi in station mode I was able to run the command to connect to mDash:

mos config-set dash.enable=true dash.token=redacted

Thanks for your help!


But… where are all these configuration settings saved? I looked around the folders for this test app and couldn’t find it.


The configuration settings are saved in conf9.json on the device.