area515 / Photonic3D

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

Unable to upload files to CWH #161

Closed XiGua89 closed 8 years ago

XiGua89 commented 8 years ago

I am not sure whether this is the right place to post my issue. I successfully installed CWH on the RPi 2. I am able to connect to my printer and move the build-platform. I also ran some test-prints without resin some days ago and everything seemed to work just fine.

Now that my resin arrived I am unable to upload files anymore! 2 hours ago it still worked, now: nothing. I tried several files (.cws maily, but also .stl, .jpg and URLs) and also tried those with different names. Files that I was able to upload before just do not anymore. I am uploading the files from a windows-computer (tried different computers with different browsers as well)

Any help/advice would be greatly appreciated XiGua

kloknibor commented 8 years ago

Hi,

your at the right place! Did you try to reboot? maybe something as lagging... when you upload the files it won't show an progress bar but will wait till it's uploaded and show it in the interface! So be patient. If that also doesn't work please provide us with the log files, in settings you can add your mail adress (only tested with gmail and you need to enable use on weak secured devices) so we can figure out what's going on. for support mail just fill in your own mail and upload the .zip files containing the logs you get sended on here (just drag it into the comment field)

XiGua89 commented 8 years ago

Thanks for your fast response! I rebooted several times and also waited for the uploads

I am having some trouble with the right settings for the support, so i will try it over the weekend and post it asap XiGua

kloknibor commented 8 years ago

Did you try it with an gmail account? go first here : http://www.google.com/settings/security/lesssecureapps : enable acces to apps with lower security. Than enter for username your mail where you want the logs, for support mail your gmail mail. Password is your password gmail. you can leave the outgoing server as is. and your mail your gmail mail also :)!

XiGua89 commented 8 years ago

i can not get get it working (using gmail). this error appears: Failure emailing log bundle:Could not connect to SMTP host: Smtp.gmail.com, port: 0

do i need to configure the wifi setup on the lefthand side? Because i can not select one here

leaving SMTP Hostname empty also did not work

kloknibor commented 8 years ago

Did you fill in as follows?: cwh help

the password you need to fill in is from Yourgmailadres@gmail.com I think you filled out your smtp adress wrong, it should be : smtp.googlemail.com

Did you also already allow acces to less secure apps like I suggested? And you do not need to set wifi ;)!

XiGua89 commented 8 years ago

first of all, thanks a lot for all your help! i really appreciate it

yes, i turned on access for less secure apps.

and i tried it again with smpt.googlemail.com (everything else like you posted, except for Username, here i tried using an outlook-mail or the same gmail like E-Mail Address and Support Email Adress )

now i am getting: Failure emailing log bundle:Unknown SMTP host: smpt.googlemail.com

XiGua89 commented 8 years ago

I just noticed you are working with CWH v0.240, mine is CWH v.0.227

Could this be related with my problem? Also, i believed the CWH on the raspberry should auto-update?

kloknibor commented 8 years ago

e-mail adress and username both should be an gmail adress and the password should be from this e-mail adress ;)! the supportmail can be an outlook adress no problem. I just retried it with this smtp host but I can send it without problems... And yes I use a lot of versions (dev from Wes, Stable from area 515 and dev from own repo but all version can send mail without problems ;)! All previous versions worked for me too... So it should really be the settings... And yes it auto updates on reboot!)

kloknibor commented 8 years ago

(Username and e-mailadress should both be THE SAME adress)

ergobot commented 8 years ago

@XiGua89 - I'm not sure if I read this right or a typo but I think it's smtp instead of smpt.

"now i am getting: _Failure emailing log bundle:Unknown SMTP host: smpt.googlemail.com" On Mar 7, 2016 2:23 AM, "kloknibor" notifications@github.com wrote:

(Username and e-mailadress should both be THE SAME adress)

— Reply to this email directly or view it on GitHub https://github.com/area515/Creation-Workshop-Host/issues/161#issuecomment-193153054 .

kloknibor commented 8 years ago

good catch @ergobot

XiGua89 commented 8 years ago

@ergobot - indeed a typo :)

i am using my gmail for all 3 mails now, smtp without typo, correct password and get the same error: Failure emailing log bundle:Could not connect to SMTP host: smtp.googlemail.com, port: 0

