logo elektroda
logo elektroda
X
logo elektroda

Print Server WiFi on ESP32-C3 by piotr_go

piotr_go 5028 21
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Electronic module with various connectors and an SD card mounted on a PCB. .
    Print3D server page showing a list of 3D printing files .

    Hello.
    Due to the fact that I have a Ender 3 Pro printer, which is no longer the latest one, and I got bored of constantly chasing the card back and forth I decided to do something about it. Searching the internet didn't help much, I didn't find what I wanted. Plugging in a Raspberry Pi didn't interest me, projects with ESP32 were either too slow or required plugging in instead of a printer card. I didn't like these ideas very much so I decided to make something of my own. Connected exclusively via UART. It was going to be reasonably fast uploading over WiFi, with no water features. Printing could not be slower than from a card connected directly to the printer.
    A few days later I already had the first prototype code.
    At first I experimented on the ESP32-S3, then I moved to the cheaper ESP32-C3.

    Requirements: .
    In marlin you need to set the receive buffer to a minimum of 1kB ("Configuration_adv.h").
    Code: C / C++
    Log in, to see the code
    .

    Limits: .
    Soft does not support errors.

    Scheme: .
    ESP32-C3-WROOM board schematic for a 3D print server. .
    The printer is connected to RXD0/TXD0 (note, 3.3V logic).
    Baud rate 115200.

    PCB: .
    Electronic module with various connectors and an SD card slot. Electronic module on a wooden background, with a USB-C port and SMT components. ESP32-C3 module mounted on a PCB. .

    Print server installed in the Ender 3 Pro printer:
    ESP32-C3 module connected to Ender 3 Pro printer with a red LED indicator. Adapter on Ender 3 Pro printer. .

    The circuit can be assembled on cheap modules from Ali.......:
    ESP32-C3 module connected to a microSD card adapter using cables. .

    Put the file "wifi.txt" with the network name and password (2 lines) on the card.
    When the printer is switched on, the display will show the IP address that the printer has received.

    Fire up the browser, type in the address and you can upload files:
    Print3D server page showing a list of 3D printing files .
    The upload speed is approximately 300...600kB/s.

    When printing, both the web interface and the LCD display show progress:
    Printing progress bar showing 67%. .
    Ender 3 Pro printer screen during printing, showing 16% progress. .

    When the printout is complete, we can see the printing time on the display:
    Ender-3 Pro printer display showing parameters and print time. .

    Printing time for an example 32MB file:
    - from printer card 6h25m +-1m
    - from ESP32-C3 card 6h25m +-1m
    Two 3D printed cat figurines on a wooden surface. .

    Interest:
    Comparison of HTML code differences between two file versions. .
    "diff" from the image shows the difference between not working and working code.
    The text editor I'm using doesn't display anything but brackets and plus/minus there.
    There is no invisible character.
    Only a peek in the hex-editor reveals the extra bytes after the brackets.
    Differences in code in a hex editor using diff example. .
    I came across such wonders while writing the software.

    Soft attached.
    Commercial use prohibited.

    Cool? Ranking DIY
    Do you have a problem with Raspberry? Ask question. Visit our forum Raspberry.
    About Author
    piotr_go
    DIY electronics designer
    Offline 
    piotr_go wrote 2834 posts with rating 3187, helped 91 times. Been with us since 2003 year.
  • ADVERTISEMENT
  • #2 21350652
    Anonymous
    Level 1  
  • #3 21350668
    piotr_go
    DIY electronics designer
    There is shit..... wifi in all the raspberry pi's I have. The ESP32-C3 is tiny, costs $2 and works as expected.
    I am not going to invest more money in this printer. This is probably its last modification.
  • #4 21350936
    mmaker
    Level 19  
    I have such an ender paired with an orange pi zero 2 and an octoprint server on it. All in all, it's an interesting alternative to a small SBC because it's quicker to get up than such a server with full-fledged Linux. I'm just converting my second printer to a laser plotter and will probably be tempted to test it 😉 .
  • ADVERTISEMENT
  • #5 21351198
    george2002

    Level 21  
    It seems silly to ask but what is the difference between my colleague's software and the ESP3D version of the software which does the same thing plus you can control the printer via the website :) ?
  • #6 21351228
    piotr_go
    DIY electronics designer
    As far as I know there are 2 options to choose from in ESP3D:
    - a very woooooooool upload (single kB/s) to the printer card via UART
    - card shared between printer and esp32 (more connections, more complicated circuit, switches...).
    No streaming from the ESP32->UART card (I asked the author).

    In my case there is fast upload to the card and streaming.
    Only 4 cables (- + RX TX).

    I was not interested in the control because the printer is in a different room than the computer.
  • #7 21351365
    linuxtorpeda
    Level 26  
    Have you not thought about using a WiFi-SD adapter, such as the ezShare available on AliExpress?
  • #8 21351372
    Anonymous
    Level 1  
  • #9 21351646
    piotr_go
    DIY electronics designer
    linuxtorpeda wrote:
    Have you not thought about using a WiFi-SD adapter, such as the ezShare available on AliExpress?
    .
    I think I even have one somewhere. I had completely forgotten about it. I was not happy with the operation with the camera.
    Does it work in SPI mode? Unfortunately I don't have an adapter for the micro to test.

    After looking for a while...
    And no, sorry, the "PQI Air" I have.

    ===== update =====
    I was uncomfortable with that name so I logged on to Ali....
    Turns out I was also buying an ezShare, but where it is, I don't know.
  • ADVERTISEMENT
  • #10 21351764
    linuxtorpeda
    Level 26  
    piotr_go wrote:
    Does it work in SPI mode? Unfortunately I don't have an adapter for micro to test.
    .
    I have no idea. I'm asking because I'd like to find out myself if it's worth buying a :) .
  • #11 21351898
    rjmp
    Level 9  
    Can something be uploaded during printing or do you have to wait until the end of printing?
  • #12 21351982
    piotr_go
    DIY electronics designer
    rjmp wrote:
    When printing...
    .
    I have blocked the upload, only the print progress is displayed.
    When writing, the card may block for a moment which would be visible on the printout.
  • #13 21352256
    getek313
    Level 11  
    A couple of questions:
    1. given a printer-independent power supply, would server_print be available to write all the time?
    2. if so, when the printer is started, can the saved files be run or does the server_print have to be reset?
    3. are the saved files visible from the printer menu? And can these files likewise be run from the printer?

    I have ESP3D myself and am not happy with the transfer. I rarely use this option. Your solution is very much to my liking.
  • #14 21352310
    piotr_go
    DIY electronics designer
    1. yes, but...
    2. can, but...
    3. no, no

    'but...': You should not do this. A printer processor without power will get a high state on the data lines.
    There is a chance that after a long period of time something may be damaged.
    When the power is switched on, the printout may not start properly.
  • #15 21352600
    DJ MHz
    Level 25  
    Nice design, but I prefer octoprint and full integration with apps in HomeAssistant and on android ;) .
  • #16 21352707
    etet
    Level 15  
    I did something similar. I took advantage of the fact that in my printer the SD slot is on a separate board. I cut the printer completely off from the card for the duration of the transmission (set the appropriate state on the physical card detection line) and took over all the card lines. On the ESP32, if I remember correctly, I achieved something between 2 and 3MB/s.
  • #17 21352756
    piotr_go
    DIY electronics designer
    A lot. Megabytes or megabits? WiFi<--->SD? SPI/SDIO? Write/read?
  • #18 21352839
    etet
    Level 15  
    Bytes. I was generally interested in writing WiFi => SD. I never polished the design because there were other problems with the printer.

    Here is some so-so video of me clumsily trying to show the speed in real life.
    https://www.youtube.com/watch?v=hxnvsZrGRXY

    After SPI there is no option. It was SDIO and it was probably on 4 lines. The whole thing was quite sensitive to buffer size settings and various transmission parameters. I lost a heap of time fiddling with those switches. And then came the bamboo.
  • #19 21353075
    error105
    Level 14  
    Octoprint requires quite powerful hardware compared to what it offers and in my opinion is a step backwards and forwards at the same time......
    Either use the Repetier-Server instead of the old-fashioned Octo, or go for the Klipper from Mainsail.
  • ADVERTISEMENT
  • #20 21354565
    rjmp
    Level 9  
    How about adding g-codes to the program to:
    - print stop and pause
    - temperature reading and printing time?
  • #21 21354637
    piotr_go
    DIY electronics designer
    rjmp wrote:
    - stop and pause printing
    .
    I need to check, but I think it is possible to pause in the printer menu.

    rjmp wrote:
    - reading temperatures and print time
    .
    Temperature reading in the plans.
    Which print time is in question? The elapsed displays on the LCD.

    I'm completely unfamiliar with the web pages, it's going to take a while.
    Out of the whole project, it took me about 90% of the time to create the interface in the browser.
  • #22 21355754
    rjmp
    Level 9  
    In the printer menu it is possible to do a stop/pause but being far from the printer (lan) or very far (wan) and having access to the print preview (esp32cam) a remote stop/pause would be useful.
    "I'm completely unfamiliar with web pages, it's going to come down to a bit. " I believe in Colleague :-) .

Topic summary

The discussion revolves around creating a WiFi print server using the ESP32-C3 for the Ender 3 Pro 3D printer. The original poster sought a solution to avoid the hassle of transferring files via SD card and found existing projects unsatisfactory. They developed a prototype that connects to the printer via UART, allowing for fast uploads over WiFi without the complexities of other solutions. Various responses include suggestions for alternatives like using a Raspberry Pi or WiFi-SD adapters, but the ESP32-C3 is favored for its cost-effectiveness and performance. The conversation also touches on the limitations of existing software like ESP3D and the potential for adding features such as remote control and temperature monitoring.
Summary generated by the language model.
ADVERTISEMENT