AllStarLink / app_rpt

Refactoring and upgrade of AllStarLink's app_rpt, etc.
4 stars 2 forks source link

Inconsistent messages regarding SimpleUSB active device #258

Closed encbar5 closed 6 months ago

encbar5 commented 6 months ago

In order to test this, run asterisk as the asterisk user, but delete or move the udev usb rule (may require reboot to take effect).

Under these conditions, using susb active and susb active show both indicate that my configuration for the usb device is active. But then attempting to use any command from the susb tune menu results in the message "currently not active" (see below).

raspberrypi*CLI> susb active  
active (command) USB Radio device is [usb_531390]

raspberrypi*CLI> susb tune txa
Device usb_531390 currently not active

Is there a way to give more consistent state information to the end user? Either

tsawyer commented 6 months ago

This is a bug. Not an inconsistent naming. susb tune txa should prompt for a new value.

I'm seeing the same problem on Jason's build. I don't know why this is happening with your and Jason's builds. It may be a recession. Last testing I did with Danny everything was cool USB wise.

I'll bring up another system tomorrow with a phreaknet build to see if USB is working.

KB4MDD commented 6 months ago

I am testing for this problem. I was able to perform the following without error on my development system.

k4mdddevelop*CLI> susb active
Active (command) Simple USB Radio device is [usb_1999]
k4mdddevelop*CLI> susb active show
Device [usb_1999] exists as device=1-8:1.0 card=1
k4mdddevelop*CLI> susb tune txa
Current setting on Tx Channel A is 475
k4mdddevelop*CLI> susb tune txa 470
Changed setting on TX Channel A to 470
k4mdddevelop*CLI>

The error condition that you observed is the result of this test in susb tune txa:

    if (!o->hasusb) {
        ast_cli(fd, "Device %s currently not active\n", o->name);

hasusb is set it the hid thread when it finds the usb device associated with the channel. The output that you posted indicates that we have not found the usb device and associated it with the channel driver.

@encbar5 can you run the command susb active show and tell me what is displayed?

It will be helpful to stop asterisk and run asterisk -c and let me see the output associated with chan_simpleusb. We should be logging a problem with locating the usb device.

The purpose of the susb active command is to switch between different simple usb devices. The active device determine what the following susb tune commands change.

The output message Device usb_531390 currently not active probably should read Device usb_531390 is selected, the associated USB device is not found. @tsawyer can you comment on this?

@tsawyer susb tune rxa displays the current value. To change the value, you would need to enter susb tune rxa 123. The CLI does not prompt for the new value. simpleusb-tune-menu, however does prompt for the new value.

encbar5 commented 6 months ago

I was able to perform the following without error on my development system.

@KB4MDD Did you test following my instructions??: "In order to test this, run asterisk as the asterisk user, but delete or move the udev usb rule (may require reboot to take effect)."

The point is to put the system in a state where the USB is not accessible. That way you can see that it still prints out the "active (command) USB Radio device is", which is misleading. The "active" in this message is not using the same criteria as the "active" in the message that shows on the tune subcommands.

can you run the command susb active show and tell me what is displayed?

Device [usb_531391] exists as device=1-1.3:1.0 card=1

KB4MDD commented 6 months ago

I am sorry - I don't have a system that is loaded with the .deb packages.

I will get a change made to address the error message.