Code Monkey home page Code Monkey logo

candle_driver's People

Contributors

chemicstry avatar tgiv014 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

candle_driver's Issues

Cangaroo works, but the sample code doesn't work!

Here is my screenshot of my cangaroo:
image
So it received a packet from my device.
And my setup:
image

But following python3.8 code doesn't work though:

import candle_driver

devices = candle_driver.list_devices()

print('Found {} candle devices.'.format(len(devices)))
device = devices[0]
print('Device path: {}'.format(device.path()))
print('Device name: {}'.format(device.name()))
print('Device channels: {}'.format(device.channel_count()))
device.open()

ch = device.channel(0)
ch.set_bitrate(1000000)
ch.start()
ch.write(0x141, bytes([0x92, 0, 0, 0, 0, 0, 0, 0]))
try:
    frame_type, can_id, can_data, extended, ts = ch.read(1000)
    print('Received {} from ID {} at {}'.format(can_data, can_id, ts))
except TimeoutError:
    print('CAN read timeout')

# close everything
ch.stop()
device.close()

Its result:

Found 1 candle devices.
Device path: \\?\usb#vid_1d50&pid_606f&mi_00#6&2d528fd&0&0000#{c15b4308-04d3-11e6-b3ea-6057189e6443}
Device name: candle_2d528fd
Device channels: 1
test_candle.py:15: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  ch.write(0x141, bytes([0x92, 0, 0, 0, 0, 0, 0, 0]))
CAN read timeout

Please help!

I am using CANable Pro after updating its firmware to candle_2d528fd

Thanks!

Unable to pip install with Python 3.10

Doing a pip install candle_driver fails in a Conda environment with Python 3.10 in Windows:

Collecting candle_driver
  Using cached candle_driver-0.1.5.tar.gz (13 kB)
Building wheels for collected packages: candle-driver
  Building wheel for candle-driver (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\user\Anaconda3\envs\project_env\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mubj47fl\\candle-driver_92913d5af7654aaaaee144286eff6d28\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mubj47fl\\candle-driver_92913d5af7654aaaaee144286eff6d28\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\user\AppData\Local\Temp\pip-wheel-r5xlfk2t'
       cwd: C:\Users\user\AppData\Local\Temp\pip-install-mubj47fl\candle-driver_92913d5af7654aaaaee144286eff6d28\
  Complete output (15 lines):
  C:\Users\user\Anaconda3\envs\project_env\lib\site-packages\setuptools\dist.py:757: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
    warnings.warn(
  running bdist_wheel
  running build
  running build_ext
  building 'candle_driver' extension
  creating build
  creating build\temp.win-amd64-3.10
  creating build\temp.win-amd64-3.10\Release
  creating build\temp.win-amd64-3.10\Release\src
  creating build\temp.win-amd64-3.10\Release\src\candle_api
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Icandle_api -IC:\Users\user\Anaconda3\envs\project_env\include -IC:\Users\user\Anaconda3\envs\project_env\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcsrc/candle_api/candle.c /Fobuild\temp.win-amd64-3.10\Release\src/candle_api/candle.obj
  candle.c
  src/candle_api/candle.c(22): fatal error C1083: Cannot open include file: 'candle.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for candle-driver
  Running setup.py clean for candle-driver
Failed to build candle-driver
Installing collected packages: candle-driver
    Running setup.py install for candle-driver ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\user\Anaconda3\envs\project_env\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mubj47fl\\candle-driver_92913d5af7654aaaaee144286eff6d28\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mubj47fl\\candle-driver_92913d5af7654aaaaee144286eff6d28\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-vz71gnre\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\user\Anaconda3\envs\project_env\Include\candle-driver'
         cwd: C:\Users\user\AppData\Local\Temp\pip-install-mubj47fl\candle-driver_92913d5af7654aaaaee144286eff6d28\
    Complete output (17 lines):
    C:\Users\user\Anaconda3\envs\project_env\lib\site-packages\setuptools\dist.py:757: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
      warnings.warn(
    running install
    C:\Users\user\Anaconda3\envs\project_env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_ext
    building 'candle_driver' extension
    creating build
    creating build\temp.win-amd64-3.10
    creating build\temp.win-amd64-3.10\Release
    creating build\temp.win-amd64-3.10\Release\src
    creating build\temp.win-amd64-3.10\Release\src\candle_api
    "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Icandle_api -IC:\Users\user\Anaconda3\envs\project_env\include -IC:\Users\user\Anaconda3\envs\project_env\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcsrc/candle_api/candle.c /Fobuild\temp.win-amd64-3.10\Release\src/candle_api/candle.obj
    candle.c
    src/candle_api/candle.c(22): fatal error C1083: Cannot open include file: 'candle.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\user\Anaconda3\envs\project_env\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mubj47fl\\candle-driver_92913d5af7654aaaaee144286eff6d28\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-mubj47fl\\candle-driver_92913d5af7654aaaaee144286eff6d28\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-vz71gnre\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\user\Anaconda3\envs\project_env\Include\candle-driver' Check the logs for full command output
```.

Python3.8: PY_SSIZE_T_CLEAN will be required for '#' formats

Here is a log when I executed the testing script with python3.8:

test.py:17: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  ch.write(10, b'abcdefgh')
test.py:20: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  frame_type, can_id, can_data, extended, ts = ch.read(1000)

I think this can fix this issue? mongodb/winkerberos#38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.