Are you building an IOT solution and want to know how to store and retrieve your IOT data? Perhaps you're new to database systems and want to learn how to use them while you explore the exciting world of IOT.
This book is the answer for both scenarios; whether you're new to IOT and want to know how to leverage MySQL in your solution or you've wanted to learn more about MySQL, this book will provide many of the answers you seek.
The book also covers how to design your IOT solution around your data. Not only will you learn more about MySQL, but you will also see how best to deploy MySQL in your IOT solution using low-cost computer boards such as the Raspberry Pi, Beaglebone Black, Intel Galileo, and more.
Finally, the book will give you a thorough overview of how data can be augmented and annotated to make it easier to glean the golden nuggets of knowledge you seek while wading through your sensor data.
You can find my book at most online book sellers or directly from Apress.
Nice!
ReplyDeleteThanks, I was shooting for nice. :P
DeleteCongratulations with your new book Chuck!
ReplyDeleteThanks, Geert.
DeleteLooks Great Chuck! Congratulations with this book. I would definitely want to read this :-)
ReplyDeleteThanks, Hema.
DeleteLooks interesting., Congrats Chuck!
ReplyDeleteI always failed when I tried your tutorial chuck. :(
ReplyDeleteHi. Sorry you're having trouble. I'd be happy to help you, but I'm going to need more information.
DeleteWhich tutorial? What went wrong? Was there an error message? What version of MySQL are you using? Etc. etc.
Hi Chuck. Is there a way to use your library to work with the ESP8266WiFi.h library instead of the WiFi.h lib?
ReplyDeletebruce
I bought this book a few weeks ago and working through it.
ReplyDeleteAll good stuff until ...
chptr6 when setting up the Arduino to communicate with the database on the RPi.
On windows the routine: Sketch->Include Library->Manage Libraries Brings up the Libraries manager window to select the relevant MqSQL* files.
On the RPi this path does not exist/;
Sketch->Import Library->Add Library does not bring up the Libraries Manager window.
I downloaded the zip file instead, unzipped it and placed the files in the "Libraries" file in the Arduino directory on the RPi. This eventually worked and now seems to compile. So now I have the program compiling on the PC and the Pi.
1. To run on the PC, where do I place the ino and sql files?
2. Run time (upload) on the Pi gives a processing.app.SerialNotFoundException: Serial port /devttyACM0 not found
refers to tools-> serial port menu, which is of little help to me.
help?
tia
cimh
I have not run the Arduino IDE on the RasPi. In general, libraries are placed in the user's Arduino/Libraries folder. Find out where that is and copy the downloaded MySQL Connector Arduino from git into that folder. This is what the library manager does for you.
ReplyDeleteSince you are not seeing the library manager on your RasPi, I wonder if you are using the latest version of the IDE? Check it and make sure you're using the very latest.
On the PC (Mac, etc.) it's the same - find the Arduino/Libraries folder and copy the connector there.
I don't know why you're getting an error running your sketch on the RasPi. The reference to the serial port is in the Arduino IDE when you are connecting to an Arduino board. Are you sure you're using the IDE to compile and run? Check your settings. Otherwise, I don't know what the reference is.
Also, what do you mean by sql files? Do you mean files with a .sql file name extension? Or are you referring to the MySQL Connector Arduino files and if so, in what context?
Feel free to email me directly if you need more, detailed help.
d r c h a r l e s b e l l at g m a i l dot c o m
Thank you for your prompt reply! :-)
ReplyDeleteI responded, but it seems to have gone awry...
As I said I did download the salient files to arduino/libraries and unzipped them. After *much* faffing around I have the 'hello_mysql' sketch verifying (compiling) on PC and pi. I'm surprised you've never run the arduino IDE on a RPi ... I thought that was the point? Anyway, I've just bought Beginning Sensor Networks, so perhaps there'll be some more info in there.
But back to the present. I presume the MAC address and the server address direct the hello_mysql.ino to the mysql server on the PC and the RPi?
I have used interrupts to follow thru the 'hello mysql' sketch using Serial.print() but it only gets as far as 'Ethernet.begin(mac_addr);' in setup():
'sudo ifconfig' shows I am using the correct mac address and ip address.
'USE test_arduino' is enabled ie is open on a terminal.
???
frustrated here
cimh
I will reply with more detail later. For now, here are some hints.
DeleteThe point of using the RasPi was to run the MySQL server on it and connect to it via the Arduino (or PC or another RasPi), not to run the Arduino IDE from it (but you can!). Typically, we use our PC to run the Arduino IDE to write and load sketches to our Arduino boards.
The Mac address must be unique on the network. That is, not the same as another machine on your network. The Mac address is NOT what is used to connect to the server, the IP address is. In your sketch, you need to use the IP address of the MySQL server.
Please reread those sections and look on the arduino.cc site for more information about networking with the Arduino.
Again, I will reply with more details later, but I think you've got a few things to sort out first about the basics of using the Arduino IDE and networking in general. I suggest looking at the networking example sketches too for inspiration.
Ok, so my hastily written first reply pretty much covers it. But I rephrase it here for more clarity.
DeleteYou must choose a mac address that is unique on your network, not the one matching your PC, RasPi, etc.
You must use the IP address of the MySQL server, not the IP address of your host, PC, etc. Unless, of course, one of those is your MySQL server. ;)
The Ethernet.begin() method can hang for a number of reasons. Most likely causes include the hardware is not compatible with the Ethernet class, the hardware doesn't work, or you using the wrong mac address, or in your case a DNS server cannot be found on the network.
My advice is to fix the mac address problem, make sure you're hardware is working correctly, and build, compile, and load your sketch to your arduino from your PC.
You may want to look at the troubleshooting section in the Connector/Arduino manual too.
If you are still having problems, send me your sketch and I'll take a look at it. Be sure to include the type of board you're using, the type of networking shield/module, etc.
Chuck,
Deletefwiw the mac address I'm using is for the RPi, as is the arduino ide and the mysql server.
I'll do what you say and go check everything - and address the other suggestions you make etc.
PS your "Beginning Sensor Networks..." book arrived this morning. I'm something of a rank noobie here, but I'm minded to get my head round this stuff.
Thank you very much for your responses, appreciated.
simh
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.
ReplyDeletev
Hello, i'am using the MYSQL Conn for arduino, and i've receiving a BAD MOJO, can you help-me?
ReplyDeletewhen i try to use SELECT i receive BAD MOJO
I can use INSERT, but SELECT don't return the data
print: http://imgur.com/DJcSWv5
script: https://pastebin.com/mvUHNBur
Sorry for bad inglish, i'am brazilian
Change your query to:
ReplyDeleteSELECT population FROM world.city WHERE name = 'New York'
If that doesn't work, please tell me what version of MySQL and the connector you are using.
Hello, is me again, now i have other problem, when i try to select using a variable i get Error: 158 = You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''%s' at line 1. But the syntax are ok, works in mysql server 5.5, can u help-me?
DeleteScript:https://pastebin.com/WwukKiCV
TY
Please paste the output of the serial monitor so I can see the query.
DeletePrint: http://imgur.com/a/KHGvO
DeleteOk, so you have an issue with the format string. Try this:
Deletechar SELECT_DATA[] = "SELECT acesso FROM test_arduino.autorizacao WHERE ID LIKE '%c%s%c'";
...
sprintf(query, SELECT_DATA, '%', card_id, '%');
are working now! Tankyou again
DeleteNow it is working, I was using a 5.0 database created with XAMPP and when I tried to select some data I received a message saying that the database was not selected.
ReplyDeleteWith MySQL community 5.5 I did it.
Thanks Dr. Chuck.
If you want information about Internet of Things then please visit
ReplyDeleteInternet of Things
Hi, My name is Wagner, I'm brazilian. I'm reading your book "MySQL for the Internet of Things" and I'm following the steps to move the Data Directory to the External Disk.
ReplyDeleteBut there was an update of MySQL and so I can not conclude, it presents an error when I restart MySQL. Is there any release regarding this difference? nuneswagner@hotmail.com or embarcandoideias@gmail.com Thanks.
Great post.
ReplyDeleteLearn Mysq Online