Skip to content

Getting started

Installation - Developer

  • Open GitKraken Press + / New tab and select Clone a Repo (Or another git management tool)
  • Select the folder on your local drive where to copy to (e.g. /github/MoonModules)
  • Copy MoonBase.git or MoonLight.git and paste in the URL field of GitKraken
  • Press clone the repo
  • Open VSCode
  • Install the PlatformIO IDE extension
  • Open the folder created with GitKraken
  • Connect an ESP32 or an ESP32-S3 with USB to your computer
  • On the status bar select the env to flash and the board to flash to
    • Select esp32dev for a normal ESP32
    • Select esp32-s3-devkitc-1-n16r8v for an ESP32-S2 (recommended or similar)

image

  • Press PlaformIO:Upload (->) on the statusbar
  • The firmware is now flashed to your board, after flashing the board will reboot
  • Recommended: Press PlatformIO:Serial Monitor to see the debug information produced

Installation - End user

install

  • release 0.5.4, for latest build follow installation developer
  • This is WIP, looks like issue with erasing the board and setting the partitions right ...
  • Made using esp-web-tools

Configuration

  • In case of a newly flashed board, a Wifi access point (AP) will be created. Go to your Wifi settings on your computer and find the new Wifi AP (starts with MoonBase, MoonLight or ESPSvelteKit)
    • If the board AP is not showing up in your WiFi list it might be helpful to fully erase the board (vscode 👽, Erase flash)
  • Connect to the AP (no password needed), a captive portal will show with a welcome screen.
    • There seems to be an issue in the captive portal showing Connection to device lost repeatedly. In that case, close the captive portal and open the app in a brower using 192.168.4.1
  • Go to the menu and select Wifi / Wifi Station
  • Press (+) and enter the SSID and the password of your Wifi Network
  • Press Add Network and Apply settings
  • The board will reconnect to your Wifi Network
  • Go back to your Wifi Network on your computer
  • Find out the new IP of the board, or in your Wifi Network settings or by looking at the log in the Serial Monitor (see above)
  • (sometimes it takes a while to load pages for the first time, might be related to caching of javascript, on the issuelist)

Developing

  • Read the ESP32 Sveltekit docs (Latest version (Svelte 5) here ESP32 Sveltekit docs)
  • Read Customizing Sveltekit
  • UI dev: configure vite.config.ts, go to interface folder, npm install, npm run dev. A local webserver starts on localhost. UI changes will directly be shown via this webserver
  • Want to make changes: fork the repo and submit pull requests

MoonBase specific

  • Connect a 256 leds panel to the board
  • Search for FastLED.addLeds in the code and update to the pin you use to drive LEDS, reflash the code to the board
  • Go to the UI in the browser
  • Go to Custom / Files and create or upload Live scripts
  • Go to Custom / Module Animations and select the 'hardcoded animations' (Random, Sinelon, Rainbow), you should see it on your panel
  • Select any of the Live scripts you uploaded, check the Serial Output for results. (No led output in current version, see below)
  • Open the Edit area and change things in the code, see the Serial Output for results

image

  • To do
    • Find a way to present feedback to the UI (e.g. error messages as comments in the sc file)
    • Extend the code in ModuleAnimations.h to support led animations ('homework assignment')
    • see ModuleAnimation.h (Server)

Current script supported

void setup() {
  printf("Run Live Script good afternoon\n");
}
void main() {
  setup();
}

Homework assignment

void setup() {
  printf("Run Live Script good morning\n");
}
void loop() {
  fadeToBlackBy(40);
  leds[random16(255)] = CRGB(0, 0, 255);
}
void main() {
  setup();
  while (true) {
    loop();
    sync(); //or show??
  }
}