Webthing-arduino won't install in PlatformIO

Two years after promising myself to start working with Arduino, I’m finally doing it with the intent of blogging about working with an ESP32. However, I cannot get webthing-arduino to install in PlatformIO. The actual error is at the end of this message.

I see that the PlatformIO webthing-arduino is version 0.9.0 while for the ArduinoIDE it is version 0.11.5. Is the PlatformIO library broken due to senescence?

The error message:

PIO Core Call Error: "Library Storage: /home/lars/project/platformio/temperature_thing/.pio/libdeps/featheresp32\nLibraryManager: Installing id=5397 @ ^0.9.0\nUsing cache: /home/lars/.platformio/.cache/ad/fe8723da6bb1099b82c6f3dbbdaf80ad\n\n\nError: Traceback (most recent call last):\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/managers/package.py\", line 540, in _install_from_tmp_dir\n ), mismatch_error\nAssertionError: Package version 0.4.1 doesn't satisfy requirements ^0.9.0\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/__main__.py\", line 109, in main\n cli() # pylint: disable=no-value-for-parameter\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py\", line 829, in __call__\n return self.main(*args, **kwargs)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py\", line 782, in main\n rv = self.invoke(ctx)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/commands/__init__.py\", line 44, in invoke\n return super(PlatformioCLI, self).invoke(ctx)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py\", line 1259, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py\", line 1259, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py\", line 1066, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py\", line 610, in invoke\n return callback(*args, **kwargs)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/click/decorators.py\", line 21, in new_func\n return f(get_current_context(), *args, **kwargs)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/commands/lib.py\", line 155, in lib_install\n library, silent=silent, interactive=interactive, force=force\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/managers/lib.py\", line 281, in install\n force=force,\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/managers/package.py\", line 704, in install\n pkg_dir = self._install_from_piorepo(name, requirements)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/managers/lib.py\", line 131, in _install_from_piorepo\n requirements,\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/managers/package.py\", line 499, in _install_from_url\n return self._install_from_tmp_dir(_tmp_dir, requirements)\n File \"/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/managers/package.py\", line 542, in _install_from_tmp_dir\n assert tmp_manifest[\"version\"] == requirements, mismatch_error\nAssertionError: Package version 0.4.1 doesn't satisfy requirements ^0.9.0\n\n============================================================\n\nAn unexpected error occurred. Further steps:\n\n* Verify that you have the latest version of PlatformIO using\n `pip install -U platformio` command\n\n* Try to find answer in FAQ Troubleshooting section\n https://docs.platformio.org/page/faq.html\n\n* Report this problem to the developers\n https://github.com/platformio/platformio-core/issues\n```

Hmm, my PlatformIO disagrees. Maybe yours is out of date, or has some things cached?

$ platformio --version
PlatformIO, version 4.4.0a4

$ platformio lib show webthing-arduino
Looking for webthing-arduino library in registry
Found: https://platformio.org/lib/show/5397/webthing-arduino
webthing-arduino
================
#ID: 5397
A library for creating Web Things using the Web of Things API. Runs on ESP8266, ESP32, Ethernet, and WiFi101-compatible boards. Compatible with the Mozilla WebThings Gateway.

Version: 0.11.5, released Mon Jun  1 20:42:33 2020
Manifest: https://raw.githubusercontent.com/mozilla-iot/webthing-arduino/master/library.properties
Repository: https://github.com/mozilla-iot/webthing-arduino.git

Authors
-------
Mozilla IoT <iot@mozilla.com>
James Hobin <hobinjk@gmail.com> (maintainer)

Keywords
--------
communication

Compatible frameworks
---------------------
Arduino

Compatible platforms
--------------------
Infineon XMC
Kendryte K210
GigaDevice GD32V
ASR Microelectronics ASR605x
Atmel AVR
Atmel SAM
Espressif 8266
Intel ARC32
Microchip PIC32
Nordic nRF51
ST STM32
Teensy
TI MSP430
TI TIVA
Espressif 32
Nordic nRF52
ST STM8
Atmel megaAVR

Headers
-------
ESPWebThingAdapter.h
EthernetWebThingAdapter.h
Thing.h
WebThingAdapter.h
WiFi101WebThingAdapter.h

