This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tina2:octoprint [2023/01/30 17:22] mao [5.Change OctoPrint source file] |
tina2:octoprint [2023/09/07 14:28] (current) caojie |
||
---|---|---|---|
Line 11: | Line 11: | ||
[[https:// | [[https:// | ||
====2.Install image tool==== | ====2.Install image tool==== | ||
- | Download the latest version of [[https:// | + | Download the latest version of [[https:// |
====3.Flash image==== | ====3.Flash image==== | ||
Then: | Then: | ||
Line 20: | Line 20: | ||
====4.Connect Printer==== | ====4.Connect Printer==== | ||
Select TINA2 from the " | Select TINA2 from the " | ||
+ | {{: | ||
---- | ---- | ||
Line 46: | Line 47: | ||
wget http:// | wget http:// | ||
(If your Linux kernel version is not 5.4.79, download the corresponding one from http:// | (If your Linux kernel version is not 5.4.79, download the corresponding one from http:// | ||
- | Use this command to check which version of your Linux kernel: **uname -r**)\\ | + | Use this command to check which version of your Linux kernel |
\\ | \\ | ||
Install the header file : | Install the header file : | ||
Line 52: | Line 53: | ||
{{: | {{: | ||
- | ===b)Download the CH340 serial driver source code and unzip it=== | + | ===b)Download the CH340/ |
wget http:// | wget http:// | ||
unzip ch341ser_linux-kernel5.4.79.zip | unzip ch341ser_linux-kernel5.4.79.zip | ||
Line 66: | Line 67: | ||
{{: | {{: | ||
- | ====5.Change OctoPrint source file=== | + | ====5.Change OctoPrint source file==== |
- | ===a)Open the serial communication python file=== | + | ===a)Test Connection=== |
+ | {{: | ||
+ | **If you can connect the printer**, | ||
+ | \\ | ||
+ | {{: | ||
+ | **If you can not connect the printer**, you need to change | ||
+ | |||
+ | ===b)change the serial communication python file=== | ||
+ | Open the serial communication python file.\\ | ||
Its path seems like this: | Its path seems like this: | ||
/ | / | ||
If your python version is not python3.7, just replace " | If your python version is not python3.7, just replace " | ||
Write this code after opening the serial port and save it: | Write this code after opening the serial port and save it: | ||
- | | + | |
serial_obj.setDTR(False) | serial_obj.setDTR(False) | ||
serial_obj.setRTS(False) | serial_obj.setRTS(False) | ||
- | {{: | + | serial_obj.oopen() |
+ | # force reboot printer | ||
+ | time.sleep(0.1) | ||
+ | serial_obj.setDTR(True) | ||
+ | serial_obj.setRTS(True) | ||
+ | time.sleep(1) | ||
+ | serial_obj.setDTR(False) | ||
+ | serial_obj.setRTS(False) | ||
+ | # wait | ||
+ | time.sleep(3) | ||
+ | (**Be careful**, the OctoPrint source file uses spaces as indent.) | ||
+ | {{: | ||
====6.Reboot your Raspberry Pi and Connect the printer with its baud rate==== | ====6.Reboot your Raspberry Pi and Connect the printer with its baud rate==== | ||
===a)Reboot your Raspberry Pi, then add tina2 settings to the profile.=== | ===a)Reboot your Raspberry Pi, then add tina2 settings to the profile.=== | ||
Line 83: | Line 104: | ||
===b)Connect printer with 1000000 baud rate=== | ===b)Connect printer with 1000000 baud rate=== | ||
- | ---\\ | + | {{: |
---- | ---- | ||
Line 92: | Line 113: | ||
Install OctoPrint following the [[https:// | Install OctoPrint following the [[https:// | ||
\\ | \\ | ||
- | **If you can connect the printer | + | **If you can connect the printer |
\\ | \\ | ||
**If you can not connect the printer with OctoPrint**, | **If you can not connect the printer with OctoPrint**, | ||
Line 102: | Line 123: | ||
===b)Install your Linux kernel header package=== | ===b)Install your Linux kernel header package=== | ||
sudo apt install raspberrypi-kernel-headers | sudo apt install raspberrypi-kernel-headers | ||
- | ===c)Download the CH340 serial driver source code and unzip it=== | + | ===c)Download the CH340/ |
wget http:// | wget http:// | ||
unzip ch341ser_linux-kernel5.4.79.zip | unzip ch341ser_linux-kernel5.4.79.zip | ||
Line 115: | Line 136: | ||
sudo depmod | sudo depmod | ||
{{: | {{: | ||
- | ====3.Reboot your Raspberry Pi and Connect | + | |
+ | ====3.Change OctoPrint source file==== | ||
+ | ===a)Test Connection=== | ||
+ | {{: | ||
+ | **If you can connect the printer**, | ||
+ | \\ | ||
+ | {{: | ||
+ | **If you can not connect the printer**, you need to change the serial communication python file.\\ | ||
+ | |||
+ | ===b)change the serial communication python file=== | ||
+ | Open the serial communication python file which is usually placed in the site-packages of the python directory.\\ | ||
+ | {your python installed directory}/ | ||
+ | Write this code after opening the serial port and save it: | ||
+ | time.sleep(0.5) | ||
+ | serial_obj.setDTR(False) | ||
+ | serial_obj.setRTS(False) | ||
+ | (**Be careful**, the OctoPrint source file uses spaces as indent.) | ||
+ | {{: | ||
+ | |||
+ | ====4.Reboot your Raspberry Pi and connect | ||
===a)Reboot your Raspberry Pi, then add TINA2 settings to the profile.=== | ===a)Reboot your Raspberry Pi, then add TINA2 settings to the profile.=== | ||
{{: | {{: | ||
Line 121: | Line 161: | ||
{{: | {{: | ||
- | ===b)Connect printer with 1000000 baud rate=== | + | ===b)Connect |
+ | {{: | ||