i really do not know what to do anymore :/

kloknibor commented 8 years ago

would you mind to show us an screenshot of how you filled everything in? If you don't want to post it here mail it too : I suspect you got the mail notification with the actual mail adress... Due to spam risks I deleted my mail here again

kloknibor commented 8 years ago

I just tried to use it with all 3 the same gmail adress and it worked without a problem... please copy this to smtp : smtp.googlemail.com

the others you can use the same gmailadress for... Make sure your password is right and you did type in your gmail mail correctly

kloknibor commented 8 years ago

also tried it with 0.227... also no problems at all so it isn't the software...

XiGua89 commented 8 years ago

i just sent you a screenshot, hope i did sth wrong :)

kloknibor commented 8 years ago

I wish I could said that too you too... it all seems perfectly fine as long as you are sure your password is correct... It isn't that you enabled acces to less secure apps wrong because it will give an error like this: Failure emailing log bundle: Username or password incorrect

You pressed save after you set this settings? maybe refresh after clicking save... (this was needed when you enable acces to less secure apps)

XiGua89 commented 8 years ago

yes, i saved and refreshed

anymore ideas? :/

kloknibor commented 8 years ago

yes... complete reinstall... sorry...! I can reach out a bit to you... download this image : https://www.dropbox.com/sh/zlcn2ywya7h8uiq/AAAIlTyP3NgiQLWqqAbUHA2za?dl=0 and it should work out of the box, it's raspbian jessie light with CWH preinstalled made possible by jmkao! However... It is also an unstable(r) dev branch... Yesterday it worked for me but haven't got an chance to test it properly myself

XiGua89 commented 8 years ago

ok, so i just installed it, printer is running again, i can control the motor etc.

uploading cws files is still not working, but sending the support-mail did! ( same settings as used before...) LogBundle.zip

kloknibor commented 8 years ago

Ok I guess I know your last problem :)! gonna look for the clip but I suppose you didn't anbale export to cws ;)!

kloknibor commented 8 years ago

do .stl files or .txt do upload?

kloknibor commented 8 years ago

follow this instruction video : https://www.youtube.com/watch?v=J3HTCkxlKcw

XiGua89 commented 8 years ago

hm, i am quite sure i did. i used compound path (but i am not sure what this one does or is good for)

no, .stl, .cws, .txt all dont work

yes, i used this video before :)

kloknibor commented 8 years ago

Oh never mind... when .stl and .txt don;t work too my instruction video won't help... What error do you get while uploading? I haven't found anything strange yet in the logs... The gcode works fine with your printer and I see you had an error when trying to mail again :P Not seen anything strange other than that

kloknibor commented 8 years ago