Examples
--------
https://dl.registry.platformio.org/examples/08/fa/92a7e6124a7b57cdfa6f4b238b5c0fcc5ac91506c49486948644d0cfef2b/TextDisplay.ino
https://dl.registry.platformio.org/examples/7b/1d/2b66ce6f59eacb54cc8fb09a00451db25ea6ea3b18ec6169ab56279bb19e/LEDLamp.ino
https://dl.registry.platformio.org/examples/a5/9d/b78446eb937d67b5d0c4d94258cc0102b0605acb98d78eeee50198392056/LED.ino
https://dl.registry.platformio.org/examples/a8/b6/803a2aee6d874de761f74f6b203a2e305ceebb6c5c4bdb4989809487b651/LevelSensor.ino
https://dl.registry.platformio.org/examples/73/82/d6b5fc25f1a1a92f9055319c17d0aaf80536604ce656edaebb9443b72ad4/RGBLamp.ino
https://dl.registry.platformio.org/examples/f4/50/28d29fce964983a50a90bb3bc091acfbb470d732c3253835926c04fb0623/AsyncProperty.ino
https://dl.registry.platformio.org/examples/cb/fd/489c7019820b48ea7d38222374e77bf7f9cda491054bca92b70049cbad66/BME280.ino
https://dl.registry.platformio.org/examples/47/cb/5e5cd9d63a0a1d0302edd1777b4ac3a19274087681f76768b73e1a6e055c/platformio.ini
https://dl.registry.platformio.org/examples/d1/f8/f4c80d014b142475b7c99ff6c966207a51f9467780715a9473d47f7369ea/main.cpp
https://dl.registry.platformio.org/examples/79/11/fc61c4974da7bf01cb5a4f8c38b62d72476e31e05cbf86aef0ed9274f4c3/platformio.ini
https://dl.registry.platformio.org/examples/73/15/69a92d62eabdf978f7377994e5cf6d5651f841bba564bda208344a0c4f6d/main.cpp
https://dl.registry.platformio.org/examples/8e/d9/60aacbbbc1f3f68592aaddb067c1ed28d63666ea1e57d0e52e62e56058b3/platformio.ini
https://dl.registry.platformio.org/examples/17/33/241157c71a4a8641bdef8d856d5d5f26591a5e1cf93e666ce94c7fd60dcb/main.cpp
https://dl.registry.platformio.org/examples/47/cb/5e5cd9d63a0a1d0302edd1777b4ac3a19274087681f76768b73e1a6e055c/platformio.ini
https://dl.registry.platformio.org/examples/42/9c/f56de0f049b353d24e23481edaf5d628f36053b40eed90c79e3a17f40e05/main.cpp
https://dl.registry.platformio.org/examples/8e/d9/60aacbbbc1f3f68592aaddb067c1ed28d63666ea1e57d0e52e62e56058b3/platformio.ini
https://dl.registry.platformio.org/examples/dd/41/79ec680903559ae315f104ee06507c42ff5dd6f3a5290798b7eac7085fb7/main.cpp
https://dl.registry.platformio.org/examples/0e/8b/d7ffc4f4df6d99078526c1479b929067cec614d770ed14635c7962fa8f93/platformio.ini
https://dl.registry.platformio.org/examples/10/96/be649f4a1a6c385c59b60833d2f38baa84d285e3c00d8a9711feb2649a02/main.cpp
https://dl.registry.platformio.org/examples/43/58/008abb96e5bf838226253b36c92eb2464fc1181a0b490343cbe51f9091eb/platformio.ini
https://dl.registry.platformio.org/examples/8a/c4/a137ff173f7ef8dc9486d128f17b69f56163fd9b6e016485673d16c3a3d3/main.cpp

Versions
--------
0.1.0, released Wed Apr 18 21:56:39 2018
0.10.1, released Tue Dec 31 23:42:12 2019
0.10.2, released Thu Jan  2 19:23:58 2020
0.11.0, released Tue Jan  7 00:17:35 2020
0.11.1, released Tue Jan  7 19:22:24 2020
0.11.2, released Fri Mar 27 21:40:00 2020
0.11.3, released Mon Apr 13 16:17:56 2020
0.11.5, released Mon Jun  1 20:42:33 2020
0.2.0, released Tue Jun  5 20:42:13 2018
0.3.0, released Wed Jun 20 20:08:58 2018
0.4.0, released Thu Jul 12 14:09:36 2018
0.4.1, released Thu Jul 26 14:32:54 2018
0.9.0, released Thu Aug 15 19:21:07 2019

Unique Downloads
----------------
Today: 0
Week: 10
Month: 12

This install of VSCode and PlatformIO is new specifically for this project. However, it is version 4.3.4. Here’s the output that I get when I enter the same two commands that you showed. The second command blows up with a ‘KeyError’ exception.

$ platformio --version                
PlatformIO, version 4.3.4
$ platformio lib show webthing-arduino
Looking for webthing-arduino library in registry
Found: https://platformio.org/lib/show/5397/webthing-arduino
webthing-arduino
================
#ID: 5397
A library for creating Web Things using the Web of Things API. Runs on ESP8266, ESP32, Ethernet, and WiFi101-compatible boards. Compatible with the Mozilla WebThings Gateway.

Version: 0.11.5, released Mon Jun  1 20:42:33 2020
Manifest: https://raw.githubusercontent.com/mozilla-iot/webthing-arduino/master/library.properties
Repository: https://github.com/mozilla-iot/webthing-arduino.git
Error: Traceback (most recent call last):
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/__main__.py", line 109, in main                                                                                          
    cli()  # pylint: disable=no-value-for-parameter                                               
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py", line 829, in __call__                                                                                               
    return self.main(*args, **kwargs)                                                             
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py", line 782, in main 
    rv = self.invoke(ctx)                                                                         
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/commands/__init__.py", line 44, in invoke                                                                                
    return super(PlatformioCLI, self).invoke(ctx)
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/lars/.platformio/penv/lib/python3.6/site-packages/platformio/commands/lib.py", line 448, in lib_show
    if not author[key]:
