# ESP8266 and arduinoJson 6 - Not going well

**URL:** <https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658>\
**Category:** Help\
**Tags:** mqtt, device\
**Created:** [February 19, 2020, 11:31am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658 "2020-02-19T11:31:08Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [February 19, 2020, 11:31am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/1 "2020-02-19T11:31:08Z")

</div>

Hello

I am trying to build a new device based on ESP8266 and an example from [https://www.losant.com/blog/getting-started-with-the-esp8266-and-dht22-sensor](https://www.losant.com/blog/getting-started-with-the-esp8266-and-dht22-sensor).

1. My device does not succeed to connect to Losant (I have made plenty of devices in the past that did, I generated and used the ID, access key & secret - twice.)
2. The ArduinoJson library has updated since someone wrote this example and lots of stuff did not compile - I had to modify quite a bit just for that.  
tried solutions in:  
[Unable to connect Losant Plattform using ESP8266 module](https://forums.losant.com/t/unable-to-connect-losant-plattform-using-esp8266-module/1264)  
no change.

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/a/a59131021de7f1cd5e48ac42e9b966ce41abe7fe.png)

Can anyone help please?

Thanks

Uri

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 19, 2020, 3:08pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/2 "2020-02-19T15:08:13Z")

</div>

Hi @Uri_Bear,

A similar question was asked on another forum post, you can find the response [here](https://forums.losant.com/t/issue-connecting-to-losant/2573/9). Please let me know if you have any further questions 😄

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [February 19, 2020, 3:49pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/3 "2020-02-19T15:49:50Z")

</div>

Thanks, I already did this…  
but for the second part: my ESP is trying to connect to the Losant cloud and failing… any thoughts there?

Uri

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 19, 2020, 5:23pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/5 "2020-02-19T17:23:16Z")

</div>

Hi @Uri_Bear,

Great, glad to hear you’ve tried the suggested resolution steps! One of our engineers is currently testing this on similar hardware and was able to replicate a similar issue, I will reach out with any results as soon as possible. In the meantime, don’t hesitate to reach out if you run into any further questions.

Thanks,  
Julia

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [February 19, 2020, 7:33pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/6 "2020-02-19T19:33:39Z")

</div>

Thanks. I am glad its not just me! waiting for your input!  
Uri

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 19, 2020, 8:21pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/7 "2020-02-19T20:21:32Z")

</div>

Hi @Uri_Bear,

A quick update that we are attempting to isolate the issue at the moment, I will follow up as soon as I learn more.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 20, 2020, 8:35pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/9 "2020-02-20T20:35:10Z")

</div>

Hi @Uri_Bear,

I just got an update on this, and it seems a bit of trial and error may be involved; these devices can be a bit pesky at times! One of our engineers was operating on a similar device and the following details replicate his process to connecting this device.

Stable library versions for the device:

- ArduinoJson - 5.13.5, updating to 6 requires changes to the Losant library, which are currently in progress
- ESP8266Wifi - 2.4.2, after this version you cannot connect securely, `connectSecure()`
- PubSubClient - 2.6 is fine, 2.7 is an improvement but you will need to set MQTT\_MAX\_PACKET\_SIZE to 256 in the header file

With the correct versions of these libraries, you would then need to reset the device and the Arduino IDE. To do this, you’ll first unplug the device. Next, quit and restart the Arduino IDE. Once the IDE has restarted, plug in your device again to power it on. The test device was able to successfully connect after following these steps, but I am very interested to hear your results.

Keep in mind, the engineering team is working at the moment to fix our libraries and make this more seamless, so I will follow up when those updates are released. In the meantime, we want to get you successfully connected and are eagerly looking forward to your results.

Please let me know if you have any further questions.

Thanks so much!  
Julia

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [February 22, 2020, 7:48am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/10 "2020-02-22T07:48:33Z")

</div>

Many thanks Julia and the Losant team!  
I am currently out of the office and do not have access to my device.

I will update you soon.

Thanks again

Uri

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [February 24, 2020, 6:32am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/12 "2020-02-24T06:32:42Z")

</div>

Hi  
I cannot find how to change the version of ESP8266Wifi. all others are per your recommendation.

Uri

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 24, 2020, 2:45pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/13 "2020-02-24T14:45:58Z")

</div>

Hi @Uri_Bear,

I might recommend holding off on this for the moment. There is currently a pull request open to update the Losant library, [you can find it here in Github](https://github.com/Losant/losant-mqtt-arduino/pull/15), which will comparatively require little configuration.

I will update you when this has been merged.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [February 24, 2020, 7:48pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/14 "2020-02-24T19:48:18Z")

</div>

Thanks.  
What versions of the other libraries work with this one? latest?

Uri

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [March 2, 2020, 7:46pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/17 "2020-03-02T19:46:51Z")

</div>

Hi  
Any update on this subject?

Thanks

Uri

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [March 3, 2020, 8:00pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/18 "2020-03-03T20:00:56Z")

</div>

Hi @Uri_Bear,

The engineer team has successfully merged and updated [the Losant library](https://github.com/Losant/losant-mqtt-arduino) to support ArduinoJson 6. You can also find an updated ESP8266 example [here](https://github.com/Losant/losant-mqtt-arduino/blob/master/examples/esp8266/esp8266.ino). Thank you so much for your patience, and please let me know if you run into any issues or if I can answer any further questions!

Have a great day,  
Julia

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [March 4, 2020, 8:21am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/20 "2020-03-04T08:21:01Z")

</div>

Thank you Julia & Team.  
Which MQTT.h / library should I use? Currently failing on this.

Can you please list ALL needed installs/libs?

Thanks

Uri

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [March 4, 2020, 4:26pm UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/26 "2020-03-04T16:26:00Z")

</div>

Hi @Uri_Bear,

A list of dependencies can be found within the ReadMe for the Losant MQTT Client library, found [here](https://github.com/Losant/losant-mqtt-arduino#dependencies). Please let me know if you have further questions!

Thanks,  
Julia

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [March 9, 2020, 10:26am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/28 "2020-03-09T10:26:02Z")

</div>

It’s working again, Thanks a million!  
Uri

---

<div class="post-metadata">

**Author:** ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)\
**Post date:** [April 17, 2020, 9:42am UTC](https://forums.losant.com/t/esp8266-and-arduinojson-6-not-going-well/2658/31 "2020-04-17T09:42:06Z")

</div>

Hi Julia!  
Thanks a lot to you and your team for helping me out on the ESP8266! Hurray to all!

I have now started dabbing into LoRa and the ESP32, specifically the TTGO LORA ESP32 with display board

[https://www.tindie.com/products/ttgo/lilygor-ttgo-lora-v13/](https://www.tindie.com/products/ttgo/lilygor-ttgo-lora-v13/)  
[https://github.com/LilyGO/TTGO-LORA32/tree/LilyGO-V1.3-868](https://github.com/LilyGO/TTGO-LORA32/tree/LilyGO-V1.3-868)

I followed the ESP32 coding, some (A little old) from Losant at:

[https://www.losant.com/blog/connecting-the-esp32-to-the-internet-with-arduino-and-losant](https://www.losant.com/blog/connecting-the-esp32-to-the-internet-with-arduino-and-losant)  
[https://www.losant.com/blog/getting-started-with-esp32-and-platformio](https://www.losant.com/blog/getting-started-with-esp32-and-platformio)

I tried compiling the latest example you sent me, and am failing compilation on

BearSSL::WiFiClientSecure wifiClient;

What is Bear SSL and this double column notation? Can your engineers help me connect to Losant once again?

Many thanks

Uri
