|
Post by papa on Feb 21, 2020 21:50:09 GMT
Papa: Recently nin34 personal messaged:
Hi there, I'm facing an error while trying to run a code for IoT Based Smart Parking System using Adafruit IO.
WARNING: Spurious .github folder in 'Adafruit MQTT Library' library
C:\Users\ninad\Documents\Arduino\Sketches\sketch_feb20a\sketch_feb20a.ino: In function 'void loop()':
sketch_feb20a:85: error: 'MQTT_connect' was not declared in this scope MQTT_connect();
Could you please help me? Thanks!
iotdesignpro.com/projects/iot-based-smart-parking-using-esp8266 You can find the entire code on the above link ^
|
|
|
Post by papa on Feb 21, 2020 21:52:11 GMT
I looked at the sketch at iotdesignpro.com/projects/iot-based-smart-parking-using-esp8266
MQTT_connect() is a function the sketch calls, but it is nowhere in the sketch itself. At first I thought perhaps MQTT_connect() is supposed to be found in one of the #included libraries, I would guess "Adafruit_MQTT.h" or "Adafruit_MQTT_Client.h" However, I did not find MQTT_connect() in either of those libraries. That is, MQTT_connect() is not declared (set up) anywhere reachable by how you are using the sketch so it throws an error.
Looking further here: github.com/adafruit/Adafruit_MQTT_Library/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino ... I found this just before void setup() in an example sketch:
papa: so try this in the sketch ... Find these two lines:
& between the two above lines insert this line: void MQTT_connect(); ================================ That is, try this: make the two lines like the following 3 lines (so MQTT_connect is "declared" before it's used in void loop():
|
|