Leap Motion worked fine until mid june 2020.
Diagnostic Tool and visualizer works fine and trace the hands without problem and I can send data through Websocket without any issues, but I cannot retreieve data by direct connection, like the hello world sample, which I could do prior to mid June.
I've tried different versions and reinstalled the device to no avail.
I think its not a problem of Windows 10, I had have tested in different machines. Maybe it's a problem of system policies, but I don't know what to look for
This is the simple example that doesn't work, but worked earlier.
import os, sys, thread, time, inspect, math, random, urllib, socket, re
from os.path import expanduser
from math import sqrt
home = expanduser("~")
arch = '/lib-leap/x64' if sys.maxsize > 2 ** 32 else '/lib-leap/x86'
hlib_dir = home + '/Autodesk/lib-leap/'
harch_dir = home + '/Autodesk' + arch
glib_dir = 'C:/Autodesk/lib-leap/'
garch_dir = 'C:/Autodesk' + arch
sys.path.insert(0, os.path.abspath(glib_dir))
sys.path.insert(0, os.path.abspath(garch_dir))
sys.path.insert(0, os.path.abspath(hlib_dir))
sys.path.insert(0, os.path.abspath(harch_dir))
import Leap, sys
class SampleListener(Leap.Listener):
def on_init(self, controller):
print("Initialized")
def on_connect(self, controller):
print("Connected")
def on_disconnect(self, controller):
print("Disconnected")
def on_exit(self, controller):
print("Exited")
def on_frame(self, controller):
# Get the most recent frame and report some basic information
frame = controller.frame()
hands = frame.hands
numHands = len(hands)
print("Frame id: %d, timestamp: %d, hands: %d, fingers: %d, tools: %d" % (
frame.id, frame.timestamp, numHands, len(frame.fingers), len(frame.tools)))
def main():
# Create a sample listener and controller
listener = SampleListener()
controller = Leap.Controller()
# Have the sample listener receive events from the controller
controller.add_listener(listener)
# Keep this process running until Enter is pressed
print("Press Enter to quit...")
sys.stdin.readline()
# Remove the sample listener when done
controller.remove_listener(listener)
if __name__ == "__main__":
main()