2. Data transfer rate is too high or transmitting too much data at one time.

Try slowing the sampling rate and reducing the amount of data transferred each trip. Remember, the Arduino is a very slow microprocessor and not a PC. Plus, the hardware in general is slower. For example, some WiFi and Ethernet shields are slower than you may expect. Save only the data needed such as raw data values and reserve aggregation (sum, average, etc.) for the database server.

Make sure you read all of the results from a query that returns data before running the next query.

4. Network issues

If your network is slow or can have drops or other periods of instability, you must change your sketch to detect when the connection drops and reestablish the connection. See the docs for an example of the connect/disconnect technique.

Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.