It is currently Tue Dec 01, 2020 1:44 am
All times are UTC + 8 hours

USB connection events?

Interested in our products? Please post any inquiries here.

USB connection events?

Postby jburts » Thu Mar 21, 2019 9:49 pm

I have need to be able to run webservice programs that can trap and respond to events when a USB thumb drive is connected to USB ports. This could either be an app running in the ADM directly, or it could be in a separate VM on the appliance.

We have looked at QNAP devices and Synology, but neither seem to allow us to receive the USB connection events to automatically take steps when a thumb drive is connected. Is this something that we can accomplish with Asustor units?

Thank you.

--James--
jburts
 
Posts: 1
Joined: Thu Mar 21, 2019 9:39 pm

Re: USB connection events?

Postby father.mande » Thu Mar 21, 2019 10:31 pm

Hi,
jburts wrote:I have need to be able to run webservice programs that can trap and respond to events when a USB thumb drive is connected to USB ports. This could either be an app running in the ADM directly, or it could be in a separate VM on the appliance.
We have looked at QNAP devices and Synology, but neither seem to allow us to receive the USB connection events to automatically take steps when a thumb drive is connected. Is this something that we can accomplish with Asustor units?
Thank you.
--James--


In "presales" sub-forum we have normally to answer only for Asustor ... but in fact it's also possible on some other brand ...

In Asustor, when an USB is connected to the NAS ... a new device is created and if file system in partition are supported ... a share folder is created
... so a simple solution (to be open to all your approach) is to use some tools like inotify (include in kernel) to receive an event on the creation of new device or new share
... ... inotify can launch automatically a shell on file or folder event (or have a shell looping to wait for) ... and all is file in Linux
... ... inotify tools can be added (if not delivered by Asustor, I have not verified) using APKG Entware ... you can use iontifywatch ; inotifywait or better incron a cron based on file / folder event and NOT on time events
... ... with icron you can survey event in multiple folder and launch corresponding shell when event occurs

Others solution, even more technical, can be used ... but this is ease of use, ease of management, ease of build ...

In Qnap you can do the same ... even the device tree is more complex, due to another device structure for external device ... but similar solution can be run when you have understand the specific Q approach.

N.B. this response is based on the minimal information you provide ... so can be adapted to your own project.
in Virtualbox ... if USB is directly attached to the VM you must do the same in the VM O.S. (so same for any Linux) ... if USB is first view by Asustor NAS ... the response is correct, even you must have to pass the event to the V.M. (possible but another subject) ... require a full scheme of your software or appliance architecture ...

Philippe.
AS5202T /AS5002T / AS202TE / AS1002T
My Blog specific to my APKG : https://blog.father-mande.ovh/
User avatar
father.mande
 
Posts: 1047
Joined: Sat Sep 12, 2015 2:55 am

Return to Presales

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 2 guests