Giter Club home page Giter Club logo

flashforge-toolkit's Introduction

Flashforge Toolkit

An small toolkit for Flashforge printers that contains a NestJS backend serving data and a static Vue3 front-end (showing that data and the printer's webcam) in a single package.

Back-End Instructions

Installation

$ yarn install

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Extra Info

Inside the app.service.ts you can find where to put your printer's IP address (make sure it's a static IP set in your router!), that's all you need in order to start seeing data from your printer in the front-end.

Front-End Instructions

Installation

First go inside the the flashforge-toolkit-client folder (or open it with another VSCode window), then run the commands below.

$ yarn install

Running the app

$ yarn dev

Building the app

$ yarn build

Extra Info

The code was made ugly on purpose so its easier to understand all it does. Everything in the app depends on the backend (you don't need to set IP addresses or anything, really, in there).

Warning: Running it in real time with yarn dev will not deploy it to the backend (aka prod), so for any changes you need to deploy, run yarn build. The backend automatically picks it up from the front-end's /dist folder. No need to copy-paste.

License

ISC

flashforge-toolkit's People

Contributors

pedrocx486 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

flashforge-toolkit's Issues

[FEATURE] Sending files to the printer

Need to implement the TCP Socket transport method needed to send GX files to the printer.

How it works (reverse engineered with wireshark):

(Tested on the Flashforge Finder)

1- Send this command: 'M28 {file_size} 0:/user/{file_name}.gx'

(Max length for file_name is 36 bytes, in case it's more truncate it.)

2- Then slice the file in 4080 bytes sized chunks, then add 16 bytes at the beginning of each chunk, making it a 4096 bytes sized chunk. Aftert that send only one chunk each time.

The first four bytes should be 0x5a, 0x5a, 0xa5, 0xa5.

Next four bytes should be a four byte unsigned big endian counter starting at 0, incrementing each chunk.

Next four bytes should be a four byte unsigned big endian data length (that length being 4096, representative of each chunk, except last for the last chunk which may not be 4096).

The last four bytes should be a big endian CRC32 of the data for that chunk.

That should make a 16 byte "header".

Then the add rest of the chunk in the rest of the available the bytes, making it 4096 bytes in total per chunk.

The last chunk has to be padded with 0x00 until the data length is 4096 bytes because it may not be the full size. The CRC on the final chunk is for the data without the padding.

3- Send the commands in sequence 'M29', 'M23 0:/user/.gx' to start printing.

All commands can be sent using the already existing socket code within the API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.