Skip to content

About

Interactive Python script for users to setup their CleverPet, configure the wifi, claim the device, and flash the HackerPet firmware

Resources

Stars

0 stars

Watchers

4 watching

Forks

Repository files navigation

HackerPet_Setup

HackerPet_Setup is a command-line tool that sets up the Particle Photon in a CleverPet Hub over USB. It:

  • checks that the Particle CLI is installed and logs you in to your particle.io account
  • detects the Photon connected over USB and updates its Device OS when needed
  • configures the Hub's Wi-Fi
  • claims the Hub to your particle.io account and lets you (re)name it
  • offers to open the Particle Console, the HackerPet_Plus library in the Particle Web IDE, and http://cleverpet.local in your browser

Requirements

  • A particle.io account
  • Particle CLI
  • Python 3
  • A micro USB cable to connect the Hub's Photon to your computer
  • A 2.4 GHz Wi-Fi network

Setup

  1. Download the latest HackerPet_Setup_v<version>.zip from the Assets of the Releases page.
  2. Extract the zip to any location on your computer where you have full write permissions. Make note of that location.
  3. Download and install the Particle CLI. Follow the instructions at https://docs.particle.io/getting-started/developer-tools/cli/.
  4. Download and install Python 3 from https://www.python.org/downloads/. On Windows, check the box Add python.exe to PATH at the bottom of the first screen of the installer.
  5. Plug the Hub's Photon into your computer with the micro USB cable and run the setup:
    • Windows: open the Command Prompt, go to the folder you extracted, and run HackerPet_Setup.bat:

      cd path\to\HackerPet_Setup
      HackerPet_Setup.bat
    • macOS or Linux: open a terminal, go to the folder you extracted, and run HackerPet_Setup.py:

      cd path/to/HackerPet_Setup
      python3 HackerPet_Setup.py

Troubleshooting

  • No Hub Photons found: plug in the Hub's Photon with a micro USB cable and run the setup again.
  • Photon failed to enter Wi-Fi setup: unplug the USB cable, plug it back in, and press Enter to try again.
  • http://cleverpet.local does not load: look up the Hub's IP address in your router and open that IP address instead.

Any issues, email [email protected]

-- Updating Device OS on older devices (DeviceOSFirmware) -- DeviceOSFirmware/update.bat (Windows) and DeviceOSFirmware/update.sh (macOS/Linux) update an older Photon to Device OS 3.3.1 and flash HackerPet_Plus 0.1.114 over USB. Use this when the device is not detected by USB or by HackerPet_Setup.

Prerequisites

  • Particle CLI installed (see step 3 above) and logged in: run "particle login"
  • Device connected to the computer by a USB data cable

How to run

  • Windows: open the cmd prompt, go to the DeviceOSFirmware folder, run update.bat
  • macOS/Linux: open a terminal, go to the DeviceOSFirmware folder, run ./update.sh
  • When asked, put the device into DFU mode (LED blinking yellow): hold both buttons, release RESET, keep holding SETUP until the LED blinks yellow, then release SETUP. Press Enter to start flashing.
  • The script stops with "Flash failed" if any step fails. Fix the error shown and run the script again.

P1 option

  • The scripts flash a Photon by default. For a P1, add "p1": update.bat p1 ./update.sh p1
  • The P1 option flashes Device OS 3.3.1 and Tinker from DeviceOSFirmware/p1. No P1 build of HackerPet_Plus is included, so flash HackerPet_Plus for P1 afterwards from https://build.particle.io/libs/hackerpet_plus

Brian

API documentation

HackerPet.com_API.md is a copy of the HackerPet API documentation from HackerPet.com.

To Do

  • Flash the latest HackerPet firmware from the web in the command line
    • Detect the type of Particle board: Photon, P1, Photon 2, etc.
  • Allow setting up the Photon without a Particle account
    • Update Device OS
    • Configure Wi-Fi
    • Flash the HackerPet firmware

About

Interactive Python script for users to setup their CleverPet, configure the wifi, claim the device, and flash the HackerPet firmware

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages