I. m facing similar problems. like you. I was working on upgrading my network to 2.1.1. I got stuck with strange behaviour of the GW. I programmed it with:
IDE version: 1.8.4
Arduino AVR release: 1.6.20
The latest 2.1.1 downloaded libraries and the latest GW version.
After connecting the GW to my network, i was perfectly able to ping it. MYScontroller could connect, however sending a command to the gateway rusults in an error (ERROR 10054).
I've been fighting with it for a day, exchanging compontents, rebuilding SW, etc.
Here is what solved it!
Changed the AVR release to 1.6.11
I know there are problems in AVR 1.6.X, but these should have been solved in 1.6.18 and higher. Apperantly that is not the case.
I hope this helps!