Raspberry Seismometer link to thermal printer

I want link my Raspberry Shake 3D to a thermal printer, to print only the large earthquake records (with M>6.0 or set magnitude).

How is it possible?


Hello Geobalocchi,

It should be possible to interface a printer with a Raspberry Pi, while it could be a bit more complex to automate large earthquake detection and automatic printing out.

In general, you’ll probably connect the printer via USB cables, so once that is done, you should check if the printer supports PCL or ESC/POS as it might work straight out of the box. If not, then I would recommend checking for specific drivers on the manufacturer’s website for drivers.

Once the printer is interfaced, you should be able to see it with the lsusb command after SSHing into the Shake (our guide on how to do so is here, if needed: How to access your Raspberry Shake’s computer via ssh).

After that, you could install CUPS (CUPS - Print Server | Ubuntu) with sudo apt install cups and then, by its instructions, access the CUPS web interface via http://<ShakeIPAddress>:631/, then configure the printer from there.

Now that the printer is set, it becomes more complex. You could print out all the helicorders as they are produced (more info on where to find them here: FAQ), or you could manually send out the printing command for selected helicorder images where the larger earthquakes are displayed.

If your thermal printer is monochrome (I think I remember that most of them are), and if you still want to print the helicorder, then you will have to convert the color image to monochrome before sending it out for printing. In that case, you would require some code to do so (Python or similar).

To summarize the essential steps, which I hope prove useful:

  1. Check if the printer is automatically recognized after connecting it via USB, and if not, acquire the drivers for Pi OS Buster distribution for your printer.
  2. If you decide to print the helicorders out, and your printer is in monochrome, then you require some conversion program to change our heli displays from color to mono.
  3. If you want to automate it all, you could run another program via cronjob to do the job for you.

Lastly, to trigger a printout event after a large earthquake, you could do it by monitoring the output of the Shake UDP port (details here: Raspberry Shake Data Producer UDP Port Output) and then activate the printing program only when the set threshold is reached/passed however, if the Shake is located in a “noisier” place, there could be a lot of false positive triggers, even with people simply walking by.

So, there are quite a bit of issues to overcome, and this is a very basic outline. It is (very) likely that many things will be different by the time you finish working on this interesting project.

Lastly, we do not recommend adding more processes directly to the Pi to save the maximum available processing power for data recording & related tasks. Unless the new processes are required to be on the Pi for this specific project, it would be more efficient to move the relevant files to another machine and then proceed on there.

If anyone else in the community has a better idea, or a more efficient approach in mind, please let us know!