Skip to main content

MySQL and Arduino: United at Last!

  • Chapter
  • First Online:
Beginning Sensor Networks with XBee, Raspberry Pi, and Arduino
  • 2020 Accesses

Abstract

In previous chapters, I discussed several methods you can use to store sensor data. One of those methods is storing the data in a database located on your network. If you recall, this has several advantages, not the least of which is that you do not have to connect your sensor network to the Internet to enable this capability.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    I was unable to get the WiFi shield to work with the Due. The WiFi library needs some work in this area, because it results in compilation errors. Check the WiFi guide page for the latest concerning using the WiFi shield with the Due.

  2. 2.

    Yes, I am saying categorically and against what marketing materials may suggest that not all MySQL variants are 100% compatible. Some have minor changes to the client protocol, which causes the connector to behave in unexpected ways and, in some cases, fail.

  3. 3.

    Older versions of MySQL (prior to 8.0) may require passing NULL as the value for a TIMESTAMP column.

  4. 4.

    Breadboard and mounting plate by Adafruit (www.adafruit.com/products/275).

  5. 5.

    Assuming you have downloaded and installed the WiFi shield library from https://github.com/arduino/wifishield.

  6. 6.

    As satisfying as it may be, please refrain from giving your tiny Arduino skeet-shooting lessons. All is not lost, and most issues can be resolved with a little patience and the techniques described here.

  7. 7.

    An impossible feat for mere mortals.

  8. 8.

    You will be surprised how often this happens—and how humble you feel when you discover that it works great once it has proper power supplied.

  9. 9.

    Been there, done that. Twice. You know it’s got two ends, right?

  10. 10.

    A state of wonkiness where wonky is the norm.

  11. 11.

    There are many ways one can organize code. This is by no means the only or perhaps best way.

  12. 12.

    See the sprintf() documentation at www.cplusplus.com/reference/cstdio/sprintf/ for more details.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Charles Bell

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Bell, C. (2020). MySQL and Arduino: United at Last!. In: Beginning Sensor Networks with XBee, Raspberry Pi, and Arduino. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5796-8_9

Download citation

Publish with us

Policies and ethics