Week 15 Interfacing with an interface
Group members
Interfacing with an interface
This week we build a couple of different user interfaces that show internal states on external devices. We decided to try out these three things: - ArduinoCloud - PythonQT - AdafruitCloud
ArduinoCloud
ArduinoCloud was quite annoying to work with. There we first needed to register our ESP32 device, make a Thing out of it by giving it an id, key and variables, and then track those variables with a dashboard widgets. It needed registration, and the process from device to widget to code was designed around a paying customer, and as a freebie user, I had to fiddle with it a bit too much. To good parts was that it provided the simplest skeleton version of the code automatically, and it could be edited in the cloud.
For example, as the uploading directly from the website was a paid feature, we needed to copy paste the code from the web site to the Arduino IDE program. But the code that contained the id, network details and all of that was not initially in a code file, but in a thing called "Network Tab", which the code somehow referenced. So we could not just copy paste code from the webpage, instead we needed to edit it a first by removing those references, and adding the data from those references as #define
constants.
Afterwards we found out that only the over-the-air uploading is a paid feature, and we should have been able to upload from the website using normal USB-cable. The website does not make this clear, but at least it reduces the amount of annoying copy pasting between two sources.
But here, we added a boolean variable named led, and two widgets, a led widget (that showed the status of led the variable) and a toggle switch (which changed the value of the variable.)
PythonQt
In this week, we tested multiple options for make a user interface for communicating with microcontrollers. First, we went through the documentation of previous year student Akseli Uunila, for making a switching a led on and off using PyQt5. Here is the python code and the Arduino code
AdafruitCloud
Second, we worked with AdafruitIO. We followed this tutorial except for we controlled only one led with only with toggle switch. Here is the code.
AdafruitIO is similar to ArduinoCloud, where we can create widgets (called blocks) to a dashboard that is available on a website. While ArduinoCloud is designed around using the Arduino boards, the AdafruitCloud is more general in its use cases.