betsy-button

Family health button
git clone https://git.woozle.org/neale/betsy-button.git

betsy-button / docs
Neale Pickett  ·  2025-06-29

programming.md

  1---
  2title: Programming the Betsy Button
  3author:
  4  - Neale Pickett
  5  - Google Gemini
  6---
  7
  8Prerequisites
  9===========
 10
 11To use the Betsy Button Programmer, ensure you have the following:
 12
 13* An assembled Betsy Button.
 14* A USB-C cable to connect the microcontroller to your computer.
 15* A web browser compatible with the Web Serial API (e.g., Google Chrome, Microsoft Edge).
 16
 17Setup Instructions
 18===============
 19
 20Access the Betsy Button Programmer Interface
 21----------------------------------
 22
 23The programmer interface is a web application.
 24
 251. Open your web browser and navigate to
 26    <https://woozle.org/betsy/programmer.html>.
 27
 282. You should see the "Betsy Button Programmer" interface.
 29
 30Bootstrap a New Microcontroller (First-Time Setup)
 31-------------------------
 32
 33This step installs the MicroPython firmware onto your microcontroller,
 34and only needs to happen once for each microcontroller.
 35If the plugged-in microcontroller has already been bootstrapped,
 36you can skip to the next step.
 37
 381. Connect your Betsy Button
 39    to your computer using a USB-C cable.
 402. Click the "Bootstrap" button
 41    on the web interface.
 423. A pop-up window will appear asking you to select a serial port. Choose the correct port for your microcontroller and click "Connect." If you only see one option, that's probably the correct one.
 434. The programming process will begin, and you will see output in the terminal area of the web page. This process downloads the MicroPython firmware and flashes it to the device.
 445. Once "Bootstrap complete" is displayed in yellow the terminal,
 45    press the physical "R" (Reset) button
 46    on your Betsy Button.
 47    This tiny button is on the back of the Betsy Button,
 48    next to the antenna connection.
 496. The web interface will prompt you to click the "Connect" button.
 50
 51Program the Microcontroller
 52------------------------
 53
 54After bootstrapping, you need to configure the microcontroller with your Wi-Fi network details and a unique identifier for your button group.
 55
 561. Click the "Connect" button
 57    on the web interface.
 582. Select the serial port for your microcontroller again and click "Connect."
 593. You should see "Connected to device" in the terminal area.
 604. Fill in the following details on the web interface:
 61    Wireless Networks
 62    : Enter the SSID (Wi-Fi network name) and Password for up to four Wi-Fi
 63      networks. The button will attempt to connect to these in order. At
 64      least one network is required.
 65    Button Group (identifier)
 66    : Enter a unique identifier for your group of buttons. It is
 67      recommended to use a phone number in the format `xxx-xxx-xxxx`
 68      (e.g., `555-123-4567`). All buttons in the same group must have
 69      the \fIexact same identifier\fR. The application will
 70      automatically construct the full URL to the server using this
 71      ID.
 725. Click the "Program" button.
 736. The configuration and MicroPython scripts (`blinker.py` and `main.py`) will be uploaded to the microcontroller. You will see "Uploading" messages in the terminal.
 747. Once the programming is complete,
 75    the microcontroller will reset and attempt to connect to the configured Wi-Fi network and communicate with the server.
 76    It will flash cyan while connecting to the wireless network,
 77    then flash red or pulse green,
 78    depending on whether a button in this group has been pressed yet.
 79
 80Completion
 81==========
 82
 83Your Betsy Button programming is now complete!
 84You can now use your Betsy Button.
 85Usage information is provided in the separate
 86user instructions.
 87
 88
 89Project Home
 90===========
 91The project home of the Betsy Button
 92is
 93<https://git.woozle.org/neale/betsy-button/>.
 94This site includes all source code,
 95all documentation,
 96an issue (bug) tracker,
 97and more.
 98
 99I hope the Betsy Button is useful for you,
100but I cannot provide any support for it.
101Do not rely on the Betsy Button for health issues.