Fixing krvarma/Particle_Alexa from GitHub firmware


I just recently replicated the Particle_Alexa project from GitHub.

When I completed it about a month ago it worked flawlessly - great project! I am currently replicating it with another device, however the firmware is no longer compiling.

When I attempt to verify the given code through the Particle Build IDE, I receive the following error

DHT.cpp: In member function 'float DHT::readTemperature(bool)':
DHT.cpp:27:22: error: 'data' was not declared in this scope
                 _f = data[2];
DHT.cpp: In member function 'float DHT::readHumidity()':
DHT.cpp:66:22: error: 'data' was not declared in this scope
                 _f = data[0];
DHT.cpp: In member function 'bool DHT::read()':
DHT.cpp:110:5: error: 'data' was not declared in this scope
     data[0] = data[1] = data[2] = data[3] = data[4] = 0;
make[1]: *** [../build/target/user/platform-6DHT.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.

I am under the impression that the online IDE may have changed slightly and this is why the code no longer compiles.

Any help would be appreciated. Thanks so much.

@rzilz2, thanks for pointing our the issue!

I just included the “application.h” in DHT.h and removed it from DHT.cpp and everything works fine. Not sure why but this solves the problem.

Can you try this and update here?, I will check-in the code if it is working for you.

1 Like

@krvarma That fixed it! Thanks a lot!

1 Like

Hi! I have a potential extension to this project that I would like to explore.
If you point your browser to it indicates either RED or GREEN depending on timing.
Would there be a way to have the Particle navigate to this browser, get either RED or GREEN, and turn on the appropriate light?

Let me know what you think!