Thread Rating:
  • 1 Vote(s) - 5 Average
Control Printer via UART
#11
Hello!
I just found this thread researching exactly this! Took me a while to find anything, almost gave up, even better to see this is actually working!

Looking at that rather beefy TO-220 regulator and the inductor on the opposite side of the PCB, it might be possible to even power a big Pi from the 5V rail, but I cannot read the markings on the photo to look up a datasheet. I'll check when I wire up my uart pins.
Reply
#12
Hello everyone! Super excited to have found this thread!

I also have been trying to find more information on how to send files and print through UART.  I had connected my Elegoo Mars (one with the newer mainboard that doesn’t have the ethernet port) to my computer with an USB to UART adapter. I’m able to connect but the g-code commands located in the pdf provided in a previous post resulted in unexpected behavior. I tried downloading octoprint and using the plugin, but I’m unsure of how complete the plugin is or how to make it function. Any help on serial control would be greatly appreciated.

Ideally, I would love to use an ESP32 board with a TF card and a camera to handle all of these functions, since I’m not really looking for manual remote control. My hope is to send the file from chitubox to the Mars and immediately start the print job.

Could anyone that has gotten reliable results sending g-code commands through serial (TX-RX pins) help with those settings?  Thanks for any help or guidance!
Reply
#13
Hi, 

I plugged  my Elegoo Mars on a linux server in my basement using a USB to Serial adapter. 

The serial baud is 115200, to test you can use screen /dev/ttyUSBx 115200 to display results and a simple echo "xxxx" >> /dev/ttyUSBx to send gcode in another terminal.

The most interesting point is to be able to send file to the USB flash drive, but M28 is not documented.. and it seems to be a different protocol on the Anicubic Photon (https://github.com/Photonsters/Universal...wFrame.cpp).

I'm here :

Code:
>> M28 test.txt
File deleted :test.txt
ok N:536925260

>> whatever i sent
ok 536925260

>> M29
ok 536925260
Done saving file!
// test.txt

N: + something may means NOK so this is not the right syntax. No..
536925260 is probably the space left on my USB flash drive.  No it act as a pointer
But the file is empty.

In Photon Github's code he send for each packet of data : 
Code:
data (0x500 bytes) + offset (4 bytes litle-endian) + checksum (1 byte XOR like) + 0x83
ex : echo -ne "test\x00\x00\x00\x00\x16\x83" >> /dev/ttyUSB0
 
I tried without success ! I think this way to use M28 is for the old board version with ethernet plug, in the newer it might be different.. But without being able to decrypt the firmware, or dumping it from the board itself, we won't guess the protocol used !
Reply
#14
No one have a clue for M28 ??

Here are Mxx GCODE known working

Code:
M20 'xxx' (list folder content)
M23 xxx (select file)
M27 (print state)
M28 (create file)
M29 (end creating file)
M30 xxx (delete file)
M33 (stop printing)
M114 (get current position)
M115 (firmware Info)
M4000 (status >> B:0/0 X:0.000 Y:0.000 Z:154.840 F:256/256 D:0/0/0)
M4001 (returns the configured stepper movement for all axis >> X:0.011430 Y:0.011430 Z:0.000625 E:0.001340 T:0/0/0/158/1 U:'GBK' B:1)
M4002 (version)
M4004 (? return ok C:0 or ok C:1)
M4005 (?)
M4006 (last selected file)
M4010 (?)
M4011 (? related to M4012)
M4012 Ix (? return ok 0/x)
M6032 'xxx' (select file in memory)
M6040 Ixxx (reboot after xxx ms)
M6054 'xxx.png' (show image)
M8030 Ix (fan : 0 off, -1 always on, -2 on when printing only)
M8093 I1 (dump error code status)
M8512 'xxx' (dump eeprom config in file)

If someone find another ..
(I know there's a PDF on this post with some GCODE)
Reply
#15
I managed to dump firmware using a ST-LINK v2 & OpenOCD or with STM32FLASH & USB to serial adapter.

Code:
Mainboard         ST-LINK

SWC9 / EN ------- SWCLK
GND ------------- GND
SWI7 / DIR ------ SWDIO
VCC / 3V3 ------- 3V3
B0 -------------- 3V3 (BOOT0 pull up)

openocd -f share/openocd/scripts/interface/stlink.cfg -f share/openocd/scripts/target/stm32f4x.cfg
telnet localhost 4444
dump_image dump.bin 0x08000000 0x00040000

OR ------------------------------------------------------------

Mainboard         USB to Serial adapter

GND ------------- GND
RX -------------- TX
TX -------------- RX
5V -------------- 5V
B0 -------------- 3V3 (BOOT0 pull up)

stm32flash -r dump.bin COMx

[Image: attachment.php?aid=129]
(not mine)

Now i have to disassemble it.. i don't know if i can post my dump ?
Reply
#16
I feel lonely  Sad
Reply
#17
(06-07-2020, 08:41 AM)dadwarf Wrote: I feel lonely  Sad

Great work!
Getting the full communication protocol would maybe allows us to use the wifi port on the chitu L 5.5 with an inexpensive esp-01 board
Reply
#18
(06-07-2020, 04:02 PM)fcobcn Wrote:
(06-07-2020, 08:41 AM)dadwarf Wrote: I feel lonely  Sad

Great work!
Getting the full communication protocol would maybe allows us to use the wifi port on the chitu L 5.5 with an inexpensive esp-01 board

For the chitu L5.5 you had already the whole protocol : that the same as Anycubic Photon. I don't own one myself but all the protocol is described in the photonsters 's Github : ChituClientWifiProtocol-translated.txt
But thanks you for your support, the goal is an octoprint plugin or a standalone app for both models of Elegoo Mars.. I need some help with the exploration of the firmware's dump : assembler is not easy to parse for me..
Reply
#19
Hi folks, long time. I recently sold my Mars Pro, but before that I had documented a ton of compatible gcodes through trial and error with the help of Marco. I hope this help anyone still interested in writing software the interfaces with the serial port (or ESP proxy, cool idea!) on the Mars.

https://docs.google.com/document/d/14UBM...LOs3o/view

Oh, almost forgot. Marco wrote an awesome chitubox file stream receiver proof of concept. The intent was to use a RPi ZeroW in mass storage gadget mode running this script to send files to natively from chitubox (also documented in the gdoc above). It works and could be used to add similar functionality to an octoprint plugin if someone wanted to port it.

https://github.com/MarcoAntonini/chitubox-file-receiver
Reply
#20
(10-09-2020, 05:07 PM)revnull Wrote: Hi folks, long time. I recently sold my Mars Pro, but before that I had documented a ton of compatible gcodes through trial and error with the help of Marco. I hope this help anyone still interested in writing software the interfaces with the serial port (or ESP proxy, cool idea!) on the Mars.

https://docs.google.com/document/d/14UBM...LOs3o/view

Oh, almost forgot. Marco wrote an awesome chitubox file stream receiver proof of concept. The intent was to use a RPi ZeroW in mass storage gadget mode running this script to send files to natively from chitubox (also documented in the gdoc above). It works and could be used to add similar functionality to an octoprint plugin if someone wanted to port it.

https://github.com/MarcoAntonini/chitubox-file-receiver
What a fantastic resource! I haven't been back here in a while, but am glad to hear that there was so much progress.  Thank you so much for the update!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)