Hi everyone
I've been lurking around the arduino forums for some time and there are some really great ideas floating around. I've started a thread before aking some advice on communications between the arduino and python and had some contructive feedback.
Saying that I woke up this morning questioning my strategy as to how I'll get this project working.
As the title suggests I'm interested in controlled environments and as such want the arduino to be the "brains" behind the operation. Now I have been working on this project for a few months and come across a number of obsticles but I feel however that the way I'm approaching this is not that efficient. I know this is an "arduino" forum, although I feel I need to explain all technoliges I use to give the reader a better understanding on what I am trying to accomplish.
My project in a nutshell: Sensors are attached to inputs in the arduino mega. Relays are attached to outputs on the arduino mega. A raspberry Pi, which hosts the webserver and mysql database, is attached to the arduino mega. My goal is for sensor readings to display on a website and relay setpoints (entered on website) to controll arduino outputs. I also want this to be as near to real time as posible but Im happy with say a 20second delay between entering in data and then the arduino receiving the data.
At the moment sensor values are stored on mysql, which is read by the webserver. Relay setpoints are read into the webserver and stored in mysql. Reading to and from the arduino is done with python scripts. I actually use two scripts, one for logging purposes and the other for updated sensors/relay information. The problem I face is sending sensors values to mysql and receiveing relay information from mysql at the same time ( I can do separately).
So I would like to know how I accomplish my project in an efficient way that hopefully will run smoothly which will not corrupt strings or use unneccesary resources. I have seen forums on using EEPROM but its so confusing to me and I dont know why I cant accomplish this by just reading into or reading from mysql. I've tried to look for threads with similar goals but have struggled to find any meaningfull or well explained documentation
Any feedback is appreciated!