Check ros master
Make sure the terminal you use to start the smach viewer is connected to your ros master. To check, run:
and look for topics of your state machine.
Check instrospection server
Your state machine needs to run an introspection server to allow the smach viewer to connect to it. A quick check is:
rostopic list | grep "smach/container_status"
If nothing is found, your state machine is not running an introspection server. See this tutorial for more details on how to run an introspection server.