The module would not respond to us spamming the "AT" command through the serial monitor.
Fix: we ended up changing the wires and it worked.
This time... the module responds every time we spam "AT"... but it will not upload the Arduino code...
... Okay, so after pulling the ground wire and having the upload speed at 115200... it seems to be working.
Update 2:
In order to fix this, we need to make sure that the ESP8266 Module resets every time we upload a new code. To do this, GPIO_0 should be connected to GND while starting up. If it is already in GND then we'll need to disconnect the GPIO_0 wire from GND and then reconnect it again before uploading the code. This will cause the module to enable flash mode.
False alarm: We connected the GND to VCC... :'<
The current ESP8266 Module we currently have is the ESP-01. This means that there are only 2 GPIOS. This is a huge restriction to how many relays we could control, as we're only able to control 2. We've done a few research to over come this and we found out that there is such a thing called the PCF8574. The sole purpose of the PCF8574 is to extend GPIO.
Update:
We'll just use the ESP8266-12 or something similar. This is because the ESP8266-01 keeps resetting and is very unreliable at the moment.
Image source: https://hackadaycom.files.wordpress.com/2008/12/pcf8574.png?w=800
The ESP8266 was stuck in a loop because of some unknown error... Debug time!
Update:
We didn't put the "SPIFFS.begin();" code...
Source: https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html
Unable to connect to the MQTT broker with the ESP8266
Update:
We realized that the M2Mqtt NuGet on ASP.NET MVC was just a client and not a broker... To fix this, we had to rely on an online MQTT broker. However, because this project's final goal is to give to local farmers, we will try and create our own MQTT broker with "Mosquito".
After the NodeMCU resets, we can't connect to the WiFi. Other uploads such as the blinking is
Update:
To solve this we used a NodeMCU firmware flasher.
Update 2:
The reason why the NodeMCU kept resetting was because we connected it to A0... tip: always read the diagrams of electrical components.