Exception: ('Error enumerating AD2USB devices: [Errno None] error sending control message: Operation not permitted', USBError(None, 'error sending control message: Operation not permitted'))
when it gets to the
- Code: Select all
device = AlarmDecoder(USBDevice.find ())
line. I also get
Error opening device on /dev/ttyUSB0.: Permission denied
when I tried to configure the device initially from the alarmdecoder-webapp. The pi user is a member of the dialout group and I even tried adding www-data to the dialout group, since that appears to be the user running Nginx, but that didn't help. This was resolved, albeit not a permanent solution, with a
- Code: Select all
chmod 777 /dev/ttyUSB0
, but of course the permission will revert when the pi reboots and this is probably not the most secure solution. While a permissions change did appear to make the webapp work, I am still getting the same error from the Python code when executing the examples from alarmdecoder.
When I run run the example code using strace, I got the following:
- Code: Select all
...
open("/dev/bus/usb/001/005", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/005", O_RDONLY) = 3
ioctl(3, USBDEVFS_CONTROL or USBDEVFS_CONTROL32, 0xbeb51938) = -1 EPERM (Operation not permitted)
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fcf000
write(1, "Exception: ('Error enumerating A"..., 191Exception: ('Error enumerating AD2USB devices: [Errno None] error sending control message: Operation not permitted', USBError(None, 'error sending control message: Operation not permitted'))
) = 191
rt_sigaction(SIGINT, {SIG_DFL, [], 0x4000000 /* SA_??? */}, {0x2cf88, [], 0x4000000 /* SA_??? */}, 8) = 0
exit_group(0) = ?
So I tried opening permissions on /dev/bus/usb:
- Code: Select all
sudo chmod -R 777 /dev/bus/usb
Which yielded a different error message in strace:
- Code: Select all
...
open("/dev/bus/usb/001/005", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbef89b48) = -1 ENOTTY (Inappropriate ioctl for device)
close(3) = 0
open("/dev/bus/usb/001/004", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbef89b48) = -1 ENOTTY (Inappropriate ioctl for device)
close(3) = 0
open("/dev/bus/usb/001/003", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbef89b48) = -1 ENOTTY (Inappropriate ioctl for device)
close(3) = 0
open("/dev/bus/usb/001/002", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbef89b48) = 6
close(3) = 0
open("/dev/bus/usb/001/001", O_RDWR) = 3
ioctl(3, USBDEVFS_IOCTL or USBDEVFS_IOCTL32, 0xbef89b48) = 2
close(3) = 0
open("/dev/bus/usb/001/005", O_RDWR) = 3
ioctl(3, USBDEVFS_CONTROL or USBDEVFS_CONTROL32, 0xbef89938) = -1 EPIPE (Broken pipe)
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fef000
write(1, "Exception: ('Error enumerating A"..., 167Exception: ('Error enumerating AD2USB devices: [Errno None] error sending control message: Broken pipe', USBError(None, 'error sending control message: Broken pipe'))
) = 167
rt_sigaction(SIGINT, {SIG_DFL, [], 0x4000000 /* SA_??? */}, {0x2cf88, [], 0x4000000 /* SA_??? */}, 8) = 0
exit_group(0) = ?
The AD2USB appears to have the latest stable version of the firmware installer:
- Code: Select all
!VER:ffffffff,V2.2a.6,TX;RX;SM;VZ;RF;ZX;RE;AU;3X;CG;DD;MF;LR;KE;MK;CB
Any help would be appreciated. I am out of ideas.