Skip to content

08 Troubleshooting

Resinchem edited this page Feb 16, 2024 · 1 revision

If your device isn't working or isn't working as expected, please follow these steps before requesting assistance. I am happy to try to help as my workload permits, but knowing that you have tried the following beforehand can save us both significant time.

Initial Flashing

If you cannot seem to get your ESP8266 connected to the computer (COM port does not show up when connecting, or you get a communication error when attempting to upload the .bin), it is possibly due to one of the following:

  • You do not have the USB-to-Serial drivers installed on your machine. For the ESP8266, this is normally the CH340 driver (ESP32 will generally require CP201X). These are generally installed already on Windows 10/11, but not always. It is also possible that you need a specific driver from your computer's manufacturer (I had this situation with a Lenovo laptop). Locate and install the appropriate USB-to-Serial driver. Once installed properly, a new COM port should appear when your ESP8266 is plugged in

  • You are using a power-only USB cable. Be sure the cable you are using supports data as well as power.

  • While normally not the case with most ESP8266 boards, it is possible that you need to hold down the boot/reest button on the board when connecting to PC to put it in flashing mode. Normally this only occurs with ESP32 boards, but it is worth trying.

  • If possible, connect using a USB port directly on the computer being used to flash, and not via an external hub.

If none of the above work, if possible try using a different cable, different ESP8266 board and even a different computer. It's certainly not unheard of to get a bad ESP8266 board from time to time. The one you are using may simply be faulty. This is also why it is always adviseable to do a breadboard bench test before creating a final soldered version of your controller!

Initial Onboarding/Connecting to WiFi

If you've completed the initial flashing but do not see a MotionLED_AP hotspot being broadcast (this would be named ESPxxxxxx with versions prior to v0.46), check the following:

  • Be sure you've power cycled the ESP8266 after flashing. The device initially remains in flashing mode and must be restarted to return it to normal operation.

  • The hotspot will only initially broadcast for approximately two minutes if no devices join. If no devices join in this time frame, the hotspot will be shutdown. Try restarting the ESP8266 to see if the hotspot reappears.

  • If you have previously used the ESP8266 board for other purposes, it is possible that it retained the WiFi information and has already joined your WiFi. Be sure you use the option to 'erase the flash' when loading the initial firmware. You may need to reflash the board and assure the flash is erased.

            Erase_Flash

  • If you still are not seeing the MotionLED_AP on your phone, it is possible that the initial flashing failed. If you see a flashing or blinking LED on the ESP8266 board, this also likely indicates that the board is in a boot loop. You will need to retry flashing the firmware. If this continues after reflashing (and assuring the flash is erased), you may have a bad or incompatible ESP board. This application was tested with the Wemos D1 Mini and a standard NodeMCU ESP8266. Other variants may or may not work.

Can't Access the Web Settings page

If you successfully complete the onboarding process and the controller joins your WiFi, the LEDs will briefly flash blue, followed by alternating red/green before turning off. The web settings page should be accessible at this point. If you cannot reach it, check the following:

  • Assure you are using the correct IP address. Check your router to look for the device name you entered during onboarding (or maybe ESPxxxxxx prior to v0.46 or if your router doesn't recognize the hostname).

  • Assure you are using 'http://' and not 'https://'

  • Check that the computer or device you are using to connect to the web settings is on the same network as the controller. The controller only works with 2.4 GHz networks and may not be able to communicate with devices on a dedicated 5 GHz network.

  • Be sure no firewall rules are blocking communications. The web app just uses port 80 so this normally should not be a problem, but if you have an IoT network it is possible that a rule is preventing you from reaching (or receiving a response from) the controller.

  • Check that original MotionLED_AP hotspot is not being broadcast. This hotspot should only appear when the controller cannot connect (or loses connection) to your WiFi.

No Response from LEDs (no lights with motion or lights are alway on)

If you can access the setting web page, but the LEDs do not seem to respond to motion (or remain on all the time), first check the following on the settings page:

  • Assure you have the proper number of PIR sensors entered to match your installation. If you have only one motion detector but indicated two during setup, the LEDs will illuminate and remain on. Correct this value, and check the box to save the new settings as the new boot defaults. The controller will reboot with the proper number of motion detectors.

  • Assure you have set the LED brightness to a detectable level. Very low brightness levels may not illuminate the LEDs. Initially try a value of at least 128. Click the update button to test your new settings. If this resolves the issue, repeat until you find a brightness level that still illuminates the LEDs and save as new boot defaults.

  • Be sure you have entered at least one value (128 or greater) into either the Red, Blue or Green setting for each detector (if more than one). If all the RGB values are set to zero, this represents "black" or off for the LEDs.

  • This issue should have been fixed in v0.46, but try changing the effects to something other than solid, saving the defaults and see if you get a response. If this works, you can then return to using the Solid effect if desired.

  • If none of the above work, then it is likely it is a hardware/wiring issue. The most common issue is a problem with the motion detectors. Verify that you have used the correct GPIO pins and that you have not reversed the polarity on the detectors (although this generally results in some "magic smoke" if you inadvertanly made that mistake!). The only real way to test that your detectors are functioning is to disconnect the LEDs, connect the controller to the computer iva USB (be sure to disconnect any other power sources first) and use the Arduino IDE to enable the serial debug option and use the serial monitor to watch for motion. The serial monitor will display a message that motion was detected (and when it clears) for each of the detectors. If you do not see a serial message when moving in front of the motion detector(s), this is sure sign you have a hardware issue.

LEDs Remain on Longer than the LED On Time

The LED on time only begins after the detector no longer reports motion (e.g clears and resets). Even after there is no longer motion, detectors normally have a 'cool-down' period before they reset. This could be as short as a few seconds up to 30 seconds or longer. The motion detectors I used for this project have a cool-down period of approxmately 5 seconds. That means if I enter an LED on time of 10 seconds, the LEDs will remain lit for around 15 seconds after motion stops.

So, the LED on time is added to the amount of time that it takes the motion detector to clear and reset. This means if you have motion detectors that take 30 seconds to reset after motion, the LEDs are always going to be on for a minimum of 30 seconds, even if you enter a zero for the LED on time. This is done so that the LEDs will stay on as long as motion is still being continously detected. If you are trying to create a certain amount of time for the LEDs to stay on, you will need to substract the cool down time from the number of seconds you put in the LED on time field.

Remember, the LED on time is the number of seconds after the motion detector(s) clear and not the amount of time from when the LEDs first come on. Also note that tripping one sensor, then tripping the other sensor before the LEDs turn off, resets this time back to the start.

Other Issues

If none of the above resolves your issue, feel free to post a message in the troubleshooting topic of this repo's discussion area. Someone else may have resolved the same issue or I will do my best to try to help as my time permits. Again, please do not open an issue unless you believe the issue is directly firmware related. If it is not a firmware issue, I will likely move your post to the discussion area. If, via the discussions, it is determined to be firmware-related, I can move that over to an open issue.

Clone this wiki locally