Build a Weather Station with Elixir and Nerves
Visualize Your Sensor Data with Phoenix and Grafana
by Alexander Koutmos, Bruce A. Tate, Frank Hunleth
Version: P1.0 (January 2022)
Copyright 2022 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/#about-ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/passweather, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Dave Rankin (CEO) Janet Furlow (COO) Tammy Coron (Managing Editor) Jacquelyn Carter (Development Editor) L. Sakhi MacMillan (Copy Editor) Gilson Graphics (Layout) Andy Hunt and Dave Thomas (Founders)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Copyright 2022, The Pragmatic Bookshelf.
Early Praise for Build a Weather Station with Elixir and Nerves
I came to this book without any Nerves experience, but left feeling empowered. The authors demonstrate how powerful Nerves is and how we can build useful hardware projects with very little code. I highly recommend this book, especially if its your first hardware project.
Stephen Bussey |
Founder, Clove and author of Real-Time Phoenix |
The project is very clear without being too simple. Looks really fun and I know from experience that Nerves is a great way to get some hands-on experience with Elixir.
Lars Wikman |
Founder and CEO, Underjord AB |
A great introduction to Nerves with a practical project that also succeeds as an introduction to powerful tools such as Docker Compose, Grafana, and TimescaleDB.
Anderson Cook |
Software Engineer, dscout |
A compelling interleaving of systems design and embedded development knowledge that uncovers a productive and approachable workflow with Nerves.
Jason Johnson |
Co-owner, FullSteam Labs |
Acknowledgments
It has most likely been said before, but we think it is worth saying again: writing and publishing a book that you are genuinely proud of takes a village. What you see before you would not have been possible without the people mentioned in this section, and we would like to take the opportunity to thank them for all of their time and effort.
We would like to start by thanking the staff at The Pragmatic Bookshelf for all of their help and support. Working with The Pragmatic Bookshelf has been both a pleasure and an honor. A special thanks must also be given to Jackie Carter, our editor, who worked tirelessly to ensure that the book we produced was all that it could possibly be. For a couple of us, this book was our first publication, and Jackie was always there to guide us when we needed help.
Creating a project-based book that is both concise and a pleasure to read was no easy task, and a huge thanks is needed for our technical reviewers who helped us realize this goal. Steve Bussey, Anderson Cook, Sophie DeBenedetto, Jason Johnson, Nikos Maroulis, Parker Selbert, and Lars Wikman all provided the critical feedback necessary to ensure that the final book was technically correct, easy to follow, and flowed naturally.
While also being an author of this book, a big thank you should also be extended to Frank Hunleth for all of his hard work around Nerves. Without all of his contributions to the Nerves framework and the ecosystem of tools surrounding Nerves, this book would not have been possible. Similarly, we would also like to thank Justin Schneck for all of his contributions to Nerves and the supporting ecosystem, as the tools would not be what they are today if it were not for his efforts.
A special thanks is also in order for the creator of the Elixir programming language, Jos Valim. The Elixir programming language and community has made a profound impact on all of our careers, and we are all extraordinarily grateful for everything that Jos does to push the language, community, and ecosystem forward.
Lastly, we would like to thank our families and friends for all of the love and support while we were working on this book. Creating this book was a labor of love, and it would not have been possible if it were not for the amazing people that surround us.
Alexander Koutmos
I would like to personally thank my wife, Carol, and our two daughters for all of the love, happiness, and joy that you give me every single day. The three of you are the source of my strength and motivation that allow me to create things such as this book, and I am truly blessed to have you all in my life.