Announcement

Collapse
No announcement yet.

Snap Connect on 64-bit Windows

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Snap Connect on 64-bit Windows

    To run Snap Connect on 64-bit Windows 8 Pro, should I install 32 or 64-bit Python? I noticed some .dlls ship with Snap Connect, guessing these are 32-bit?

    For reference, I (mistakenly it seems) installed the 64-bit version of Python 2.7:
    Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32

    The install of Python and Snap Connect went fine, but when I run the McastCounter example, accessing the serial port fails:

    serialwrapper.PyserialDriver.SerialOpenException: An error occured while setting up the serial port: Could not open device: [Error 193] %1 is not a valid Win32 application

  • #2
    Do you have a SNAP device plugged into your serial port (and does it match what you are trying to open)?

    Ex. If you specify COM1, do you have COM1 connect to the serial port of a SNAP device?
    sigpic
    Proven Solutions for the Internet of Things
    www.synapse-wireless.com

    Comment


    • #3
      I have a Snap Stick (RF100) plugged into the USB port. Portal detects it as USB0 and sees the mesh fine. I close Portal before running the McastCounter script. I try to open port 0 in the script. If I simply have the port number wrong, is this the expected failure message?

      Comment


      • #4
        Python will raise an exception if the serial port is incorrect or the device is not responding:

        Here are two that the function itself will raise:
        ValueError("Serial interface type must be an integer")
        ValueError("Unsupported serial interface type <type>")

        The underlying Serial interface code (built into Python) will raise others.

        Here's one way to check
        Code:
        SerialPortID = 0
        try:
            snapCom.open_serial(snap.SERIAL_TYPE_SNAPSTICK100, SerialPortID)
        except Exception, detail:
            print "Serial Port Error: %s %s %s" % (detail.message, "USB stick", str(SerialPortID))
            sys.exit()
        sigpic
        Proven Solutions for the Internet of Things
        www.synapse-wireless.com

        Comment


        • #5
          This code is equivalent to the code in the McastCounter example and fails in the same way. I solved my problem by uninstalling the 64-bit version of Python and installing the 32-bit version from here: http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi.

          Comment


          • #6
            I also get this error with the following script:

            Code:
            from snapconnect import snap
            snap_instance = snap.Snap()
            snap_instance.open_serial(snap.SERIAL_TYPE_SNAPSTICK200, 0)
            Code:
            No handlers could be found for logger "snaplib.serialwrapper.PyserialDriver"
            Traceback (most recent call last):
              File "<stdin>", line 1, in <module>
              File "snapconnect\snap.py", line 767, in open_serial
              File "snapconnect\listeners.py", line 73, in __init__
              File "serialwrapper\PyserialDriver.py", line 190, in __init__
              File "serialwrapper\PyserialDriver.py", line 371, in setOutputType
              File "serialwrapper\PyserialDriver.py", line 438, in setupSerialDriver
            serialwrapper.PyserialDriver.SerialOpenException: An error occured while setting up the serial port: Could not open device: [Error 193] %1 is not a valid Win32 application
            Can this be fixed to work with 64-bit python? I suspect it's just a minor pyserial parameter issue with the virtual serial port.

            Comment


            • #7
              berwyn

              SNAP Connect currently only supports the 32bit version of Python. If you are using the 64bit version you will need to uninstalled and re-install the 32bit version.

              Comment


              • #8
                I know it currently only supports 32-bit python. Can it be fixed to support 64-bit python? I suspect just a minor tweak in vcp handling, but I could be wrong.

                Comment


                • #9
                  That would have to be a feature request for a future revision. I'll make a note of it for Engineering.

                  Comment


                  • #10
                    I'm not sure whether it's helpful, but for what it's worth I came up with a similar obscure problem using USB HID drivers in 64-bit windows when calling Windows API function SetupDiGetDeviceInterface. The DeviceInterfaceDetailData output buffer needs to have its cbSize field pre-loaded by the app, and it is 5 for Win32 and 8 for Win64. Hard-coded constants seem to be the only way. Could a cbSize parameter be related to this bug?

                    cbSize = 8 if sys.maxsize>0x7fffffff else 5
                    Last edited by berwyn; 06-19-2014, 03:06 PM.

                    Comment


                    • #11
                      Please update documentation to specify 32bit Windows. I followed the instructions and installed Python and now have to redo everything to change to 32bit.

                      Comment


                      • #12
                        The instructions specify 32 bit python. I'm running everything just fine on 64 bit Windows 10 and 32 bit python.

                        Comment

                        X