Ok so the error is in here somewhere : (HttpChannel.java:311) [jetty-all-9.2.3.v20140905.jar:9.2.3.v20140905] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) [jetty-all-9.2.3.v20140905.jar:9.2.3.v20140905] at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [jetty-all-9.2.3.v20140905.jar:9.2.3.v20140905] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) [jetty-all-9.2.3.v20140905.jar:9.2.3.v20140905] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) [jetty-all-9.2.3.v20140905.jar:9.2.3.v20140905] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65] **2016-03-07 11:03:11,530 INFO o.a.r.j.CreationWorkshopSceneFileProcessor [qtp18312385-18] Accepting new printable testtest.cws as a Creation Workshop Scene 2016-03-07 11:03:11,608 INFO o.a.r.s.PrintableService [qtp18312385-18] File saved to:/tmp/uploaddir/testtest.cws** 2016-03-07 11:03:11,620 ERROR o.a.u.ExceptionMarshaller [qtp18312385-15] Error caught by exception marshaller and relayed to browser java.lang.IllegalArgumentException: MALFORMED at java.util.zip.ZipCoder.toString(ZipCoder.java:58) ~[?:1.8.0_65] at java.util.zip.ZipFile.getZipEntry(ZipFile.java:566) ~[?:1.8.0_65] at java.util.zip.ZipFile.access$900(ZipFile.java:60) ~[?:1.8.0_65] at java.util.zip.ZipFile$ZipEntryIterator.next(ZipFile.java:524) ~[?:1.8.0_65] at java.util.zip.ZipFile$ZipEntryIterator.next(ZipFile.java:480) ~[?:1.8.0_65] at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812) ~[?:1.8.0_65] at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[?:1.8.0_65] at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) ~[?:1.8.0_65] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) ~[?:1.8.0_65] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_65] at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:1.8.0_65] at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:1.8.0_65] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_65] at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449) ~[?:1.8.0_65] at org.area515.resinprinter.job.CreationWorkshopSceneFileProcessor.zipHasGCode(CreationWorkshopSceneFileProcessor.java:275) ~[cwh/:?] at org.area515.resinprinter.job.CreationWorkshopSceneFileProcessor.acceptsFile(CreationWorkshopSceneFileProcessor.java:46) ~[cwh/:?] at org.area515.util.PrintFileFilter.findAssociatedPrintProcessor(PrintFileFilter.java:24) ~[cwh/:?] at org.area515.resinprinter.services.PrintableService.getPrintables(PrintableService.java:207) ~[cwh/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at org.jboss.resteasy.core.MethodInjectorImpl.invoke

I think Wes or James can help you better on this... I see you tried to upload en testtest.cws... And it gives an error about an marshaller or something... ;)! But the others are in a different timezone (I'm from your neighbooring country ;)!) So we will need some patience till they have time!

XiGua89 commented 8 years ago

i do not get any error. its just that nothing happens, even after waiting for a while.

could you upload an easy .cws file so i can test it? (maybe i did do sth wrong while slicing!) or do you think even if .txt wont work, there has to be another issue?

and after the reinstall i am working with CWH v0.227 again, is that normal?

kloknibor commented 8 years ago

If .txt doesn't work than there's something else wrong

kloknibor commented 8 years ago

test.cws.pdf delete the .pdf from the file name and your good to go! This one works fine here... your file uploads fine and it is present on your pi... but handling the file gives an java error...

XiGua89 commented 8 years ago

ok, i will be patient and hope they can help:)

your file also does not work, or at least it doesnt appear...

kloknibor commented 8 years ago

can you supply more infortmation about the pi, wifi dongle (if you use one), power supply, camera (if any) and printer you use? maybe this can help them :)!

XiGua89 commented 8 years ago

it is a selfmade DLP-Printer like the Chimera on insructables (by mastermind):

kloknibor commented 8 years ago

Hmm sounds allright... A little concerned about the power drainage of the stepper and arduino and from the pi... might introduce unstabelity problems but well you could move your motor now... Well Let's wait for the others :)! And which DLP projector you got? You need special hexcodes send over serial connection to your DLP most of the time, these hexcodes can be set in the config files ;)! But you also need the serial connection to your beamer

XiGua89 commented 8 years ago

i am thinking about powering at least the motorshield externally in future steps, but for now i would already be happy to perform my first print :) It is a Optoma HD141X (i updated the list above)

which config files do you mean?:)

kloknibor commented 8 years ago

