Skip to content

Conversation

@hashb
Copy link
Member

@hashb hashb commented May 20, 2025

I've implemented a backend system to send G-code commands directly to a GRBL-based pen plotter via a serial connection.

Key changes include:

  • Added grbl_communicator.py with a GRBLCommunicator class to handle serial connection, G-code command sending, and GRBL response parsing ('ok', 'error').
  • Updated the /api/send_job route in app.py to utilize GRBLCommunicator for processing and sending G-code jobs. Includes default serial port and baud rate configuration.
  • Added pyserial to requirements.txt for serial communication.
  • Implemented comprehensive unit tests for GRBLCommunicator in test_grbl_communicator.py, using unittest.mock to simulate serial port interactions.
  • Updated README.md with details on the new backend, configuration instructions for serial port/baud rate, and dependency information.

The system now allows you to send G-code from the frontend, which is then relayed to the connected GRBL device. Error handling for connection issues and GRBL errors is included.

I've implemented a backend system to send G-code commands directly to a GRBL-based pen plotter via a serial connection.

Key changes include:

-   Added `grbl_communicator.py` with a `GRBLCommunicator` class to handle serial connection, G-code command sending, and GRBL response parsing ('ok', 'error').
-   Updated the `/api/send_job` route in `app.py` to utilize `GRBLCommunicator` for processing and sending G-code jobs. Includes default serial port and baud rate configuration.
-   Added `pyserial` to `requirements.txt` for serial communication.
-   Implemented comprehensive unit tests for `GRBLCommunicator` in `test_grbl_communicator.py`, using `unittest.mock` to simulate serial port interactions.
-   Updated `README.md` with details on the new backend, configuration instructions for serial port/baud rate, and dependency information.

The system now allows you to send G-code from the frontend, which is then relayed to the connected GRBL device. Error handling for connection issues and GRBL errors is included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant