Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Bugs & Suggestions / Arduino 15 & sprintf memory footprint increase? on: May 13, 2009, 04:11:10 am
did something change in Arduino 15 that would alter the memory footprint of sprintf or other functions?

i have some demo pachube code for the ethernet shield (http://community.pachube.com/?q=node/112) which works fine up till Arduino 14, but on Arduino 15 i start getting errors that i presume are caused by running out of RAM.

working with an Arduino Diecimila on Arduino 15 i observed the following:

- if i include the following line
Code:
sprintf(pachube_data,"%d,%d,%d,%d,%d,%d",analogRead(0),analogRead(1),analogRead(2),analogRead(3),analogRead(4),analogRead(5));
then the board will constantly freeze/reset, etc.
- if i replace pachube_data with something static no problem.
- if i try to do a hack using itoa same problems as sprintf
- if i use the original code, incl. sprintf, in Arduino 14 i have no problems.

however, the following code does work fine, so sprintf is definitely OK in A15:

Code:
#include <stdio.h> // for function sprintf

void setup(){  
  Serial.begin(57600);
}

void loop(){
  char pachube_data[128];
  sprintf(pachube_data,"%d,%d,%d,%d,%d,%d",analogRead(0),analogRead(1),analogRead(2),analogRead(3),analogRead(4),analogRead(5));  
  Serial.println(pachube_data);
}

of course it might be some other function in my code that has expanded, but since sprintf is usually so hungry i'm presuming it's the culprit.

incidentally, i have not been able to get the Mega to work with the basic Ethernet shield examples, and so have not yet been able to see how it works with larger RAM.
2  Forum 2005-2010 (read only) / Interfacing / Re: Diecimila and Processing Arduino class on: March 06, 2008, 05:04:37 am
whoa... ignore below -- i just redownloaded the original link from the wiki and had no problem; will delete my entry there.

-------------
as far as i could tell the revision *wasn't* in the latest processing library (at least as downloaded from here: http://www.arduino.cc/playground/Interfacing/Processing ); so i've made the revision and a new .jar and uploaded a 2nd version of the library (also uploaded to that page) for those who have difficulty. this has been tested on my mac and using a diecimila which was giving me trouble and it seems to work.

(mellis, please feel free to change my entry on the arduino wiki if you think it confuses the issue to have 2 different libraries...)
-------------
3  Forum 2005-2010 (read only) / Development / Re: Arduino Ethernet Shield on: March 26, 2008, 01:40:03 pm
the example code was perhaps a *little* daunting for newbies.

to make it a bit more straightforward i've pulled out a few of the functions -- probably worth adding something like this to the library to make it simpler for those who basically just want to be able to serve webpages with dynamic values.  

you can download the template here (just make sure you have the etherShield library installed; and set your IP address to one that doesn't already exist on your network).

then your setup and loop would look simply like this.....

Code:
// you can change this line if you want to serve, for example, XML or some other content type
#define HTTP_HEADER "HTTP/1.0 200 OK\r\nServer: arduino\r\nContent-Type: text/html\r\n\r\n"

void setup(){
  setupEthernet("192.168.000.060", 80);   // must include padded 0s in the IP address
}

void loop(){

  //put your code here
  
  // then check for requests, and if so, serve the webpage  
  if (ethernetRequest()){
    writeHeader();    
    writePage("<h1>This is your Arduino speaking!</h1>");    
    writePage("<h3>Analog values:</h3>");    
    for (int i = 0; i < 6; i++){
      writePage("<br>");
      writePage(analogRead(i));
    }
    servePage();
  }
}




(btw, couldn't get alternative ports to work either in my example or in the original; however didn't spend a long time debugging)
4  Forum 2005-2010 (read only) / Development / Re: Arduino Ethernet Shield on: March 20, 2008, 03:29:34 pm
very nice... by coincidence just today i posted some really really feeble arduino webserver code at ladyada's forum, based on the xport ethernet shield; http://forums.ladyada.net/viewtopic.php?t=5458

but your system looks a LOT more robust! looks like you can have some nice CGI on there too... hope you have a few in stock smiley-wink

(incidentally, accessing your website directly www.nuelectronics.com attempts to forward to the nonexistent http://estore/ rather than http://www.nuelectronics.com/estore/)

5  Forum 2005-2010 (read only) / Interfacing / Re: Xport Direct vs. Direct+ (or something else?) on: June 03, 2008, 10:05:32 pm
FYI, If you would like to use Pachube, we have the tutorials mentioned above here: http://community.pachube.com/?q=node/9 for using Arduino; there is a link to a small script that uses LadyAda's ethernet shield and xport Direct. Yes, this would make graphing your values pretty straightforward, and even possible to embed the graph in a webpage. e.g. see here, for the realtime updated, 24 hour light level graph of an arduino in our office (which uses a nuelectronics shield): http://pachube.com/feeds/60/datastreams/0/history.png

so you could add your feed to pachube, then view the URL on your iPhone.

on the other hand, if you want your iPhone to share its sensor data with pachube (and potentially with your arduino) in the other direction, then here's a tutorial on getting iPhone to share it's geolocation as a sensor feed (which of course could be accessed by your arduino in the same way): http://community.pachube.com/?q=node/57

basically means you could have your iphone and your arduino sharing sensor data back and forth using pachube as the web proxy.
6  Forum 2005-2010 (read only) / Exhibition / Updated Pachube / Ethernet Shield code on: May 13, 2009, 09:42:41 am
For any Pachube users, I've just updated the example sketches for connecting with Arduino + Ethernet shield (this is for sharing and requesting data sensor data from www.pachube.com; and for controlling Arduino remotely from a webpage), full info available in the tutorial: http://community.pachube.com/node/112.

Anyone using Arduino Ethernet with Pachube would benefit from the updated code, as long as you use Arduino 14 IDE, and not Arduino 15.

The two example sketches have the following improvements:

- More stable HTTP header parsing (Pachube changed some of its headers which was throwing off some of the parsing).
- Should no longer timeout when millis() wraps around
- Added "User-Agent: Arduino" to the headers, so that in future Pachube will be able to identify what hardware is making the request

the tutorial is here: http://community.pachube.com/node/112.

and direct links to the downloads are:
http://community.pachube.com/files/ethernet_Pachube_input_output_1_1.zip
http://community.pachube.com/files/ethernet_Pachube_controller_1_1.zip
7  Forum 2005-2010 (read only) / Exhibition / Arduino Ethernet: remote sensors & web control on: December 29, 2008, 07:02:04 am
This may be useful for people using the Arduino Ethernet shield to connect to the web - I've just uploaded two examples using www.pachube.com (a) to give your Arduino "remote" sensors and to share your realtime sensor data with others (and graph, store and monitor remotely); and (b) to use a web page to control the Arduino remotely (this requires no additional server-side programming, it's just an HTML page).

Arduino Ethernet and Pachube: remote sensors & web-control: http://community.pachube.com/?q=node/112

Quote
These sketches should make Arduino-based web-controlled home automation, and remote-responsive spaces a lot easier. The advantage of working with an ethernet shield is that you no longer need to tether the Arduino to a computer in order to access Pachube and other network services!

These are coded for the official Arduino Ethernet shield. We've had better, more consistent, results with this shield than others that are available; we also find it easier to work with and code for so we'll generally be developing examples using this shield from now.

(The web-accessing code could be edited to connect to any web service; the advantage is that it repeatedly connects to a website on a given interval, and between connections keeps looping normally so that the sketch doesn't freeze)

8  Forum 2005-2010 (read only) / News / Re: pachube beta testers?sharing networked sensor on: February 25, 2008, 07:38:04 am
scrambled bites: what a lovely idea for a residency! did they have a follow up event?
9  Forum 2005-2010 (read only) / News / pachube beta testers?sharing networked sensor data on: February 22, 2008, 07:43:59 am
dear all

we're about to launch a web-based "patch-bay" for sharing real time networked/remote sensor data and there are a few more places available for beta-testers.

briefly, pachube (www.pachube.com) will be a web service for connecting together and sharing real time sensor data from objects, devices and environments around the world; a kind of "youtube" for interactive systems where any project can "plug in" to any other project to create geographically scattered interactive environments.

i stress that the various bits are not quite ready yet so links to things may not work, but to give you a flavour, for Arduino users specifically these may be useful:

-  Pachube site (not yet live)
-  general Pachube information
-  Pachube/Arduino tutorials
-  Pachuino: using Processing/Firmata/EEML to make an arduino with both local and remote sensors
-  Adafruit has just released an Ethernet shield for Arduino

please see below if you are interested in being a beta-tester (you should be a reasonably proficient developer because not everything will be perfect yet!). beta-testing will start in March 2008.

please email beta [ at ] pachube [ dot ] com to let us know if you are interested.

thanks,

usman


=================


Pachube
-------

Pachube (pronounced "patch bay") is a web service available at pachube.com that enables people to tag and share real time environmental data from objects, devices and spaces around the world.

The key aim is to facilitate interaction between remote environments, both physical and virtual. Apart from enabling direct connections between any two environments, it can also be used to facilitate many-to-many connections: just like a physical "patch bay" (or telephone switchboard) Pachube enables any participating project to "plug-in" to any other participating project in real time so that, for example, buildings, interactive installations or blogs can "talk" and "respond" to each other.
  
Pachube is a little like YouTube, except that, rather than sharing videos, Pachube enables people to monitor and share real time environmental data from sensors that are connected to the internet. Pachube acts between environments, able both to capture input data (from remote sensors) and serve output data (to remote actuators). Connections can be made between any two environments, facilitating even spontaneous or previously unplanned connections. Apart from being used in physical environments, it also enables people to embed this data in web-pages, in effect to "blog" sensor data.

Pachube makes use of Extended Environments Markup Language (EEML) and an EEML Processing library is available to connect directly to Pachube without needing to know or understand EEML. A basic API will also make it possible to serve and request data in CSV format by HTTP GET/POST.

There is a tutorial available for beginner/intermediate Arduino and Processing users to connect Arduino to Pachube (both as an input and as an output).

Relevant URLs:

- http://www.pachube.com/ (the home of Pachube, not yet open to the public)
- http://haque.co.uk/pachube.php (explanation about Pachube)
- http://eeml.org/ (Extended Environments Markup Language)
- http://eeml.org/library/ (EEML library for Processing)
- http://haque.co.uk/pachube/tutorial/arduino/ (connecting Arduino to Pachube)
- http://haque.co.uk/pachube/tutorial/arduino/pachuino.html (Pachuino, a Pachube-enabled Arduino)
Pages: [1]