I think it was config.properties you can find this there : hexCodeBasedProjectors=[{"name":"Acer","onHex":"4F4B4F4B4F4B4F4B4F4B0D", "offHex":"2A2030204952203030320D", "detectionHex":"2A2030204C616D70203F0D",

these are the hexcodes I described you must find them for your projector yourselves ;)! And connect it to the pi with an USB serial converter. the file is by default available in /opt/cwh/

XiGua89 commented 8 years ago

alright i will try at some point

i was just able to upload your test.cws. other files did somehow not work now it seems cwh lost the file again and i can not upload it anymore

kloknibor commented 8 years ago

very strange... files do disappear after an reboot of the pi... but it should be possible to reupload the file...

XiGua89 commented 8 years ago

it doesnt work

jmkao commented 8 years ago

@XiGua89 Thanks for working with us on this!

It looks like projector autodetection is not working, so for now you should disable it and configure your printer like this:

image

Are you by any chance located in China? If so, then accessing Google for e-mailing LogBundle.zip will only work intermittently and it would probably be easier to harvest and upload the logs directly. You can also use SCP (e.g. FileZilla) to get the log off the Raspberry Pi at /opt/cwh/cwh.log. Then attach that file directly to the issue. If you're not in China, than once you have the LogBundle.zip email working once, it should keep on working and we can use that. LogBundle.zip contains additional information besides the logs, and you should continue using that if possible.

I would like to see the .cws file you are using, because according to the log the zip on that is corrupted. I have seen that happen before, where CWS saves a corrupted .cws and there is another working file called .cws###### instead. I would check the location where you are saving .cws files to see if there are those numbered/lettered temp files also in that directory.

The easiest way to attach a .cws file is to zip it (e.g. right-click --> Send To --> Compressed (Zipped) Folder on Windows) and then upload the zip file.

Also, what version of Creation Workshop are you using to generate the .cws file?

I'm looking forward to finding a way to get this working for you!

XiGua89 commented 8 years ago

Hello jmkao, thanks a lot for helping here, this community is great!

i am not located in china and so far the support function seems to work.

I did not find anything else in the location of my cws-files are saved in (i also tried uploading from the desktop). I am using Creation workshop 1.0.0.75 This is my calibration Cube i am planning for my first print: wuerfel.zip

XiGua89 commented 8 years ago

i forgot to mention: i can not configure the printer like you said, following message appears: No serial ports found for:Autodetect 3d printer firmware

WesGilster commented 8 years ago

I don't want to interrupt the stream of troubleshooting going on because everyone is doing great. I just want to take the time to answer questions and put together an assessment here:

and after the reinstall i am working with CWH v0.227 again, is that normal?

Yes this is normal because v0.227 is the latest production release. v0.240 is a development stream release.

very strange... files do disappear after an reboot of the pi... but it should be possible to reupload the file...

I've never experienced this issue and used to think Kloknibor was a bit crazy. Most likely the reason is 1 of 2 different possibilities, the pi is deleting due being in the tmp directory(I thought we were saving in a safer place), or the file wasn't closed properly on upload and JVM kills all open files on improper exit of the JVM. (Rebooting the pi is considered an 'improper' exit of the JVM) My money is on the second one. I can take a look and try to get a fix in the dev stream.

No serial ports found for:Autodetect 3d printer firmware

Generally this is because your com port is already in use. We'll be able to tell for sure if you send us a log bundle. Always try to associate a logbundle with each issue to comment on github if it's a new issue. Basically that bundle describes everything going on inside of CWH.

Is this a full assessment of open questions you have?

XiGua89 commented 8 years ago

Hello Wes, thanks for joining, too

yes, i guess so. besides mentioning the original problem that i can not upload anything.

here is a new log bundle concerning the autodetection of the printer firmware: LogBundle_autodetect.zip (i also tried uploading wuerfel.zip on this one) I would not know how my com port could already be in use?

also i want to apologize in general for any unspecific or insufficient information. It must obviously be due to my lack of knowledge in this matter

WesGilster commented 8 years ago

No problem at all, remember this is beta software so it's not all 'user error'.

Actually I missed one more...

Projector autodetection

Once we've got your other issues resolved, we'll address this one. As the others have already alluded, you'll need a serial cable to connect your projector, and we'll also need to know where to find your projector serial codes if you have them handy.

I can't upload anything

I thought this was resolved, is this not true.

XiGua89 commented 8 years ago

we'll also need to know where to find your projector serial codes if you have them handy.

ok, i did not look for the control commands for my projector yet (i hope this is what you ment)

I thought this was resolved, is this not true.

no, unfortunately it is not true. i am still not able to upload files (no matter what file). like i posted, it seems to work sometimes (very very rare), but i could not detect any "pattern"

jmkao commented 8 years ago

So far, there are two problems:

  1. wuerfel.cws unzips fine with the Windows built-in zip and with 7zip, but Java does not like something about this file. I get the same exception against my local version of 0.227
  2. The presence of the "corrupt" file in /tmp/uploaddir prevents any future uploads from working. This is related to #119. Since acceptsFile() is run constantly on all of the files in /tmp/uploaddir, the "corrupt" file will cause exceptions to repeatedly occur whenever loading the Printables page or trying to upload anything. This will effectively render all interaction with the Printables tab inoperable until the user manually removes the offending file from /tmp/uploaddir. The user cannot use the UI to remove the file because the UI list of printables depends on acceptsFile(), thus once a problematic file reaches /tmp/uploaddir, the list of printables will be empty.

One possible hint is that ZipFile seems to behave differently depending on the Charset that is set (http://stackoverflow.com/questions/20013091/java-unzip-error-malformed), so perhaps using US-ASCII instead of UTF-8 will help.

The problem with the zipfile seems to have something to do with the names of the files in the zip, and not with the zip encoding itself. Even if I unpack and repack the zip file on Windows, the file either continues to fail to upload, or gets the same MALFORMED exception later when I try to print it.

@XiGua89 Most likely, you can get this file to work with a workaround, which would be to save file file in CW as a different name. rather than calling it "Wuerfel 10mm", just name it simply "wuerfel" or something like that, and verify that the contents of the cws zip (rename the .cws to .zip and then open it in the Windows explore) has simple file names like "wuerfel0001.png". Then, SSH into your Raspberry Pi and erase all the files in /tmp/uploaddir. Finally, upload the cws file and let us knows what happens. If there is still a problem, please attach the new cws file to your update.

Thanks!

jmkao commented 8 years ago

If we instantiate ZipFile objects with a charset for ISO-8859-1 or CP437, like:

new ZipFile(jobFile, Charset.forName("ISO-8859-1"));

then this works.

Reading this article: https://blogs.oracle.com/xuemingshen/entry/non_utf_8_encoding_in, I think that CP437 would be the right value to match the zip spec.

WesGilster commented 8 years ago

@jmkao nice job. Did you replicate the disappearing file issue as well, or does this seem to be a different issue?

I think I have a pretty good handle on the:

No serial ports found for:Autodetect 3d printer firmware

2016-03-07 17:18:14,220 DEBUG o.a.r.s.SerialManager [qtp18312385-26] Chitchat was: Grbl 0.9i ['$' for help] from:{Port:/dev/ttyACM0 speed:115200 databits:8 parity:None stopbits:One handshake:None} 2016-03-07 17:18:16,439 DEBUG o.a.r.s.SerialManager [qtp18312385-26] Unknown data:[ok , ok ] received on:{Port:/dev/ttyACM0 speed:115200 databits:8 parity:None stopbits:One handshake:None} 2016-03-07 17:18:16,443 ERROR o.a.r.p.PrinterManager [qtp18312385-26] Error starting printer:MST org.area515.resinprinter.display.InappropriateDeviceException: No serial ports found for:Autodetect 3d printer firmware

It's odd because it says "unknown data" but clearly the data is known and "ok" what I'm guessing happened is that Autodetect isn't liking the \r at the end of the ok. This is a quick fix to make this process more robust, but the current workaround is to stop using Autodetect 3d printer firmware and go back to using /dev/ttyACM0 direct without projector autodetection.

jmkao commented 8 years ago

I'm fairly certain the disappearing file issue has to do with some kind of /tmp management. It's not as ephemeral as restart because Raspbian does not seem to use tmpfs for /tmp, but there must be something somewhere that erases out of there on some rule or schedule.

I'm not sure it's worth tracking down exactly how Raspbian does this, because regardless of how that happens, the solution for us is probably to move persistent storage out of /tmp.

The bigger and harder issue I think is the problem with corrupt files rendering the Printables tab inoperable because of how acceptsFile() constantly iterates all the files in the directory. Forcing people to SSH into the box to do cleanup feels like it should be a last resort.

WesGilster commented 8 years ago

I agree, if it's tmp management, then it's pretty simple.

Forcing people to SSH into the box to do cleanup feels like it should be a last resort.

Oh my gosh no, that would be awful.

I'm not at all convinced that acceptsFile() is somehow corrupting the file. Your zipHasGCode() method is pretty solid(closes nicely) and it's a read only method that doesn't perform any file extraction or write procedures(we perform all of that in the prepare environment). Inefficient, yes because it opens the zip file and loops through the zip meta data on every accept call. However there is no directory extraction process at work there.

I'd like to take a closer look over the area that was rendering the Printables tab inoperable, where did you find that?