I've been having this problem out of the blue with my BQ Aquaris E5 phone: it does not respond to any USB connection (either to the PC or charger) if the phone is on. If I keep the cable connected and then restart, it will charge without problems. Once the cable is removed, it won't charge if I connect it again (until next reboot). If I restart the device without cable and then connect one, it won't work either. I did a factory reset, which did not do the trick; and even flashed the device with the latest ROM, also without effect.
Any idea of what could be the problem? I have not found anyone having the same problem, and solutions such as modifying the USB profile in the developers mode or clearing the cache partition has not done the trick.