area515 / Photonic3D

Control software for resin 3D printers
http://photonic3d.com
GNU General Public License v3.0
132 stars 115 forks source link

Can't start a configured printer? #209

Closed seanmurphy2 closed 8 years ago

seanmurphy2 commented 8 years ago

Hey I've built my DLP printer and it works in CW, but there seems to be some trouble connecting to it through the web dashboard in CWH. I've plugged my Arduino/RAMPS into the raspberry pi in both USB ports and there's some acknowledgement LED on the Arduino, but it won't start. If I click start, a message box saying "Error On startPrinter This printer:SeansPrinter2 is being started. Can't start again." appears. Am I missing a step in configuring the machine?

Thanks for your help. This is a pretty cool project.

kloknibor commented 8 years ago

Hi Sean,

To be honest I missed your question for help... Was just scrolling and found your post, sorry about that! Can you give us maybe some more detail? What version are you running? area515 or maybe the dev repo? or maybe you installed our image on your SD card?

What firmware are you using on the arduino? And I don't quite understood what you meant with in "both USB ports" does your setup needs 2 usb connections to work proparly?

Also it would be nice if you could set up your (g)mail in the settings and get us the logs so we can see what went wrong.

If you got anymore information please let us now ;)!

jmkao commented 8 years ago

There should be a "Download" link in the corner of each panel. if you click on it, you will download a LogBundle.zip that would be helpful in diagnosing the issue you describe.

WesGilster commented 8 years ago

That's awful strange, how did we all miss his question from 9 days ago?

I believe our dev version covers several of these "Can't start printer again" issues. However, as jmkao said, I would need to see the LogBundle.zip download to be sure this is fixed in the dev version.

kloknibor commented 8 years ago

for some reason we (or atleast I) didn't got an notification e-mail about this question... While I'm automatically subcribed to the notifications... So something must gone wrong at githubs side I suppose.

seanmurphy2 commented 8 years ago

So I've since acquired a Raspberry Pi 3 and tried again. I don't get that error message when clicking Start anymore, but also nothing happens when I click Start (e.g. i can't manually jog the motor to see if it's working). Also I can't see any download button anywhere. Screenshots may be helpful: http://puu.sh/oxsvt/2bc7a309a4.png http://puu.sh/oxsz3/83d9bebde4.png

I followed the Youtube tutorial for downloading the area515 build presumably.

I'm using one USB port for the RAMPS and one for the projector serial control. Disconnected the projector for now, no difference.

For notifications, Github initially decided I was a robot and hid my profile/posts, so I guess a notification didn't get sent when I confirmed that I am in fact human.

jmkao commented 8 years ago

Hmm.. I see, the download is only in the dev branch. What I would suggest is that you re-install CWH against the WesGilster repository by doing the following:

  1. Download: https://raw.githubusercontent.com/WesGilster/Creation-Workshop-Host/master/host/bin/newstart.sh
  2. Run ./newstart.sh WesGilster

This will replace the version of CWH running in /opt/cwh but will retain all of your machine and slicing profiles.

seanmurphy2 commented 8 years ago

Ok great, I've done that and it shows version 0.278 instead of 0.277, which indicates success. Still no luck starting though?

jmkao commented 8 years ago

You should see download links now in each panel to get LogBundle.zip.

seanmurphy2 commented 8 years ago

Not that I can find... is it worth doing an image install instead? http://puu.sh/oxwDD/1c372e5e5f.png

jmkao commented 8 years ago

Hmm... The newest WesGilster build is 0.298. 0.278 should not have come from that repo.

Can you download newstart.sh from https://raw.githubusercontent.com/WesGilster/Creation-Workshop-Host/master/host/bin/newstart.sh again and run ./newstart.sh WesGilster again?

This time, also capture the output of the command can paste it into the issue.

seanmurphy2 commented 8 years ago

Okay great, I tried again and it updated to 0.298 with download buttons LogBundle_1.zip

This is the output, probably unnecessary since it seems to have worked http://pastebin.com/giN8k55n

jmkao commented 8 years ago

From the logs, it seems that you have selected your projector serial connection to be "Autodetect Projector" and at printer start, the serial projector detection routine is unable to detect your projector.

Can you tell us what model projector you have, and what model RS232-USB adapter you are using?

As a temporary workaround, you can unset the projector serial port (set the dropdown to "Select a serial port...")

