Controlling USB devices with Python and libusb @siliconlabs

Sdílet
Vložit
  • čas přidán 6. 04. 2016
  • Controlling USB devices with Python and libusb @siliconlabs
    -----------------------------------------
    Subscribe to Adafruit on CZcams: adafru.it/subscribe
    Join our weekly Show & Tell on G+ Hangouts On Air: adafru.it/showtell
    Watch our latest project videos: adafru.it/latest
    New tutorials on the Adafruit Learning System: learn.adafruit.com/?...
    -----------------------------------------
  • Věda a technologie

Komentáře • 54

  • @kevinoconnor2406
    @kevinoconnor2406 Před rokem

    This might be one of the best videos on USB I’ve ever seen. Fantastic job by the presenter, very clear communication of the concepts. Thank you for taking the time on this!

  • @ottoomen5076
    @ottoomen5076 Před 5 lety

    Thanks for your time.

  • @ralphm.881
    @ralphm.881 Před 8 měsíci

    I'm in the process of creating a program to interface with a third party driver. This video and the recommended book helped immensely. Thank you! :)

  • @netman87
    @netman87 Před 8 lety

    is there many devices to run python and have some IO digitial+analog+i2c+spi+usb ... and wlan/ethernet? raspberry, beaglebone, ariette g25?

  • @subramonianmohan1241
    @subramonianmohan1241 Před 2 lety

    Super. Nice explanation. Keep it up. Thank you.

  • @metaeditors
    @metaeditors Před 6 lety

    Very helpful, got my first steps into IoT. worked it out on OSX

    • @KanePat
      @KanePat Před 2 lety +1

      Would you be kind and share the key parts of your code. I am running into permission issues on my M1 mac pro. Does your code run properly on that hardware ? Thanks

    • @matthewmorrison2071
      @matthewmorrison2071 Před 2 lety

      @@KanePat Were you able to fix this problem?

  • @hemantrakesh4577
    @hemantrakesh4577 Před 6 lety +2

    I'm working with a FTDI CCD and would like to the data from the microcontroller using python's usb module, How do I go about it? (I have the values of bmRequestype,wValue and etc.)

  • @govindabaweja3549
    @govindabaweja3549 Před 6 lety +2

    How to retrieve data or fetch a data from a device connected to the laptop when ICD do not have reType, bReq, wVal and wIndex values? Please advise. As I need help getting the data from long range finder using python.

  • @shadabtughlaq9763
    @shadabtughlaq9763 Před 6 lety

    So how do i connect to a SL-4012 Sound Level Meter to read data

  • @montvydasklumbys7584
    @montvydasklumbys7584 Před 10 měsíci

    That really helped! Although one thing that I would need to know is how would you configure the CP2102N GPIO2 pin to work in RS485 mode though? I understand you had to configure GPIO0/GPIO1 pins in the same manner :)

  • @themaconeau
    @themaconeau Před 8 lety

    Will save for later and wait for HD. 360p doesn't do Lady Ada justice >.

  • @eddaly4160
    @eddaly4160 Před 3 lety

    Great video

  • @pkilo2811
    @pkilo2811 Před 4 lety

    Seems to work well for linux. On windows, dev.ctrl_transfer does not work. Anyone knows the workaround?

  • @naveennamani2
    @naveennamani2 Před 6 lety +12

    It would be great if you've mentioned how to get started with libusb, all I'm getting is "No backend available" error in windows 10

    • @sarahc3344
      @sarahc3344 Před 6 lety +1

      you can use this to get libsub learn.adafruit.com/adafruit-ft232h-breakout/windows-setup

    • @MSandovalPhD
      @MSandovalPhD Před 4 lety +3

      For me, in python 3, I had to add: import usb.backend.libusb1 and BACKEND = usb.backend.libusb1.get_backend(find_library=lambda x: "C://_THE_PATH_WHERE_LIBUSB1_IS"). It's a good tutorial though.

    • @OhReely74
      @OhReely74 Před 3 lety

      @@MSandovalPhD should the path include the file name libusb1.py? Can you give an example? Also what version of python?

    • @Smallz2000i
      @Smallz2000i Před 6 měsíci

      same issue here

  • @iamsuperroot
    @iamsuperroot Před 6 lety

    Can you post the code used? Thank you.

  • @85percentcocoa
    @85percentcocoa Před 8 lety +3

    thank you!

  • @muhammadkashif4000
    @muhammadkashif4000 Před 3 lety

    How do I write code to encrypt whole usb drive in python

  • @sidneyclark4952
    @sidneyclark4952 Před rokem

    Excellent explanation of the technology. Is there something similar on a break out board that can serve as a high speed usb host device with transfer data speeds at or beyond 480 Mbps?

  • @mpfdetroit
    @mpfdetroit Před 5 měsíci

    Hey Lydia I am in a bad spot. Ive spent the last 10 hours trying to send a hex data string to a hidusb device in order to actuate a physical relay to power lighting. Can you point me in a good direction?

  • @anurag6674
    @anurag6674 Před 7 lety

    can LIBUSB and pyusb be used for instruments whose drivers are no installed in my computer? or i can do it with pyserial?? I have a instrument(PSD9003 programmable power supply) but i don't have its drivers and i am in urgent need to automate the instrument! Can you help?

    • @CellularInterceptor
      @CellularInterceptor Před 6 lety

      Yes, as long you have an Interface Control Document to know what the data stream and commands are, like a list of old AT commands for modems. However, for me I used open source bench power supplies like this www.crowdsupply.com/envox/eez-h24005

  • @ubairsofi7568
    @ubairsofi7568 Před 6 lety

    i need a help ..
    i want to control servo motors by usb game pad connected to the pc .The servo is connected to the rpi3 . The rpi is connected to pc by Ethernet.How to define game pad in rpi code

    • @CrypticConsole
      @CrypticConsole Před 4 lety

      You need to use sockets to create a network connection over eathernet to rpi from pc. Than get the pc to send the inputs as strings to the pi, and read them as if they were keyboard inputs with an if statement.

  • @isabelescarlette2021
    @isabelescarlette2021 Před 2 lety +1

    Great video, thank you . How to install libusb 1.0 for PyUSB on Windows 10?

  • @maged4087
    @maged4087 Před 2 lety

    How to immute a USB identifier?

  • @maniksharma9736
    @maniksharma9736 Před 2 lety +1

    Is there any program that can simulat key press on pc to Mobile by usb c ....??
    Please help...

  • @jaminge5104
    @jaminge5104 Před 7 lety +1

    How can I copy file from mass storage device without any system just in libusb, How can I do it ?

    • @CrypticConsole
      @CrypticConsole Před 4 lety +1

      In python? If so use os.walk() to walk a directory tree, than just copy the file located in the returned paths.

    • @tyjohnston5889
      @tyjohnston5889 Před rokem

      I know it's been 5 years but I will copy and paste my GUI in python3 for a Samsung A11 UART script I'm working on. DISCLAIMER: IDK IF THIS WILL WORK FOR YOU OR ANYONE ELSE LOL.

    • @tyjohnston5889
      @tyjohnston5889 Před rokem

      ''''A GUI for backing up a Samsung A11 device using UART. Here's an example program that uses the PyQt5 library to create a simple GUI with a "Start Backup" button: Needs work.
      '''
      import sys
      import os
      import subprocess
      from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QPushButton, QFileDialog, QVBoxLayout, QHBoxLayout, QComboBox
      class BackupWindow(QWidget):
      def __init__(self):
      super().__init__()
      # Create the UI elements
      self.serial_label = QLabel('Serial Port:')
      self.serial_combo = QComboBox()
      self.baud_label = QLabel('Baud Rate:')
      self.baud_combo = QComboBox()
      self.file_label = QLabel('Backup File:')
      self.file_edit = QLineEdit()
      self.file_button = QPushButton('Browse')
      self.start_button = QPushButton('Start Backup')
      # Set the default values
      self.serial_combo.addItems(['/dev/ttyACM0', '/dev/ttyACM1'])
      self.baud_combo.addItems(['9600', '115200'])
      self.file_edit.setText('backup.img')
      # Create the layout
      vbox = QVBoxLayout()
      hbox1 = QHBoxLayout()
      hbox1.addWidget(self.serial_label)
      hbox1.addWidget(self.serial_combo)
      hbox1.addWidget(self.baud_label)
      hbox1.addWidget(self.baud_combo)
      vbox.addLayout(hbox1)
      hbox2 = QHBoxLayout()
      hbox2.addWidget(self.file_label)
      hbox2.addWidget(self.file_edit)
      hbox2.addWidget(self.file_button)
      vbox.addLayout(hbox2)
      vbox.addWidget(self.start_button)
      self.setLayout(vbox)
      # Connect the signals to the slots
      self.file_button.clicked.connect(self.browse_file)
      self.start_button.clicked.connect(self.start_backup)
      def browse_file(self):
      filename, _ = QFileDialog.getSaveFileName(self, 'Select Backup File', '', '*.img')
      if filename:
      self.file_edit.setText(filename)
      def start_backup(self):
      # Disable the UI elements while the backup is running
      self.serial_combo.setEnabled(False)
      self.baud_combo.setEnabled(False)
      self.file_edit.setEnabled(False)
      self.file_button.setEnabled(False)
      self.start_button.setEnabled(False)
      # Get the selected serial port and baud rate
      serial_port = self.serial_combo.currentText()
      baud_rate = self.baud_combo.currentText()
      # Get the backup file path
      backup_file = self.file_edit.text()
      # Start the backup process
      cmd = f'sudo dd if={serial_port} of={backup_file} bs=1M'
      subprocess.Popen(['gnome-terminal', '--', 'bash', '-c', cmd])
      # Close the UI window
      self.close()
      if __name__ == '__main__':
      app = QApplication(sys.argv)
      window = BackupWindow()
      window.show()
      sys.exit(app.exec_())

    • @tyjohnston5889
      @tyjohnston5889 Před rokem

      SH-U09B3 USB Type C to TTL adapter with a CP2102N chip. Basically, it is an upgraded version of a CP2102 chip, which is equivalent to FTDI FT232RL chip compatibility. 3Mbps is the absolute maximum transmission speed that it can reach. Best of luck to you!

  • @juanpablotravi2210
    @juanpablotravi2210 Před 3 lety

    Thanks!!! I have a problem running this code. "No backend available" Can you help met?

    • @staceyloulouse
      @staceyloulouse Před 3 lety

      I had the same issue. any solution found yet?

    • @Velsethen
      @Velsethen Před 3 lety

      @@staceyloulouse it has to do with windows environment variables. You need to add python to the home path. if you used the python 3 installer, just use repair and select the option to add to home path/envirment variables.

  • @dexterian1716
    @dexterian1716 Před 6 lety

    wow!!!

  • @SajjadHematiNourani
    @SajjadHematiNourani Před 2 lety

    Hello, would you help me to select parts for my project? I need to control 6 switches with a USB that I want to turn on/off by python. Please name a board or schematic circuit PCB circuit board for this project. I appreciate your guidance in advance. Thank you.

  • @wiiznokes2237
    @wiiznokes2237 Před 2 lety

    "I'm am in the code apparently" ahah

  • @NetPwn
    @NetPwn Před 8 lety +1

    ahh yeah

  • @chalmerepitthu
    @chalmerepitthu Před rokem

    1001 Like 😉

  • @Jokalor
    @Jokalor Před rokem

    i am the 1000 likes !! 🃏

  • @ninesoft1868
    @ninesoft1868 Před 7 lety

    Just for a bit Chinese. it is "Nee" not 'Yee'. so say "Nee hou"!

    • @annekedebruyn7797
      @annekedebruyn7797 Před 5 lety +2

      For a bit of Dutch, "nee hou" means "no hold."
      This was useless facts. Haha