首页 \ 问答 \ Linux上的Cygnal Integrated Products串口(Cygnal Integrated Products serial port on Linux)

Linux上的Cygnal Integrated Products串口(Cygnal Integrated Products serial port on Linux)

我有一个红外测温仪,它通过USB在虚拟串口上运行,我试图在Debian Linux上使用它。 不幸的是,系统没有枚举/dev/ttyUSB设备。

这是设备的dmesg

usb 5-1: new full-speed USB device number 3 using uhci_hcd
usb 5-1: New USB device found, idVendor=10c4, idProduct=834b
usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-1: Product: Infrared Online Sensor Adapter
usb 5-1: Manufacturer: Silicon Labs
usb 5-1: SerialNumber: CT00092755

这是lsusb -v

Bus 005 Device 003: ID 10c4:834b Cygnal Integrated Products, Inc.
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x10c4 Cygnal Integrated Products, Inc.
  idProduct          0x834b
  bcdDevice            1.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

我怎样才能使这个工作,所以我可以用串口连接它?


I have an infrared thermometer which operates on a virtual serial port over USB, which I am trying to use on Debian Linux. Unfortunately, the system does not enumerate a /dev/ttyUSB device.

Here is the dmesg for the device:

usb 5-1: new full-speed USB device number 3 using uhci_hcd
usb 5-1: New USB device found, idVendor=10c4, idProduct=834b
usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-1: Product: Infrared Online Sensor Adapter
usb 5-1: Manufacturer: Silicon Labs
usb 5-1: SerialNumber: CT00092755

And here is the lsusb -v:

Bus 005 Device 003: ID 10c4:834b Cygnal Integrated Products, Inc.
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x10c4 Cygnal Integrated Products, Inc.
  idProduct          0x834b
  bcdDevice            1.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

How can I get this working, so I can connect to it with the serial port?


原文:https://stackoverflow.com/questions/38963029
更新时间:2023-04-23 21:04

最满意答案

您的代码中存在多个语法问题。

这段代码适合我。

library("parallel") 

accCost_wrap <- function(x){accCost2(h16,x)}
#Instead of including h16 in the parRapply function, 
#just get it in the node environment    

cl = makeCluster(3)  

clusterExport(cl, c("h16", "accCost2")) 
#B will be "sent" to the nodes through the parRapply function.

clusterEvalQ(cl, {library(gdistance)}) 
#raster is a dependency of gdistance, so no need to include raster here.    

pp <- parRapply(cl, x=B, FUN=accCost_wrap) 

stopCluster(cl)

connections <- data.frame(from = rep(1:nrow(B), each = nrow(B)),  
to = rep(1:nrow(B), nrow(B)),  
dist = as.vector(pp))

您的accCost版本确实比gdistance中的版本更快。 您的版本会省略检查以查看您的积分是否在过渡层范围内。 谨慎行事。

(您可以通过将单元格编号作为输入来使您的功能更快。此外,从每个节点发回大量数据似乎效率不高。)


There are several syntax issues in your code.

This code works for me.

library("parallel") 

accCost_wrap <- function(x){accCost2(h16,x)}
#Instead of including h16 in the parRapply function, 
#just get it in the node environment    

cl = makeCluster(3)  

clusterExport(cl, c("h16", "accCost2")) 
#B will be "sent" to the nodes through the parRapply function.

clusterEvalQ(cl, {library(gdistance)}) 
#raster is a dependency of gdistance, so no need to include raster here.    

pp <- parRapply(cl, x=B, FUN=accCost_wrap) 

stopCluster(cl)

connections <- data.frame(from = rep(1:nrow(B), each = nrow(B)),  
to = rep(1:nrow(B), nrow(B)),  
dist = as.vector(pp))

Your version of accCost is indeed faster than the version in gdistance. Your version omits the checks to see if your points are within the extent of your transition layer. Proceed with caution.

(You could make your function even faster by taking the cell numbers as input. Also, sending so much data back from each node does not seem very efficient.)

相关问答

