Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 5.36 KB

install-software.md

File metadata and controls

78 lines (65 loc) · 5.36 KB

👈 Back to main page

Software Installtion & Flashing your ESP32

Important

This project is an add-on to your already built Open Source Watch Winder (OSWW).

  • This project requires a microncontroller which replaces the Pi Pico used in the OSWW.
  • The Raspberry Pi Pico is incompatible with this project and must be swapped.

Getting Started

Prerequisites

Flashing your microcontroller

  1. Download this repository. You can do this via git or by downloading the repository as a ZIP.
    • If you downloaded the repository as a zip, uzip it before proceeding to step 2.
    how to download
  2. Open the extracted folder (or cloned repository if using git) in Visual Studio Code
  3. Build Options - IMPORTANT
    • if you're building Winderoo with an OLED screen or you desire fine-grained motor control (pulse width modulation), you must enable one (or two) build flags to tell PlatformIO to include additional libraries.
    • To toggle these build flags, navigate to the file called platformio.ini:
      how to download
      • In this file, you'll see the following block of code:
        build_flags =
            -D OLED_ENABLED=false
            -D PWM_MOTOR_CONTROL=false
        • Change -D OLED_ENABLED=false to -D OLED_ENABLED=true to enable OLED screen support
        • Change -D PWM_MOTOR_CONTROL=false to -D PWM_MOTOR_CONTROL=true to enable PWM motor control; at the time of writing, Winderoo with PWM only supports MX1508 derived motor controllers.
          • PWM_MOTOR_CONTROL is an experimental flag. You will encounter incorrect cycle time estimation and other possible bugs unless you align the motor speed to 20 RPM (see Troubleshooting). Use at your own risk.

    • PlatformIO will now compile Winderoo with OLED screen and or PWM motor support
  4. Select 'PlatformIO' (alien/insect looking button) on the workspace menu and wait for visual studio code to finish initializing the project
    platformIO button
  5. Expand the main heading: "esp32doit-devkit-v1":
    platformIO actions overview
  6. Expand the "General" heading, then click Upload. You'll see a message if the code was uploaded successfully:
    code upload button
  7. Now expand the "Platform" heading, then click Upload Filesystem Image. You'll see a message if the code was uploaded successfully:
    upload filesystem button
  8. All done! Your microcontroller should now have 2 LEDs illuminated (see beneath). If it does, proceed to Next steps. If not, try to upload the code & file system again.
    upload filesystem button
  9. If you have a different LED state, compare it with this table:

Next steps:

Ok, you've got 2 LEDs illuminated on your board. Great! Let's make sure the code works.

  1. Get out your mobile device (phone/tablet) and navigate to the Wi-Fi / wireless network list. You'll want to find and join a WiFi network called "Winderoo Setup."
    • It may take a minute or so to connect, or look like it isn't doing anything. Hold tight, it is.
  2. Once you've connected to "Winderoo Setup", a captive page will open called "WifiManger Winderoo Setup."
  3. Tap "Configure WiFi"
  4. Tap on the network you want to add Winderoo to, this is likely your home WiFi network
  5. Enter your WiFi network's password then tap "Save." Wait until the captive page closes itself.
  6. Re-join your home WiFi network
  7. Open up a web browser and try to navigate to the following webpage:
  8. If you see Winderoo's user interface, you're all done!

Troubleshooting

Motor Turns too fast when using PWM

Warning

PWM_MOTOR_CONTROL is an experimental flag. You will encounter incorrect cycle time estimation and other possible bugs unless you align the motor speed to 20 RPM.

  • The default speed is 145 (8-bit resolution), where 0 is the slowest and 255 is the fastest. You can modify this value here:
    • MotorControl.cpp
      • Change the value for the variable motorSpeed to any value between 0 and 255
      • After changing that value, you must recompile the software and upload it to your ESP32
  • You can also tweak the rotational timing value. By default this is set at 8 seconds to complete one revolution.
    • To change this value, change the variable durationInSecondsToCompleteOneRevolution here:
    • main.cpp