Green Granite has a good point. As a controls engineer, the first thing I look at for intermittent comms faults will be connection points (plugs/sockets). Quite apart from anything else, it's the easiest thing to check and eliminates the obvious stuff first. No point in getting into the software if there's a dodgy cable plugged in.
One of my most recent jobs (loss of comms between an inverter and its control panel via ethernet) was traced to a corroded ethernet plug/socket which had seen water ingress. A liberal application of contact cleaner and some vigorous cleaning with a brush, followed by waterproofing the box had the problem sorted. This was reported as a sudden loss of comms.
EDITED to say - I had a similar problem with my internet connection a few months ago which ended up being a faulty modem/router. This was suspected and then confirmed by substitution of cables, filters etc (and eventually router) until the connection worked.