ScheDuler

User Menu

How to use ScheDuler IoT (Quick Start)


(Do not Enter Real Info as it's a demo project.)


Step-by-step demo instructions to add devices and control switches from the web.

1. Create account & Login

  1. Sign up via signup. You’ll be shown a recovery code — copy it and keep it safe.
  2. Login from the main page or the drawer. After login you land on profile.
  3. On successfull signup your data are stored safely using secret session tokens for better security.

2. Add & Connect a Device

  1. Open Profile → go to Devices section.
  2. Type a friendly device name or the device IP into the box and click Connect. This stores a demo connection in the site DB.
  3. Connected device is saved in localStorage only for demo convenience — the worker/API also records a connection entry.
  4. If you want to disconnect, click the button next to Connect.

3. Add Switches (max 5 for demo)

  1. In Profile → Switches enter a label (e.g. Room Light) and click Add Switch.
  2. Each label is unique per user. The API enforces up to 5 switches per user.
  3. New switch default state: off. You can toggle it after creation.

4. Turn On / Off — How it works

  1. Click the Turn On / Turn Off button next to a switch. The UI updates the state and calls your API:
  2. That API updates the database. For demo mode there is no direct hardware control until an actual ESP device polls the server or implement Websocket(see Polling section).
  3. If disconneting device fails, then go to broswers settings>site settings>data stored> delete "https://schedulers.pages.dev" or clear broswer's data :).
  4. After Cloudflare wokers conversion, websocket will be implemented.

5. Rename & Remove

  1. Click Rename — edit inline then blur to save the new label. This calls the API with renameTo.
  2. Click Remove to delete the switch from your account (DELETE /api/esp).
  3. Removed switches are deleted from the DB. They will no longer appear for your account.

6. Polling (Demo → How the ESP reads commands)

  1. Polling means the ESP device periodically asks your server, “Any commands for me?” (example interval: 30s for demo).
  2. Polling works when the ESP is on the Internet (has Wi-Fi / SIM / NAT/port open depending on your setup). If the ESP is only on local network and not reachable, it cannot poll remotely.
  3. When the ESP polls, your server can return the desired pin state for each labeled switch and the ESP applies it to the GPIO pins.
  4. Important (demo): Polling consumes simple HTTP requests; if you set very short intervals and many devices, you can hit Cloudflare Pages/Workers request/build limits. For a demo, 30s is reasonable.

7. Quick Troubleshooting

About this Demo

This project is a lightweight demo to show how a web app can manage labeled switches,set timers, and control remote devices. It is intended for demonstrations and learning — As real polling ,websocket etc will induce charges.