Wireless mouse/keyboard randomly disconnect
I've had my iMac for about 3 years now. Recently it has started randomly disconnecting from my Bluetooth mouse and keyboard. Sometimes it disconnects for a few seconds and reconnects on its own. Sometimes it won't reconnect and I have to press the power button to restart it. Sometimes it happens while the system is sleeping. In this case sometimes manually pressing and releasing the power button to wake up the system seems to cause it to reconnect, but other times it is still disconnected. I haven't noticed any pattern at all. I don't recall doing anything that would have caused this to start happening when it's been working just fine for years. My daughter uses the iMac while teaching voice lessons and today it disconnected on her and she couldn't use the iMac at all. It's becoming very frustrating. Any ideas?
Also, possibly unrelated, but my blogger doesn't work properly - when I try to create a new post it goes into an indefinite reloop. When I access the blog from my Windows laptop there are no issues, so it doesn't seem to be a domain or site issue.
iMac, macOS Mojave (10.14)