```
def findSecondMinimumValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
vals = []
def getNodes(node):
if node:
vals.append(node.val)
if node.left:
getNodes(node.left)
if node.right:
getNodes(node.right)
getNodes(root)
vals.sort()
for i in xrange(len(vals) - 1):
if vals[i] != vals[i+1]:
return vals[i+1]
return -1
```