Show Posts
|
|
Pages: 1 2 [3] 4 5 ... 19
|
|
31
|
Topics / Home Automation and Networked Objects / Re: Standalone Datacollecting Webserver
|
on: March 06, 2013, 07:17:09 am
|
Stephen, so if one wishes to see anything on your web site, it seems one needs to login, is that right? If so, are you willing to give details on logging in, so as to allow us to gain further insight? On your 'about' page you have the following; Hi! my name is Stephen I am a 4th year Student, that is studying Computer Engineering Generally we refer to one's self as 'who' not 'that'. Home and commercial growers can have a great piece of mind by knowing how a glasshouse or polytunnel is performing in their absence and that they can check it from a remote computer or mobile device You are telling the world that home and commercial growers potentially can have a great piece of mind? I think you are meaning to say something like this, please excuse my editing; 'Today, home and commercial agricultural growers can enjoy a better peace of mind knowing their automated glasshouses or poly-tunnels can be carefully monitored and controlled with Stephen's magic box' You need to run your spell checker, lest your final year project attracts less marks. _____ Paul
|
|
|
|
|
32
|
Using Arduino / Project Guidance / Re: Load sensor amplifier
|
on: March 05, 2013, 07:08:10 pm
|
$0.99 50 x Resistors 250 Ohms OHM 1/4W 5% Carbon Film $0.99 50 x Resistor 10K Ohm 1/4W 0.25W 5% Carbon Film $0.99 3 x 0.1uF 50V Radial Capacitor Tantalum $14.28 2 x INA122 Precision Instrumentation Amp, 2-36Vsup R-RO
Total: $17.25
worth it?
As Lefty say's, 'priceless', though one has to wonder why on Earth, or in your case 'a rogue planet called Nibiru' would you design a circuit with a precision op-amp costing $14 and buy for less than one dollar, 50 resistors that are a inferior 5% carbon film? I can see that the two 10kΩ resistors probably do not need to be exactly 10kΩ, but for me, it's about good design practice. Out of the 48 resistors left over, a time will come where you wished you had 1% metal. _____ Paul
|
|
|
|
|
33
|
Topics / Home Automation and Networked Objects / Re: Standalone Datacollecting Webserver
|
on: March 05, 2013, 06:53:09 pm
|
Just wondering couldn't I use the arduino to send the data of the three singals to pachube and get pachube to graph and send the graph onto my site?
Yes, you could, COSM exists for that reason. Though you don't get COSM to send the graph to your site, rather, your site gets it from COSM. Was looking into this and I guess I found some example of this a setting up a trigger of some sort, can this be done? if so is it anygood/reliable, would cut my time alot! You 'guess' or you 'did' find an example and if you did, then by implicitly of statement and by my reckoning, it can be done. A trigger to do what exactly? I thought from what you were saying; Has 'your goal' now changed? Ok will give that a shot, have and great looking website now will try with eclipse! Give what a shot? Are you saying you have a great looking website (now?), if you are willing to share could we have a look? Seems like you have raised more questions for me. To help me, as I prefer to not guess and assume, would you be willing to be more clear and concise with your comments? _____ Paul
|
|
|
|
|
34
|
Using Arduino / Programming Questions / Re: Is there a better way than using sprintf to format my data.
|
on: March 05, 2013, 07:39:14 am
|
A further refinement of your new method might be to ... put it in a function that takes two char*s and an int so you can pass postData, the identifying string and the value. Slightly less code. Even though you're using a mega, I'd still be reluctant to use such a large buffer for the postData. Can you send the values one at a time? Add a timestamp if you need the datapoints to all have the same time on them.
Good point wildbill, especially since this is not the only routine I have for posting data out of the Arduino. This one just happens to be one of the larger ones, and my thing is that if I wish to have more routines that send data out of the Arduino, well, it may become a problem with having such large char buffers, even though they only have local scope but the data is passed in the call to the actual posting routine. I don't wish to send each key value pair as a separate post if that is what you mean, the overhead in terms of http requests would see my router go berserk, and maybe smoke from the Wiznet chip.  The timestamp is again a good idea, though I shouldn't need it, I send small packets of data to the host site at a rate of every five seconds for close to real-time sensor readings and every 60 seconds for statistical data like the code discussed. I have the php script on the server set the time for any data I store to SQL database. Thanks again for your input. ____ Paul
|
|
|
|
|
35
|
Using Arduino / Programming Questions / Re: Is there a better way than using sprintf to format my data.
|
on: March 05, 2013, 07:16:11 am
|
Thank you linwendil for your effort in explaing that clearly to me, I appreciate it. JSON stores values in arrays, while your C code indeed sets it all to one string, thats not how JSON is meant to work. If you store it as a string you are not really takeing advantage of what JSON gives you.
Yes, you are correct. My use for using a json formatted string is simply that I use this format to POST data from the Arduino to a remote server, which stores the data in either file or SQL database. When a client connects to the remote server site, the server simply passes out that data again as json formatted data as text in a html POST back to the client. On the the client side javascript, I require it as json format as I use Backbone.js Model View Controller which is tied with jquery. I'm looking to make some changes so that I might move from using json as a wrapper for my KVP data to just the KVP data itself. Presently, it is all working [check sig], from Arduino through to host site and then to client, I am looking to make improvements I guess. There is a few C/C++ libaries to handle JSON to, but I don't know if there is any Arduino specific Here is one you may be interested in looking at specifically for Arduino, https://github.com/lasselukkari/aJson_____ Paul
|
|
|
|
|
36
|
Using Arduino / Programming Questions / Re: Is there a better way than using sprintf to format my data.
|
on: March 05, 2013, 05:36:53 am
|
linwedil wrote: You do know you are putting many arrays (JSON) into one array? I wonder if you might explain that to me as I understand all I am doing is constructing a single json string containing multiple key value pairs? My structure starts and ends with braces, and has no other braces or brakets within to suggest it is an array containing arrays. I should have pointed in my first post out that I am using a Mega board. Going on what AWOL was saying, I have just tinkered with the following method; void statPost() { char postData[425]; char buffer[16];
strcat(postData, "id:stat,vT_minHour:"); strcat(postData, itoa(vacHydro.minHour, buffer, 10));
strcat(postData, "vT_maxHour:"); strcat(postData, itoa(vacHydro.maxHour, buffer, 10));
strcat(postData, "vT_minDay:"); strcat(postData, itoa(vacHydro.minDay, buffer, 10));
strcat(postData, "vT_maxDay:"); strcat(postData, itoa(vacHydro.maxDay, buffer, 10));
strcat(postData, "iT_inHour:"); strcat(postData, itoa(idcHydro.AmpsHour, buffer, 10));
strcat(postData, "iT_inDay:"); strcat(postData, itoa(idcHydro.AmpsDay, buffer, 10));
strcat(postData, "iT_inWeek:"); strcat(postData, itoa(idcHydro.AmpsWeek, buffer, 10));
strcat(postData, "iS_peekHour:"); strcat(postData, itoa(idcSolar.peekHour, buffer, 10));
strcat(postData, "iS_peekDay:"); strcat(postData, itoa(idcSolar.peekDay, buffer, 10));
strcat(postData, "iS_inHour:"); strcat(postData, itoa(idcSolar.AmpsHour, buffer, 10));
strcat(postData, "iS_inDay:"); strcat(postData, itoa(idcSolar.AmpsDay, buffer, 10));
strcat(postData, "iS_inWeek:"); strcat(postData, itoa(idcSolar.AmpsWeek, buffer, 10));
strcat(postData, "vB_minHour:"); strcat(postData, itoa(vdcBattery.minHour, buffer, 10));
strcat(postData, "vB_maxHour:"); strcat(postData, itoa(vdcBattery.maxHour, buffer, 10));
strcat(postData, "vB_minDay:"); strcat(postData, itoa(vdcBattery.minDay, buffer, 10));
strcat(postData, "vB_maxDay"); strcat(postData, itoa(vdcBattery.maxDay, buffer, 10));
strcat(postData, "vB_inAmpsDay"); strcat(postData, itoa(battery.inAmpsDay , buffer, 10));
strcat(postData, "vB_outAmpsDay"); strcat(postData, itoa(battery.outAmpsDay, buffer, 10));
// Serial.println(postData);
if(!postPage(postData)) { // Serial.println("Error Post stats"); ++fltCountPOST; } else { // Serial.println("Post stat"); ++okCountPOST; } } Which I am thinking will achieve a similar result, except just going for a key value pair string without the json format of braces and quotes. But after compiling it comsumes an additional 300 odd words of memory over my original code section. I didn't load it up to the board to see the results at this stage. But to me, it is far more readable and easy to make alterations to. linwendil wrote: make an vector array but that would make it easier to access and also make it possible to loop through it more easily Ok, I could look into that I guess. Thanks for your advice. ______ Paul
|
|
|
|
|
37
|
Using Arduino / Programming Questions / Re: Is there a better way than using sprintf to format my data.
|
on: March 05, 2013, 03:56:24 am
|
|
@michinyon, I didn't say I had an actual problem, more that the code I presented is somewhat difficult to maintain fot the reasons I explained. For example, if I were to insert additional parameters to build up my formatted json char array, I need to carefully work out the placement of the substitution and then aslo for the format within the sprint statement.
@AWOL, ok, I take you point, though I understand that that would only apply to the first part where I have the parameter substitution, am I right? The remainder are my data variables, e.g. vacHydro.minHour I guess, you can see that it is unreadable, I agree, it's an eye strain.
I guess what I am asking, is there a better method in terms of programming that I can achieve the same result as this.
As a second part to my question, how big can I keep going with adding more parameters to such a sprintf statement, I'm guessing there is a practicle limit when it comes to Arduino. _____ Paul
|
|
|
|
|
38
|
Using Arduino / Programming Questions / Is there a better way than using sprintf to format my data. [SOLVED]
|
on: March 05, 2013, 01:39:31 am
|
Fellow Arduinoins, I have need of some advice. In the code I use for my HydroSolar project I gather data from sensors on the analogue ports and I maintain various statistical data on the readings. I then format this data into a json style format which I then use a html POST method to suffle the data to my host site where it is received and dealt with there. Now the specific code I have for formatting the various values to json are held, not in a string of course, but in a character array using the int sprintf ( char * str, const char * format, ... ); method. Here is one of my routines that uses this code: void statPost() { char postData[425]; // allocate enough space in the char array
sprintf(postData, "{\"id\":\"stat\",\"vT_minHour\":%1i,\"vT_maxHour\":%2i,\"vT_minDay\":%3i,\"vT_maxDay\":%4i,\"iT_inHour\":%5lu,\"iT_inDay\":%6lu,\"iT_inWeek\":%7lu," "\"iS_peekHour\":%8i,\"iS_peekDay\":%9i,\"iS_inHour\":%10lu,\"iS_inDay\":%11lu,\"iS_inWeek\":%12lu," "\"vB_minHour\":%13i,\"vB_maxHour\":%14i,\"vB_minDay\":%15i,\"vB_maxDay\":%16i,\"iB_inDay\":%17lu,\"iB_outDay\":%18lu}", vacHydro.minHour, vacHydro.maxHour, vacHydro.minDay, vacHydro.maxDay, idcHydro.AmpsHour, idcHydro.AmpsDay, idcHydro.AmpsWeek, idcSolar.peekHour, idcSolar.peekDay, idcSolar.AmpsHour, idcSolar.AmpsDay, idcSolar.AmpsWeek, vdcBattery.minHour, vdcBattery.maxHour, vdcBattery.minDay, vdcBattery.maxDay, battery.inAmpsDay, battery.outAmpsDay);
if(!postPage(postData)) { ++fltCountPOST; } else { ++okCountPOST; } } I would like to see how others might do this differently, or is this another way to do this? To me, it seems a difficult method to maintain. _____ Paul
|
|
|
|
|
40
|
Community / Website and Forum / Re: Forum Website Down
|
on: March 04, 2013, 10:15:45 pm
|
It started to improve after my cup of coffee this morning. Yes, now, all is back to normal. Maybe it was Lefty burning a special modded bootloader again  @Msquare, you're a late night programmer, it must be just after 04h00 for you there!
|
|
|
|
|
43
|
Using Arduino / Project Guidance / Re: Load sensor amplifier
|
on: March 04, 2013, 07:20:42 pm
|
|
You would be better off if you did search for the terms 'load cell amplifier' as I mentioned. Searching for 'voltage op-amp IC' will not directly lead you to what you need. You will get lots of hits on IC's and not so many for the circuit you need.
As Lefty says, using a load cell needs a special type of op-amp circuit. Many years ago I used really big load cells to measure the weight of CO2 vessels at a beer brewery. The CO2 was a by product of fermentation.
Sorry Lefty, I guess we posted together almost.
|
|
|
|
|
44
|
Using Arduino / Project Guidance / Re: Load sensor amplifier
|
on: March 04, 2013, 06:00:38 pm
|
|
Have you tried in another tab with 'google' to search for load cell amplifier, when I did I got back 'About 2,230,000 results (0.31 seconds)', with a zillion images of circuits and products, even some that looked Arduino'ish.
So, yes to both your questions, you can build and obviously you can also buy otherwise such a product would be useless. For building, what are your electronic building skills like?
These load cells are 4 wire and essentially a resistance bridge where you need to provide excitation across the bridge to measure the voltage on the opposite side of the bridge. You don't want to measuring the resistance directly, that won't work.
|
|
|
|
|
45
|
Community / Website and Forum / Re: Forum Website Down
|
on: March 04, 2013, 05:50:13 pm
|
The forum seems painfully slow for me this morning. Anybody else noticing this? I could go and make a cup of coffee while I waited for the server to deliver the page. It seems variable, so maybe the server is loaded down with many 'noobies' 
|
|
|
|
|