Skip to main content

Building Your Network: Arduino Wireless Aggregator + Wireless Sensor Node + Raspberry Pi Server

  • Chapter
  • First Online:
Beginning Sensor Networks with Arduino and Raspberry Pi

Abstract

With the information you have learned thus far in the book, and especially in Chapters 6 and 7, it is time to put it all together and build your first sensor network with a MySQL database server.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Within XBee range, of course.

  2. 2.

    If you plan to use this project as a model for your custom sensor network, you may want to consider writing code to check for memory overruns.

  3. 3.

    Since you pass the client variable by reference, you dereference the pointer using −> instead of a period.

  4. 4.

    Why only four digits (characters)? Won’t there be collisions? No, not necessarily. Most XBee modules you can purchase do not have 64-bit addresses where the last four digits are the same. It is possible, but unlikely. If you find this is the case for your XBee modules, consider using the last eight characters instead.

  5. 5.

    I did not use templates here because I do not want to make the code too complex. As it is, unless you are familiar with pointers, you may think this code is illegible and won’t compile or that it mysteriously “just works.” In that case, you have to take my word that it does. How much more mysterious can someone make their code for those new to Arduino programming than by using templates? I know some very good C++ programmers who find using templates a challenge.

  6. 6.

    Which reminds me of my advanced statistics professor, who opened the semester with the question, “How much data makes for a statistically relevant sample size?” He did not offer an answer, but he asked the question again at the end of the semester. To his delight, the answer presented by the students was, “It depends on what you’re doing with the data.” When pressed for a numerical answer, his response was unwaveringly, “42.”

  7. 7.

    It must be a valid IP address for the network segment to which your server is connected.

  8. 8.

    Yes, these exist! See www.sparkfun.com/products/10438 .

  9. 9.

    What is missing here? Can you spot a potential problem with this table? I’ll give you a hint: can it accept duplicate rows? What about ordering of the rows? Are these an issue?

  10. 10.

    I call it an infinity loop because the test condition is always true. In this case, unless you kill the script or press Ctrl+C, it will continue to run as long as the hardware remains powered on and working.

  11. 11.

    You have used some in previous chapters, but you may need a few more depending on how many sensor nodes you decide to add.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Charles Bell

About this chapter

Cite this chapter

Bell, C. (2013). Building Your Network: Arduino Wireless Aggregator + Wireless Sensor Node + Raspberry Pi Server. In: Beginning Sensor Networks with Arduino and Raspberry Pi. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-5825-4_8

Download citation

Publish with us

Policies and ethics