The first section of code within the blog exclusively reads the sensor and logs to the serial monitor. The “updated code” you have linked is not actually updated code as it is performing completely different functionality.
The “updated” code you have linked above includes code exclusively for connecting to Losant, while the first link you have included reads from the DHT and does not connect to Losant. The code you have linked from Github does not read from the sensor, nor should it.
I’d like to break this down because it can get a little confusing, so let’s dive in!
The example in the blog has two sections of code. The first section reads from the DHT sensor and logs to the serial monitor, while the second section of code connects to WiFi, Losant, and reads the sensor values. Within the blog, the second portion of the code is building upon the first.
The updated Github code you have linked connects to WiFi and Losant and does not include code to report the sensor values, as it is a base for users to build upon for their specific use cases. You will need to use the Github code as a base and build the DHT sensor functionality into this code. The blog was written as an example in 2016, so it is very likely you’ll need to rewrite some of the code from the first section of code to read from the sensor, then build it into the updated Github code.
The issue you are facing is the fact that there is no DHT code in the Github repository. Since the DHT22 sensor is specific to your use case and you have successfully connected to Losant, I’d recommend you check out the resources I referenced above. Since our expertise lies in the Losant Platform, you can find excellent resources from Arduino and possibly an updated example of how to read from a DHT22 sensor within Stack Overflow.
Please let me know if I can answer any further questions!