Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output to line printer #42

Closed
thesailingengineer opened this issue Apr 19, 2023 · 5 comments · May be fixed by #44
Closed

Output to line printer #42

thesailingengineer opened this issue Apr 19, 2023 · 5 comments · May be fixed by #44

Comments

@thesailingengineer
Copy link

I'm trying to work on a signalk plugin to output a line of log text (very simple Lat/Lon, COG, SOG, Wind) to a line printer at a given time (every 15min or hour etc), so that if any electrical failure were to occur, the log would exitst in paper form.
I have a 4" wide receipt printer and can send line of text by saving the text to /dev/usb/lp0.
I realise that 90% of what I am tying to achieve is already done by this plugin, so is it possible to add an option to send user defined values from the hourly log output to a user defined location (eg. /dev/usb/lp0)?

@bergie
Copy link
Member

bergie commented Apr 19, 2023

That's interesting! Can you share the hardware you're using?

As for implementing this in the plugin, that's certainly possible. Though you'd probably get it quicker by just doing a cronjob that reads the YAML log files

@thesailingengineer
Copy link
Author

I bought a Star TSP800ii from ebay - it's not the cheapest (but still not expensive), but I wanted a 4" width to get a full useful log reading on a line. It runs from 24v and is quite fussy about this, so will need to get a 12- 24v converter for the boat, but for now it runs fine from a bench supply.
Funny, before I started looking at signalk plugins I thought about using a cron job - but actually, maybe just tailing the YAML log with a little formatting would do the trick!
20230419_221315
20230419_221325
complete with a mock-up log I printed using echo 'text' > /dev/usb/lp0
It's amazingly simple, working out of the box with Linux, just needed CUPS disabling to stop it from blocking the port.
The idea came from the fact that my intentions are always good when I sail, and I do keep a paper log, but always forget to set an alarm for the hour, and end up missing log readings. When going further afield, it's a good back up should the electronics fail, hence the printer idea - then I found your plugin, which is amazing, and does literally everything I want (including autostart), but not the line printing bit - an old-fashioned idea, but one I think is ideal for boat usage!

@bergie
Copy link
Member

bergie commented Apr 27, 2023

@thesailingengineer can you give PR #44 a spin? Should do the trick, but obviously I don't have a printer here to test with.

@bergie
Copy link
Member

bergie commented Aug 19, 2023

Some more receipt printer ideas from aviation https://carloslagoa.com/blog/flipreps/flipreps.html

@bergie
Copy link
Member

bergie commented Nov 8, 2024

Ended up implementing this as a separate service:
https://github.com/meri-imperiumi/logbook-printer

@bergie bergie closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants