Jump to content
IGNORED

Auto-save printouts to tnfs server...


Recommended Posts

Would it be possible to implement (at some point...) an autosave feature that would upload every pdf printout to a designated tnfs server/location...? That would be very handy as it wouldn't require manual "download" for every print job... Suggested naming convention: <hostname>_<printer_name>_<timestamp>.pdf

 

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

I think this is a good idea, but I think it should be expanded upon via user-selectable options in the web interface:

  1. Status quo. One file at a time, manually downloaded via the web interface.
  2. Save to SD card. Using your naming convention would be good. A FILES button would provide a simple file management interface where people could see all stored files, or select one or more for download or deletion.
  3. Save to TNFS. Still use your naming convention. A CONFIG button to specify the server, and a FILES button would provide the same file management interface as above.
  • Like 1
Link to comment
Share on other sites

I actually had a look and tried to implement (basic) functionality (something similar to unix spooler) but... the problem is when to save it (or send to tnfs server). There's no "end of print job" (as far as I know) so it would be hard to know when the user actually finished printing. In current implementation whatever you print is just one "print job" until you go to the web interface and download. Only then new "job" will start. So eg. if you print a listing from basic, then print another one and then download via web - you'll get everything on one page (or multiple pages but it will be one printout). The implementation is rather simple ie. it creates a file and writes/appends to it whatever is being printed until the file is downloaded - only then the file is "reset". 
That's where I stopped - I don't see how we could "detect" when the printout is done (I mean we could use some sort of timer ie. if nothing is printed fo x seconds then assume the user finished but that's rather ugly and might not work). I don't think implementing any of the options you mentioned would be hard to do (and I'd be happy to do it) but again - not sure how to deal with lack of "end of print job". 

Link to comment
Share on other sites

When printing what does all of sio pins look like during print? during pauses but still printing? and then when printing is fininshed?

is there a tell tale piece of data in combination of SIO pin states that indeed shows a complete job or busy doing a job?

if there is one models in play that is all you would need to detect the end of a job... until formal closing of the channel

provided the applications followed any standard at all for doing such things rather printing in open/data/close chunks

 

but no one says a person couldn't have a program or command  that tells he fujinet end of job for that matter or start a new job either in cases where someone forgets to close a job and reboots the computer etc....

 

Link to comment
Share on other sites

4 hours ago, damanloox said:

I actually had a look and tried to implement (basic) functionality (something similar to unix spooler) but... the problem is when to save it (or send to tnfs server). There's no "end of print job" (as far as I know) so it would be hard to know when the user actually finished printing. In current implementation whatever you print is just one "print job" until you go to the web interface and download. Only then new "job" will start. So eg. if you print a listing from basic, then print another one and then download via web - you'll get everything on one page (or multiple pages but it will be one printout). The implementation is rather simple ie. it creates a file and writes/appends to it whatever is being printed until the file is downloaded - only then the file is "reset". 
That's where I stopped - I don't see how we could "detect" when the printout is done (I mean we could use some sort of timer ie. if nothing is printed fo x seconds then assume the user finished but that's rather ugly and might not work). I don't think implementing any of the options you mentioned would be hard to do (and I'd be happy to do it) but again - not sure how to deal with lack of "end of print job". 

I think the idea is neat and useful. Perhaps you could use a physical button to initiate the file save. I took a gander at the code and I see that Button A Double Tap is currently unused. You can add a call to your save function from /lib/hardware/keys.cpp. Maybe also add a blink of the wifi led to indicate the double tap was a success (currently a single press of button A is disk rotate in addition to a blink of the bluetooth led). Double tap of B is another option. It's currently used to display memory usage on the debug monitor and isn't really useful for end users so could be changed.

  • Like 2
Link to comment
Share on other sites

On 4/17/2023 at 10:08 PM, _The Doctor__ said:

When printing what does all of sio pins look like during print? during pauses but still printing? and then when printing is fininshed?

is there a tell tale piece of data in combination of SIO pin states that indeed shows a complete job or busy doing a job?

I don't know much about SIO (yet...) but looking at the code - current implementation uses a "timer" to check if the printing has finished (ie. it will let you download the pdf if certain time has passed since last SIO activity/print). So I'd guess there's no "universal" way of detecting that via SIO state (as I guess SIO is either active or idle).
I'll try playing with buttons and see if it works... Not pretty (IMHO) but might work. As for commands - that won't be easy either... People can print from spartados, from basic etc. You'd need to implement that everywhere...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...