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/ewowi)
- Copy 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-S3 (recommended or similar)
- 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
WIP...
- release 0.5.5, 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 MoonLight)
- If the board AP is not showing up in your WiFi list it might be helpful to fully erase the board before flashing (vscode 👽, Erase flash)
- Sometimes the Serial log may show: [ 5817][W][WiFiGeneric.cpp:1408] setTxPower(): Neither AP or STA has been started. This is from setTxPower in APSettingsService. Delay has been added to prevent this.
- 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
- New: Use ESP32Instances to discover the ESP32 nodes on your network (using nodeJS and html)
- Alternatively, find the IP by checking your router 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)
MoonLight specific
- Buy some hardware e.g.:
- For latest DMX support
- Pknight Artnet DMX 512
- Toy Moving heads (warning: projected lights show the individual rgb colors)
- Connect the 256 leds panel to the board on a suitable pin (e.g. Pin 2 or 16)
- Go to the UI in the browser
- Go to MoonLight / Animations
- Create a layout node, e.g. Panel🚥 and set the controls: width and height 16, depth 1, pin: the pin the panel is connected to
- Create an effect node, select the 'hardcoded animations' (Random, Sinelon, Rainbow, Sinus), you should see it on your panel
- Create more nodes with other animations, they will all run at the same time
- Live Scripts: Go to MoonBase / Files and create or upload Live scripts.
- Examples: Live scripts
- Back to Animations, select any of the Live scripts you uploaded, check the Led Panel and / or Serial Output for results
- Open the Edit area and change things in the code, see the Serial Output for results
Developing
- Read the ESP32 Sveltekit docs
- Read Customizing Sveltekit
- Instead of cloning the repo directly from MoonLight as described above, create a fork first so you have your own environment to make changes to. See also Pull Requests below.
- 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
- Changes made to the UI are not always visible in the browser, issue with caching / max-age (WIP), clear the browser cache to see latest UI.
Pull Requests
-
Want to make changes: fork the repo and submit pull requests, see creating-a-pull-request-from-a-fork:
- Login to your own github account
- Fork: go to MoonModules/MoonLight and press Fork, uncheck 'Copy the main branch only' and press Create Fork. You will be moved to your fork of MoonLight
- Press Branches, press New Branch, give it a name e.g. background-script and press Create new Branch, click on background-script
- Go to the file you want to change press edit and make the changes. E.g. change executable.execute("main") to executable.executeAsTask("main")
- Press Commit Changes..., enter a commit message and an extended description, Press Commit Changes
- Go back to the homepage of your fork myfork/MoonLight. There is a message inviting to create a Pull Request. Press Compare & pull request.
- Add a title and Description to the Pull Request and press Create Pull Request
- Note: coderabbit has been installed on this repo, adding intelligent comments in the PR
- The upstream MoonLight repo can now process this PR