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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Within XBee range, of course.
- 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.
Since you pass the client variable by reference, you dereference the pointer using −> instead of a period.
- 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.
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.
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.
It must be a valid IP address for the network segment to which your server is connected.
- 8.
Yes, these exist! See www.sparkfun.com/products/10438 .
- 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.
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.
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
Rights 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
DOI: https://doi.org/10.1007/978-1-4302-5825-4_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-5824-7
Online ISBN: 978-1-4302-5825-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)