KeyError: 'url'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

I’ve just installed VSCode and PlatformIO on my Mac OS/X machine. I get identical errors that I got on my Linux machine and webthing-arduino fails to install:

lars@stillwater % platformio --version
PlatformIO, version 4.3.4
lars@stillwater  % platformio lib show webthing-arduino
Looking for webthing-arduino library in registry
Found: https://platformio.org/lib/show/5397/webthing-arduino
webthing-arduino
================
#ID: 5397
A library for creating Web Things using the Web of Things API. Runs on
ESP8266, ESP32, Ethernet, and WiFi101-compatible boards. Compatible
with the Mozilla WebThings Gateway.

Version: 0.11.5, released Mon Jun  1 20:42:33 2020
Manifest: https://raw.githubusercontent.com/mozilla-iot/webthing-arduino/master/library.properties
Repository: https://github.com/mozilla-iot/webthing-arduino.git
Error: Traceback (most recent call last):
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/platformio/__main__.py",
line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/click/core.py",
line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/click/core.py",
line 782, in main
    rv = self.invoke(ctx)
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/platformio/commands/__init__.py",
line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/click/core.py",
line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/click/core.py",
line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/click/core.py",
line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/click/core.py",
line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/lars/.platformio/penv/lib/python2.7/site-packages/platformio/commands/lib.py",
line 448, in lib_show
    if not author[key]:
KeyError: 'url'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

At the end of the error, it tells you to update your PlatformIO install. I’d try that.

On both the Mac and Linux machines the result of pip install -U platformio command is a bunch of “Requirement already satisfied…”. Here’s the output from the Mac:

Requirement already up-to-date: platformio in /Users/lars/.platformio/penv/lib/python2.7/site-packages (4.3.4)
Requirement already satisfied, skipping upgrade: pyelftools<1,>=0.25 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (0.26)
Requirement already satisfied, skipping upgrade: click<8,>=5 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (7.1.2)
Requirement already satisfied, skipping upgrade: marshmallow<3,>=2 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (2.21.0)
Requirement already satisfied, skipping upgrade: pyserial!=3.3,<4,>=3 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (3.4)
Requirement already satisfied, skipping upgrade: requests<3,>=2.4.0 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (2.24.0)
Requirement already satisfied, skipping upgrade: bottle<0.13 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (0.12.18)
Requirement already satisfied, skipping upgrade: semantic-version<3,>=2.8.1 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (2.8.5)
Requirement already satisfied, skipping upgrade: tabulate<1,>=0.8.3 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (0.8.7)
Requirement already satisfied, skipping upgrade: colorama in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from platformio) (0.4.3)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from requests<3,>=2.4.0->platformio) (1.25.9)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from requests<3,>=2.4.0->platformio) (2020.6.20)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from requests<3,>=2.4.0->platformio) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in /Users/lars/.platformio/penv/lib/python2.7/site-packages (from requests<3,>=2.4.0->platformio) (2.10)

BTW, webthing-arduino is the only library for which I’ve encountered a failure. I’ve installed many others to test to see if the problem is pervasive or specific.

You can try upgrading to the dev version:

$ platformio upgrade --dev

I did have the same issue before upgrading today.

The issue seems to be that our library.json is missing the authors.url key. However, PlatformIO’s spec says it’s optional.

I’ve upgraded both the Linux and Mac to the dev version.

On the Linux box, installation of webthing-arduino failed again with the same error.

However, there is a deceptive UX problem here. I abruptly noticed that by default, the Library Manager Installation drop down box offers to install 0.9.0. That is the version that is failing to install. Opening the drop down box, I see that the current release is sorted badly and is the fifth option below the cut. Selecting version 0.11.5 for installation does not result in error, but nor does in result in a success message. Instead, I get a message saying that the dependency ArduinoJson successfully installed, there is no mention of webthing-arduino.

Finally going to the list of installed libraries in the UI, I can verify that webthing-arduino did install. I’m not sure the upgrade to the dev version was necessary. I wonder if I can downgrade to the release version to retest.

UX/UI problems doom us all. Thank you for your suggestions, at least I’m up and running again.

I’ve downgraded from the dev version to the release version. I’ve verified that the release version will succeed in installing webthing-arduino if and only if the default 0.9.0 is overridden by manually selecting the 0.11.5 version. That was my problem all along.

BTW, downgrading from dev to release was accomplished with this command:

$ pip install -U "platformio<4.4"
...
Successfully uninstalled platformio-4.4.0a4
Successfully installed platformio-4.3.4

PlatformIO is the best tool for using the webthing-arduino library, but for ESP32 hardware, coding web things using MicroBlocks is quite “fun”, and way easier. :slight_smile:

Quick test of controlling the user LED.
Several Web of Things examples.