JovanYong Posted April 24, 2017 Share Posted April 24, 2017 I just want to check if it possible for chipkit wf32 to communicate to mysql. For example, inserting data from the sensors that connected to the chipkit and send the latest data to mysql database. Link to comment Share on other sites More sharing options...
jpeyron Posted April 24, 2017 Share Posted April 24, 2017 Hi @JovanYong, Here is the resource page for the WF32. It has library's for MPIDE that allow you to set up a http server using the sd card and the WIFI on the WF32. You can have sensor data accessible from a webpage ran by the WF32. From there you would have to get the data from the webpage and input it into MySQL. cheers, Jon Link to comment Share on other sites More sharing options...
JovanYong Posted April 25, 2017 Author Share Posted April 25, 2017 12 hours ago, jpeyron said: Hi @JovanYong, Here is the resource page for the WF32. It has library's for MPIDE that allow you to set up a http server using the sd card and the WIFI on the WF32. You can have sensor data accessible from a webpage ran by the WF32. From there you would have to get the data from the webpage and input it into MySQL. cheers, Jon @jpeyron Hey, i have use the example given and able to show a simple webpage. The problem is i dont know how to start, for example getting the data from my sql to the webpage. Is there a way? Im not really sure how to do it. Link to comment Share on other sites More sharing options...
D@n Posted April 25, 2017 Share Posted April 25, 2017 @JovanYong, Help me out here ... what's running on your WF32? Are you running SQL or a web-server on there, or hoping to access a web server hosted somewhere else? Most SQL commands can be packaged into HTTP requests, which--even without an HTTP library--aren't all that hard to code up as long as you have a TCP/IP stack. You might wish to practice, on your PC (not the WF32 ... yet) building your own code for accessing your mySQL server. Use only the libraries available on your WF32 to do this, and you should (God willing) be able to port the whole thing to the WF32. Wikipedia and Google are great places to help for getting protocol information. Still, feel free to write back and explain more of what you are trying to do if you find these instructions ... less than complete. Dan Link to comment Share on other sites More sharing options...
JovanYong Posted April 26, 2017 Author Share Posted April 26, 2017 @D@n Hey Dan! I Whats running on my WF32 is moisture, temperature and humidity sensor. I want to pump in data from sensors to mysql database every 10mins. So i was hoping if there is a way to insert the data from WF32 into mysql workbench. Link to comment Share on other sites More sharing options...
D@n Posted April 26, 2017 Share Posted April 26, 2017 @JovanYong, Ok, that makes perfect sense now. Thanks. The first step to success is going to be on your PC, not your WF32. On your PC, you should be able to telnet into your MySQL server. Do so. Look around. Figure out how to issue a command, and what letters and characters constitute that command from your PC. Map that out. Figure out the minimum command, and then come back here. You can find a touch of discussion regarding connecting to MySQL from TCP/IP here. That minimum command, the one necessary to add your measurements to your MySQL database, will be the command you need to send from your WF32. The next steps will be to 1) create a character string containing that command, 2) open a network connection to your MySQL server (just like you did with telnet), 3) send() the command, and then 4) close the connection. This latter part should actually be really easy. (I've at least done it often wish sockets, which make for somewhat of a POSIX interface--we can look up the MPIDE interface if you get stuck.) Sounds like a fun project though. Will you be posting your code when you are done? Either way, holler if/when you get stuck along the way, and we'll do what we can to get you "un-stuck". Dan Link to comment Share on other sites More sharing options...
Notarobot Posted April 26, 2017 Share Posted April 26, 2017 @JovanYong In professional world such data collection system is called SCADA that is the "Supervisory Control and Data Acqusition". I have substantial experience with commercial systems and I would love to have similar for environmental data. However, commercial is way too expensive for hobby and as everything requires training. I would suggest to research open source SCADA systems before diving into coding. BTW, MySQL workbench is just a management utility. I am not aware of using it as a data bridge. I also assume that you aware extracting data from the database requires customized software. For a small number of parameters like yours you don't really need relational database, you can accomplish your task using single 2d table. Link to comment Share on other sites More sharing options...
Question
JovanYong
I just want to check if it possible for chipkit wf32 to communicate to mysql.
For example, inserting data from the sensors that connected to the chipkit and send the latest data to mysql database.
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.