A visual programming interface built with Nuxt.js and Blockly that enables remote control and programming of GoGo devices through MQTT communication.
- Visual Block Programming: Drag-and-drop interface using Google Blockly
- Real-time MQTT Integration: Bidirectional communication with GoGo devices
- Live Command Capture: Convert remote commands into visual blocks automatically
- Multi-channel Support: Connect to different device channels
- Responsive Design: Collapsible sidebar and mobile-friendly interface
- Code Generation: Convert visual blocks to executable commands
- BlocklyEditor.vue: Main visual programming interface with custom blocks for movement and timing
- SettingsPanel.vue: MQTT connection settings and message monitoring
- Custom Blockly Blocks: Specialized blocks for GoGo device commands (movement, timing, control)
- Remote Topic:
gogo-pgc/remote/<channel>- Receives commands from devices - Blockly Topic:
gogo-pgc/blockly/<channel>- Sends generated code to devices - Control Topic:
gogo-pgc/control/<channel>- Sends control commands (run/stop)
- Node.js 18+
- npm, pnpm, yarn, or bun
# Clone the repository
git clone <repository-url>
cd gogo-pgc-webapp
# Install dependencies
npm install
# or
pnpm install
# or
yarn install
# or
bun installCreate a .env file in the root directory:
# MQTT Configuration
MQTT_BROKER_URL=wss://broker.emqx.io:8084/mqtt
MQTT_REMOTE_TOPIC=gogo-pgc/remote/
MQTT_BLOCKLY_TOPIC=gogo-pgc/blockly/
MQTT_CONTROL_TOPIC=gogo-pgc/control/Start the development server:
npm run dev
# or
pnpm dev
# or
yarn dev
# or
bun run devThe application will be available at http://localhost:3000
-
Connect to a Channel:
- Open the settings panel (left sidebar)
- Enter a channel name (e.g., "robot1")
- Click "Connect" to subscribe to MQTT topics
-
Visual Programming:
- Drag blocks from the toolbox to create programs
- Connect movement blocks (forward, backward, left, right)
- Add timing blocks for delays
- All programs must start with the "Start" block
-
Remote Command Capture:
- Send commands to the remote topic to see them appear as blocks
- Commands are automatically converted to visual blocks
- Supported commands: F (forward), B (backward), L (left), R (right), S (stop)
-
Deploy Programs:
- Click "Download" to send your visual program to the device
- Click the play button to execute the program on the device
- Movement Blocks: Forward, backward, left, right, stop
- Timing Blocks: Wait/delay functionality
- Control Blocks: Start block (required for all programs)
Commands are sent as single character strings:
F- Move forwardB- Move backwardL- Turn leftR- Turn rightS- Stop
Build the application for production:
npm run build
# or
pnpm build
# or
yarn build
# or
bun run buildPreview the production build locally:
npm run preview
# or
pnpm preview
# or
yarn preview
# or
bun run previewThis application is configured for GitHub Pages deployment with a static preset.
# Build for GitHub Pages
npm run build-gh-pages
# Deploy to GitHub Pages
npm run deploy-gh-pages- Build the application:
npm run build - The static files will be in
.output/public/ - Deploy these files to your GitHub Pages repository
The application connects to broker.emqx.io by default. You can modify the broker URL and topics through environment variables.
For GitHub Pages deployment, the base URL is set to /gogo-pgc-webapp. Update this in nuxt.config.ts if deploying to a different path.
Custom blocks are defined in:
blockly/blocks/gogo-block.js- Block definitionsblockly/generators/gogo-generator.js- Code generationblockly/gogo-toolbox.xml- Toolbox configuration
- Verify the broker URL is accessible
- Check that the channel name doesn't contain special characters
- Ensure WebSocket connections are allowed in your network
- Clear browser cache and reload
- Check browser console for JavaScript errors
- Verify all Blockly dependencies are installed
- Ensure the repository has GitHub Pages enabled
- Check that the base URL matches your repository name
- Verify all static assets are properly referenced
- Define the block in
blockly/blocks/gogo-block.js - Add code generation in
blockly/generators/gogo-generator.js - Update the toolbox in
blockly/gogo-toolbox.xml - Add styling in the Blockly theme configuration
- All MQTT logic is centralized in the components
- Message parsing happens in
resolveCommandPacket() - Block creation from commands is handled in
createBlockFromCommand()