You also have your output display currently set to "Simulated Display". You'll need to set that to ":0.0" or "Last available display" in order to actually print.

seanmurphy2 commented 8 years ago

LogBundle_5.zip Okay, I thought it would connect at least just to the arduino without the projector. I've connected the projector and tried again, and I can see that it does connect to the arduino (Marlin echo shows up in the log), but there's some error connecting to the projector. The projector is an Acer X152H which connects fine to CW through the serial-USB converter to my PC. I ran lsusbon the pi and it came up with

Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 004: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)

Running dmesggives [ 3.868004] usb 1-1.5: Product: USB2.0-Ser! [ 15.814360] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs [ 15.825728] EXT4-fs (mmcblk0p2): 1 orphan inode deleted [ 15.835738] EXT4-fs (mmcblk0p2): recovery complete [ 16.034889] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. O pts: (null) The error message is now

Couldn't determine model of projector on port:/dev/ttyUSB0

So it seems like the RPI is connecting fine to the projector, it's just sending the wrong start message? Didn't think that would be a problem for a standard Acer projector.

WesGilster commented 8 years ago

I'm not completely convinced it's a good idea yet, but, I'll open a feature request to have a graceful startup in the event that non-critical resources(serial interface to a projector) isn't available. That would be pretty easy to do until the next user considers the serial interface a critical resource. Either way we should have a discussion about it.

This looks pretty good: 2016-04-30 06:29:32,521 DEBUG o.a.r.s.SerialManager [qtp6422935-40] 3dprinter firmware found on:{Port:/dev/ttyACM0 speed:115200 databits:8 parity:None stopbits:One handshake:None}

I think that Acer was the second projector that we supported with autodetect, but this doesn't look healthy. It looks like your projector isn't talking back to us since we are timing out on each projector start hex:

