I've probably answered this before, here or somewhere... but no worries...
setterm -blank poke
should unblank the screen from a login, BUT... usually you need to send the appropriate codes to /dev/tty1, not the /dev/pty/X you're using as an ssh user... thus:
setterm -blank poke | sudo tee /dev/tty1 > /dev/null
This sends setterm's output (magic codes!) to the proper terminal to wake it up as you desire. Since I do this often, and use other options too, I made a little script I call 'tty1'
# send 'setterm' commands to /dev/tty1 (physical console)
setterm $* | sudo tee /dev/tty1 > /dev/null
Which I use like this:
tty1 -reset -cursor off
This command resets/clears the screen, returning to text mode and turns off the blinky cursor. handy when I don't want the distraction.
tty1 -blank poke
Would wake up the screen. (Well, should... works for me(tm))
(Do remember that you'll need to either set up nopasswd access to sudo, or be prepared to type the root password when you use this command)
But wait! If you call now! We'll include this gem: How to remove the need to supply a password for sudo usage! Operators are standing by!
Add this line to a file named "no-sudo-passwd-for-pi" (no dots allowed!) in /etc/sudoers.d/
pi ALL=(ALL) NOPASSWD: ALL
This will cause the user 'pi' to not require a password for ANY sudo invocation. BEWARE! This can be considered a security risk. Balance your need for this usage against the potential risks involved. (see man sudoers)