USB connection

I have problems communicating with a device on the USP connection, I have a script that communicates with a device on the USB connection, when I run this scrip as root on freepbx, it works fine. But when I run it from freepbx as a; extensions_custom.conf
;; exten => s,1,System(/usr/local/bin/OpenPort.sh). the script executes fine, but nothing happens on the USB port. i suspect it has something to do with permissiom, can you help ??

That line is commented out. However there may well be permission issues.

Do you have any suggestions on how to proceed?

He just mentioned two approaches.

  1. Make sure your dialplan is not inadvertently commented out.
  2. Make sure the asterisk user has correct permissions to /usr/local/bin/OpenPort.sh

If those don’t work capture a failed call using:
Providing Great Debug - Support Services - Documentation (freepbx.org)

I don’t know what OpenPort.sh does, but I suspect you may have to be root to do tricky things with USB.

as I mentioned at the beginning, the script runs ok; see file
with no activity on USB

I have tried to change the permission on ttyUSB0, but when I; reboot it goes back ??

You’d need to capture standard error to know if it worked.

On modern Linux systems, there is no /dev directory on a disk; it is generated, directly in memory, by the kernel, each time it is booted. Assuming your OS behaves the same as Debian, you would give asterisk permission by adding it to the dialout group.

However, I don’t know what your script actually does. It’s conceivable that it does something that can only be done by root.

You can use a udev ‘rewrite rule’ to properly change those permissions on a reboot.

I found a solution at:: xmodulo
sorry cannot insert links…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.