Connect ESP32 to mDash

I can’t connect ESP32 to mDash using demo-js. Did everything according to the instructions several times.

Did follow Connect Mongoose OS to mDash?
It misses

mos config-set dash.enable=true

No he shouldn’t have. But I understand that when you add a device to mDash (#8 https://mongoose-os.com/docs/mongoose-os/quickstart/setup.md) it should not be used.

Step #8 also specifies to set dash.enable=true.
Follow the steps from the link I posted earlier and add mos config-set dash.enable=true and it will connect to mdash.net.

Already tried, didn’t help.

mos wifi SSID PASSWORD
mos config-set mqtt.server=mdash.net:8883 mqtt.ssl_ca_cert=ca.pem
mos config-set mqtt.enable=true device.id=ID mqtt.user=ID mqtt.pass=TOKEN dash.enable=true

works for me.

1 Like

Do I need a certificate? if so could you be kindly to teach me how? thank you

I have the same problem, I can connect to mdash but crash when I want to save data to the cloud

this is my program

// Load Mongoose OS API
load('api_timer.js');
load('api_dht.js');
load('api_dash.js');

// GPIO pin which has a DHT sensor data wire connected
let pin = 27;

// Initialize DHT library
let dht = DHT.create(pin, DHT.DHT22);

// This function reads data from the DHT sensor every 2 second
Timer.set(2000 /* milliseconds */, Timer.REPEAT, function() {
  let t = dht.getTemp();
  let h = dht.getHumidity();

  if (isNaN(h) || isNaN(t)) {
    print('Failed to read data from sensor');
    return;
    }

    print('Temperature:', t, '*C');
    print('Humidity:', h, '%');
  
        if (Dash.isConnected()) {

            print('conectado');
            Dash.notify('DB.Save', { temperature: 12.34 });
        }
}, null);

There is a bug in rpc-common which causes the core dump when calling Dash.notify (actually mgos_dash_notify).
I’ve created a PR. Let’s wait to be integrated.

The fix has been integrated. You can test now using mos latest.