Hi. Is it possible to disable or enable USB power from Intel Edison (CLI, libraries, etc)? Maybe it is possible to disable OTG ignoring ID pin state and then reenable it? Or maybe it is possible to control PSW pin as GPIO from mraa? Or the only way will be to install some MOSFET to power line on my board?
If what you'd like to achieve is to interrupt the power line of the USB, then I believe, there's not a software option for this, you will probably have to make a simple circuit that interrupts it. But if you'd just like to reset the device, you can try these approaches:
Let me know if this helps.
Thanks for the response! Yes I need remove power from connected USB device and then again supply it.
If it is impossible to control PSW from edison, I think about 2 solutions:
1) Instert MOSFET after 5V regulator before USB connector and control it from MRAA.
2) Detect USB otg ID manually by checking GPIO1 state with MRAA in infinity loop with some delay and if it is 0 write 0 to GPIO2 then driver will start OTG mode and will change PSW to enable power. If I need to reboot device I will write 1 to GPIO2 and driver will think that USB is disconnected and change state of PSW to disable power supply
What way is better? Can someone suggest another ways?
Any of the two options is worth trying as they apply a similar principle, but for simplicity I would suggest you to go with the one with less circuitry. As it was suggested in another thread, you could break the power signal with a relay or an optocoupler have it reset. You will then need a pin to control the relay or optocoupler, this pins can be set to toggle every time on boot with a system service.
I wanted to ask you if you had any updates on your project. How is it going? Have you been able to interrupt the power to your USB device?
Thanks, I still think about it, when I will have some time and components I will try to prototype some simple circuit. If all will be ok I will write about results.