[Solved] Cannot build anything using Platformio and Losant Library

#1

Hi,
I followed your instructions to install your library and example code for your door sensor as explained in:

However I cannot proceed with any build because regardless of what I do. It seems that your library is missing the corresponding json file for platformio.

I get a warning when installing the library:

pio lib install 277
Library Storage: /Users/sedim/Documents/NodeMCU/losant-kit-door-sensor/.piolibdeps
LibraryManager: Installing id=277
Downloading…
Unpacking…
Losant @ 1.2.0 has been successfully installed!
Installing dependencies
Looking for Json library in registry
Warning! Library {u'frameworks': [u'arduino'], u'name': u'Json', u'authors': u'Benoit Blanchon'} has not been found in PlatformIO Registry
.
You can ignore this message, if {u'frameworks': [u'arduino'], u'name': u'Json', u'authors': u'Benoit Blanchon'} is a built-in library (inc
luded in framework, SDK). E.g., SPI, Wire, etc.
Looking for PubSubClient library in registry
Found: http://platformio.org/lib/show/89/PubSubClient
LibraryManager: Installing id=89
Downloading…
Unpacking…
PubSubClient @ 2.6 has been successfully installed!

And I get an error when trying to build your example code:
Processing nodemcuv2 (platform: espressif8266, board: nodemcuv2, framework: arduino)

Verbose mode can be enabled via -v, --verbose option
Converting losant-kit-door-sensor.ino
Collected 32 compatible libraries
Looking for dependencies…
Error: Could not find Json dependency for Losant library


I also tried deinstalling and re-installing the library(s) in the Global directory but to no avail.
Please note:
I have no problem building many .cpp and .ino projects using platformio with many other libraries installed without any problems.

Thank you for your help in this matter. I look forward to using Losant.

0 Likes

#2

Partially Solved:
The manifest for the library “Losant” in (library.json) provided through platformio has a dependency on “ArduinoJson”. However, it refers to the library “Json” which does not exist. So (“name”: “Json”) should be ( “name”: “ArduinoJson”):

{
  "name": "Losant",
  "keywords": "communication, wifi, wi-fi, http, iot",
  "description": "Arduino MQTT client for connecting embedded devices to the Losant IoT developer platform",
  "repository":
  {
    "type": "git",
    "url": "https://github.com/Losant/losant-mqtt-arduino.git"
  },
  "version": "1.2.0",
  "dependencies":
  [
    {
      "name": "Json",
      "authors": "Benoit Blanchon",
      "frameworks": "arduino"
    },
    {
      "name": "PubSubClient",
      "frameworks": "arduino"
    }
  ],
  "frameworks": "arduino",
  "platforms": "*"
}

Please note: I manually changed it in my global library but I did not change it in GitHub. I am new to this environment so I am not absolutely sure that I should change it.

0 Likes

#3

Thanks for the report and followup! Our library and kits were all written and tested with the Arduino IDE. We’ve experimented a bit with PlatformIO. We’ll dig in and make sure everything works properly.

0 Likes

#4

We’ve updated the Losant library to reference the correct dependency. The update is now live in the PlatformIO package manager. Thanks!

0 Likes