Page 1 of 1

Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Wed Dec 06, 2017 10:35 pm
by Stuart
Hi Guru,

I purchased starter kids espresso lite v2. I am unable to display Temperature and Humidity reading from Message box as shown on the tutorial given. I tried most of the tutorials and it works fine but MQTT failed. My OLED displayed Espert-1271940 and I used this ID as my Board ID Espert/1271940/# over tutorial given in http://learn.espressolite.com/example-sketches

I had tried the following tutorial:
0110 ButtonToPushMessage - success / Ok

0130 MQTT-Button - Failed / not Ok

0140 MQTT-DHT - Failed / not Ok

0150 MQTT-LED - Failed / not Ok

I really wish anyone who could help me to solve rectify what is going wrong? I am numb now....

Thanks a lot...

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Thu Dec 07, 2017 10:25 am
by bengchet
Hi,

A few pictures will be help in troubleshooting (screenshot on MQTT websocket panel, OLED led, arduino serial monitor).

Just to make sure your topic is in correct spelling, should be ESPert/1271940/#, not Espert/1271940/#.

To double confirm, you can verify it with Arduino sketch.

For example _0130_MQTT_Button sketch, look for the line:

CODE: SELECT_ALL_CODE
String outTopic = "ESPert/" + String(espert.info.getChipId()) + "/Button";


espert.info.getChipId() is your board ID , in your case it is 1271940. In MQTT websocket panel, if you subscribe ESPert/1271940/#, you get the message related to any topics which starts with ESPert/1271940/.

Hope it helps!

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Thu Dec 07, 2017 8:04 pm
by Stuart
Hello BengChet,

Thank you so much for your helpful heart. Very very happy seeing someone replied.

Here are the screenshot on MQTT websocket panel, OLED led, arduino serial monitor attached.

I tried many times but still cannot. Really dont know what went wrong. I tested the temperature and humidity on other examples tutorial no problem and ok. I tried in my home and office also cannot and I did not block any services from both of my home and office routers.

:( :?

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Fri Dec 08, 2017 7:03 am
by bengchet
Hi,

From the Arduino serial monitor, seems like your espresso lite cannot connect to MQTT server, this explains whole thing can't work.

To verify this, you can change another SSID and password for your espresso lite (example your phone wifi hotspot) and test how it goes. If espresso lite is successfully connected to MQTT server, the serial monitor should shows something like "MQTT: connected" or "OutTopic:...", else it means fail to connect to MQTT server.

You can change SSID and password using smartconfig or AP mode, follow the guide here. Before you do so, make sure you have added this line to your sketch.

CODE: SELECT_ALL_CODE
void loop() {
  espert.loop(); <-- make sure you add this line

  if (espert.mqtt.connect()) {
    espert.println("MQTT: Connected");
    espert.println("MQTT: Out Topic " + outTopic);
  }

...


This allows you to press USER button (GPIO13) long time to switch to smartconfig mode or AP mode.

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Sun Dec 10, 2017 11:58 am
by Stuart
Hi,

I am still not able to connect to MQTT Server after all possible modification here and there. But I tested over Thingspeak, it works fine. I cant get it to work on mqtt.espert.io and don't really know what happen.

Thanks and best regards,

Stuart

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Mon Dec 11, 2017 10:22 am
by bengchet
Hi,

I have tested with mqtt.espert.io and I can't connect too. You can try another mqtt server like broker.hivemq.com or other mqtt server. You only need to make some modifications.

In example sketch, modify this line.
CODE: SELECT_ALL_CODE
const char* mqtt_server = "broker.hivemq.com";


In mqtt websocket panel, just change Host to broker.hivemq.com then connect.

Hope it helps.

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Sun Dec 17, 2017 8:21 pm
by Stuart
Hi,

Thanks a lot for your advise and help. I finally got it to work.

I tried to enable authentication username and password from the MQTT local server but I failed to login because I didnt manage to find any coding login thru my wireless device. Any clue....? :roll:


Thanks and best regards,

stuart

Re: Espert Espresso Lite V2.0 MQTT Issues - Need Help

PostPosted: Mon Dec 18, 2017 2:21 pm
by bengchet
Hi,

If you are using open source MQTT servers like broker.hivemq.com, authentication is not provided.

If you wish for MQTT services which is more secure, you will need to find third party service which provides MQTT with authentication. Usually you will need to create an account (may be there is some billing plan), the information of MQTT such as host, port, username and password will be provided.