2016-04-30 06:29:34,837 INFO o.a.r.s.SerialManager [qtp6422935-40] Completed assignment of firmware using serialPort:/dev/ttyACM0 with settings:{Port:/dev/ttyACM0 speed:115200 databits:8 parity:None stopbits:One handshake:None} to printer:SeansPrinter2(printerFirmwareSerialPort:/dev/ttyACM0, projectorSerialPort:null Display::0.0)
2016-04-30 06:29:34,838 DEBUG o.a.r.p.PrinterManager [qtp6422935-40] Assigned 3dprinter firmware:Autodetect 3d printer firmware to:SeansPrinter2(printerFirmwareSerialPort:/dev/ttyACM0, projectorSerialPort:null Display::0.0)
2016-04-30 06:29:34,854 INFO o.a.r.s.SerialManager [qtp6422935-40] Attempting to assign projector using serialPort:/dev/ttyUSB0 with settings:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None} to printer:SeansPrinter2(printerFirmwareSerialPort:/dev/ttyACM0, projectorSerialPort:null Display::0.0)
2016-04-30 06:29:34,856 INFO o.a.r.s.SerialManager [qtp6422935-40] Attempting to autodetect resources for:Projector using serialPort:/dev/ttyUSB0 with settings:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None} to printer:SeansPrinter2(printerFirmwareSerialPort:/dev/ttyACM0, projectorSerialPort:null Display::0.0)
2016-04-30 06:29:34,877 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Are you using projector:Optoma (HD141x)
2016-04-30 06:29:34,879 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Projector settings from printer configuration:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:34,880 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Merged settings from projector:{Port:null speed:9600 databits:8 parity:None stopbits:One handshake:null} and attempting detection with: {Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:34,888 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Are you using projector:Vivitek (D535)
2016-04-30 06:29:34,889 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Projector settings from printer configuration:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:34,890 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Merged settings from projector:{Port:null speed:9600 databits:8 parity:None stopbits:One handshake:null} and attempting detection with: {Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:39,966 DEBUG o.a.r.p.HexCodeBasedProjector [qtp6422935-40] Timeout after bytes read ""
2016-04-30 06:29:39,967 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Are you using projector:Acer
2016-04-30 06:29:39,968 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Projector settings from printer configuration:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:39,968 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Merged settings from projector:{Port:null speed:9600 databits:8 parity:None stopbits:One handshake:null} and attempting detection with: {Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:44,975 DEBUG o.a.r.p.HexCodeBasedProjector [qtp6422935-40] Timeout after bytes read ""
2016-04-30 06:29:44,997 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Are you using projector:ViewSonic (pjd7820hd)
2016-04-30 06:29:44,998 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Projector settings from printer configuration:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:44,998 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Merged settings from projector:{Port:null speed:115200 databits:8 parity:None stopbits:One handshake:null} and attempting detection with: {Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:50,004 DEBUG o.a.r.p.HexCodeBasedProjector [qtp6422935-40] Timeout after bytes read ""
2016-04-30 06:29:50,027 DEBUG o.a.r.s.SerialManager [qtp6422935-40] Projector model not detected on:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}
2016-04-30 06:29:50,028 INFO o.a.r.s.SerialManager [qtp6422935-40] Resources detected:{comPort:/dev/ttyUSB0 model:null settings:{Port:/dev/ttyUSB0 speed:9600 databits:8 parity:None stopbits:One handshake:None}}
2016-04-30 06:29:50,029 ERROR o.a.r.p.PrinterManager [qtp6422935-40] Error starting printer:SeansPrinter2
org.area515.resinprinter.display.InappropriateDeviceException: Couldn't determine model of projector on port:/dev/ttyUSB0

Next step is to have you run a diagnostic utility that comes with Photonic 3D to determine if we have a hardware issue. Carefully read the steps that the program prompts you with to see if you are able to control the functions of your projector with this utility. If you are still timing out with this app, there are deeper issues to resolve. If you know the projector codes for your projector, you can also manually enter them as well. Make sure to test every function to ensure that you receive a "Match" after execution.

sudo pkill -9 java
cd /opt/cwh
sudo java -Djava.library.path=/usr/lib/jni:os/Linux/${cpu} -cp lib/*:. org.area515.resinprinter.projector.ProjectorOutput
seanmurphy2 commented 8 years ago

Running that code gave this error unfortunately pi@raspberrypi:~ $ sudo pkill -9 java pi@raspberrypi:~ $ cd /opt/cwh pi@raspberrypi:/opt/cwh $ sudo java -Djava.library.path=/usr/lib/jni:os/Linux/${cpu} -cp lib/*:. org.area515.resinprinter.projector.ProjectorOutput Error: Could not find or load main class org.area515.resinprinter.projector.ProjectorOutput

Also attempting to follow some guides I've read to manually send serial codes like OKOKOKOKOK\r and * 0 IR 001\r while listening to the port via cat -v < /dev/ttyUSB0 didn't work. I'm at a bit of a loss that it responds to serial commands from windows but not the pi.

jmkao commented 8 years ago

Strange, there were some builds in the past that did not properly bundle the tests, but 0.298 is reasonably new and should have them.

Can you do a ls /opt/cwh/lib/phot* and see whether you get only photonic3d.jar or also photonic3d-tests.jar, which is where org.area515.resinprinter.projector.ProjectorOutput is located.

In any case, the current stable build, which was recently promoted into production, has this for sure. So if you run newstart.sh or start.sh (with no arguments), you should get updated to that version and be able to launch ProjectorOutput.

Don't be too concerned that cat -v < /dev/ttyUSB0 doesn't work. In order to make serial ttys work properly, you also need to set a bunch of ioctls on the fd. This is only done by actual terminal programs like minicom.

seanmurphy2 commented 8 years ago

Yeah you're right, on 0.298 I only got photonic3d.jar.

Updated to 0.299 and photonic3d-tests.jar does indeed exist, as does ProjectorOutput. I tried running it on all 4 available ports (although I think USB0 is the one?) with the Acer option of course, but none of them matched. The projector definitely has power and the cable is proven to work on another platform, so I'm really not sure what the problem is here

jmkao commented 8 years ago

Can you paste the output you get when you run ProjectorOutput?

seanmurphy2 commented 8 years ago

It just says "No Match" each time

WesGilster commented 8 years ago

It probably says something of the form: return "No Match\n"

Could we know what that is?

seanmurphy2 commented 8 years ago

After selecting Acer and On Hex for USB0:

Writing:4F4B4F4B4F4B4F4B4F4B0D
No Match
 Hex:0F0B0B0B0F0D090D1A0B1F1F
 ASCII:[B@afa419
Against:null
WesGilster commented 8 years ago

"No Match" is normal for the projector On/Off codes as long as your projector is turning on and off. Matching is only required for autodetection and bulb hours querying.

I can see that your projector is making a serial connection and is talking to back. Is your projector turning on when you are sending the codes? Could you also try the autodetection sequence? My guess is that we have a problem with the hex codes.

seanmurphy2 commented 8 years ago

Yes it certainly isn't turning on. I tried the autodetection option in the web interface (not ProjectorOutput) if that's what you mean but also no luck. Does anyone else have an Acer projector?

kloknibor commented 8 years ago

I got an Acer H6510BD last time I tried I believe it worked fine ;)!

WesGilster commented 8 years ago

I believe you mentioned that you got this working in Windows. What hex codes did you use for powering on and off?

kloknibor commented 8 years ago

Sorry ignore my comment... I did indeed got this working but the projector was connected to the controller board of the printer itself. I flashed the HEX codes inside the firmware of this controller board and when an specific Gcode is send it will turn the projector on or off). But there isn't a direct line from Raspberry pi to projector, sorry!

kloknibor commented 8 years ago

(So yes I did this from windows by puty or CW, just sending the Gcode)

jmkao commented 8 years ago

I've used it on an Acer 6510BD almost daily since Wes added the codes based on on documentation in #103.

It's weird that it doesn't work on another Acer projector.

What kind of USB-RS232 connector are you using?

Also, can you try installing minicom onto your RPi and see if you can send the commands to the serial port manually?

WesGilster commented 8 years ago

Yes, that is odd. @seanmurphy2 did you mention that you had this working on Windows using the same hex codes?

seanmurphy2 commented 8 years ago

I used the Titan 1 software with the default acer codes, which are apparently `OKOKOKOKOK

jmkao commented 8 years ago

Hmm... I see, you have an HL-340 based adapter, which looks like a clone of a CH-340/341 UART.

Can you install picocom on your RPi: sudo apt-get install picocom

and then try to send the on code manually after launching picocom (replace ttyUSB0 with the device that matches the HL-340):

picocom -b 9600 -d 8 -c /dev/ttyUSB0

To exit picocom, enter in Control-a Control-x

Personally, I was able to get manual control with a CH-340 UART based adapter to work, but not reliably, and the RPi disagreed with it and it was impossible to print for more than an hour without having spurious USB bus disconnections that affected the communication to the firmware.

To run stably, I had to switch to a PL-2303 based UART (http://www.amazon.com/dp/B00425S1H8) and since doing so, have not gotten any spurious disconnects.

seanmurphy2 commented 8 years ago

Thanks, picocom seems to connect on USB0, but none of the codes I tried worked. Sigh. It's looking like the pi is never going to work with the projector.

port is : /dev/ttyUSB0 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 escape is : C-a local echo is : yes noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv imap is : omap is : emap is : crcrlf,delbs,

Terminal ready

I tried

4F4B4F4B4F4B4F4B4F4B0D 0F0B0B0B0F0D090D1A0B1F1F 2A2030204952203030310D 2A203020495220303031

jmkao commented 8 years ago

Can you do a dmesg | grep 340 and see what behavior the kernel is reporting about the device? That will help us determine more definitively where the UART is being assigned and whether it is behaving well.

jmkao commented 8 years ago

Ohh... sorry, I didn't notice something. When you access the serial port via a terminal program, you have to send the codes in ASCII, so try sending:

OKOKOKOKOK

To see if the projector turns on.

Or try:

* 0 IR 002

to turn the projector off.

Still send me the dmesg output, though. That will give me an idea as to whether the HL-340 is giving you trouble at the hardware level.

seanmurphy2 commented 8 years ago

Yeah I tried OKOKOKOKOK and with a carriage return. Is there more dmesg output you want other than the above segment?

[ 3.868004] usb 1-1.5: Product: USB2.0-Ser! [ 15.814360] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs [ 15.825728] EXT4-fs (mmcblk0p2): 1 orphan inode deleted [ 15.835738] EXT4-fs (mmcblk0p2): recovery complete [ 16.034889] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. O pts: (null)

jmkao commented 8 years ago

Yeah, I'd like to see a longer segment of the dmesg output, preferably all of it since boot, to see the sequence of USB device discovery and to see whether there are other USB events being posted.

seanmurphy2 commented 8 years ago

dmesg output.txt

kloknibor commented 8 years ago

Hi @seanmurphy2 is there any news on this? Is it working by now? Or still having trouble?

seanmurphy2 commented 8 years ago

I got it working yesterday with a different serial cable. The CH340 cable itself physically works, so I assume there must be some driver problem on the RPi with it.

kloknibor commented 8 years ago

Great to hear! Could you close this issue please?