更多
  • 我写了S4(仍在进行中)可以在这里找到: http : //adv-r.had.co.nz/S4.html My write up of S4 (still in progress) is available here: http://adv-r.had.co.nz/S4.html
  • 这里是一个例子: setClass("yyy", representation(v="numeric")) setMethod("+", signature(e1 = "yyy", e2 = "yyy"), function (e1, e2) e1@v + e2@v) setMethod("+", signature(e1 = "yyy", e2 = "numeric"), function (e1, e2) e1@v + e2) 然后, > y1 <- new("yyy", v = 1) > y2 < ...
  • S4方法不起作用。 而是更新并返回对象 setMethod("deposit", signature = "Account", definition = function(.Object, amount) { .Object@balance <- .Object@balance + amount .Object }) acc = deposit(acc, 20) 不同的表述是写一个deposit<-替代方法 setGeneric("deposit<-", func ...
  • 您的代码中存在多个语法问题。 这段代码适合我。 library("parallel") accCost_wrap <- function(x){accCost2(h16,x)} #Instead of including h16 in the parRapply function, #just get it in the node environment cl = makeCluster(3) clusterExport(cl, c("h16", "accCost2")) #B wi ...
  • 我假设这并不直接适用于您,但如果您正在为Bioconductor开发套件,那么有兴趣使用S4,因为他们积极鼓励使用它,并在十年之后的更好的部分 - 所有的核心包装大量使用S4。 我发现所有额外的开销是一个痛苦 - setGeneric,setMethod,处理NAMESPACE等。据说,我发现它强加的结构,可扩展性和其他这样的东西是值得的。 与所有事情一样,有折衷。 我认为它可以是一个很清洁 - 我不喜欢S3方法简单地通过命名约定伪装(foo.class)。 所有这一切,我倾向于避免在我自己的代码中使用S4 ...
  • 方法被定义在泛型上,并在类上派发,而不是在类上派发。 所以this总是被派发的对象。 .A = setClass("A", slots = c(a = "integer")) setGeneric("foo", function(x) standardGeneric("foo")) setMethod("foo", "A", function(x) { x@a # 'x' is the object that `foo()` dispatches on, i.e., 'this' } ...
  • 您遇到的问题是尚未加载Matrix包。 因此,当Rcpp搜索dgCMatrix ctor时,它会变空,从而触发您看到的错误。 要解决这个问题,您只需在每个会话开始时加载一次Matrix库。 例如 library("Matrix") sourceCpp("path/to/S4_declaration.cpp") 或者,您可以在正在执行的sourceCpp编译中添加加载调用。 这有点极端,因为您只需要加载一次库。 但是,以下应始终在sourceCpp()下工作 #include // [[ ...
  • 请记住[只是另一个功能,因为[<- 。 所以为了做到 objPeople$FirstName[2] = "Joe" $将首先运行并返回[<-可以操作的东西。 就像是 '$<-'(objPeople, "FirstName", '[<-'( '$'(objPeople, "FirstName"), 2, "Joe")) 所以为了子集,它必须提取名字。 但随着 objPeople$FirstName = "Ambroze" 那只是一个 '$<-'( objPeople, "FirstName", "Am ...
  • 您无法链接两个独立的对象,因此您需要使用两者的方法。 以下是替换方法的示例: Customer <- setClass( "Customer", slots=c( CustomerID="numeric", Name="character", OrderHistory="list" ), prototype=list(OrderHistory = list()) ) Order <- setClass( Class="Order", slot =c( ...
  • 我要做的是,对于您在modelObject类中想要的每个插槽,确定期望值的范围。 例如, model槽必须支持模型训练函数可以返回的所有可能的对象类(例如lm(),glm(),nnet()等)。 在示例中,您会看到返回以下对象: ``` x <- y <- 1:10 class(lm(x~y)) class(glm(x~y)) class(nnet(x~y, size=10)) ``` 由于返回的对象之间没有公共类,因此使用S3语言可能更有意义,S3语法不太严格,并允许您将各种类型的输出分配给相同的字段名 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。