Go Down

Topic: Problem with 1.0.3 (Read 1 time) previous topic - next topic

gowfster

I apologize if this is already discussed elsewhere, but I keep getting errors when I try to search the forums (Daemon not available?).

I have a small program working fine under 1.0.1 that simply reads a DHT11 temp/humidity sensor and serves a simple web page to tell me the current status. 

I just upgraded to 1.0.3, and the same code will no longer compile. The specific line at issue is identified in my header below. 
The other oddity with this code (in 1.0.1) is that it runs great when served to an Ipad, but has an odd behavior when to my PC.
The specifics of both problems are captured in the header.  Thanks in advance for help on either/both of these problems!
Gowfster

// This is simple Ethernet server for my first try
// I had to change Server to EthernetServer, and Client to EthernetClient to get this to work
// This file works great under Arduino 1.0.1, but I get error on following line in 1.0.3
//  dht11 DHT11;  I don't know why or how to resolve
// The other issue I'm having is that from my IPAD, this works just fine, but if I access from PC,
// The counter seems to increment by two for a single access.  I have no idea why?

#include <SPI.h>
#include <Ethernet.h>
#include <dht11.h>
#include <Versalino.h>
dht11 DHT11;
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip[] = {192,168,1,149};
byte PassCount = 0;
EthernetServer server(80);

void setup() {
  Ethernet.begin(mac,ip);
  server.begin();
  Serial.begin(9600);
  pinMode(6,OUTPUT);
  DHT11.attach(2);
  Serial.begin(9600);
  Serial.println("DHT11 Over Ethernet TEST PROGRAM ");
}

void loop()  {
  EthernetClient client = server.available();
  if (client) {
    client.println("HTTP/1.1 200 OK");
    client.println("Content-Type: text/html");
    client.println();

    Serial.println("enter code body");
    client.println("<p><span style=font-size:36px;color:red;>");
    client.println("<html>Arduino Thermometer </h1>");
    client.println(PassCount);
    PassCount++;
    Serial.println(PassCount);
    client.println("<br />");
   
    for (int vmreads=0; vmreads<1; vmreads++){
      int chk = DHT11.read();
      switch (chk)
      {
      case 0:
        Serial.println("OK");
        break;
      case -1:
        Serial.println("Checksum error");
        break;
      case -2:
        Serial.println("Time out error");
        break;
      default:
        Serial.println("Unknown error");
        break;
      }
      client.println("<p><span style=font-size:36px;color:blue;>");
      client.print("Temperature (F): ");
      client.println((int)DHT11.fahrenheit(), DEC);
      client.println("<br />");
      client.print("Humidity (%): ");
      client.println((int)DHT11.humidity, DEC);
      client.println("<br />");

    }
    client.println("</body></html>");
    client.stop();
   
    delay(100);
  }
}

mmcp42

1.
suggest you take a glance at the sticky at the top of this forum

2.
you need {code} tags around your code

3.
you need to tell us what error you are getting rather rhan "it doesn't work" :)
come sit this side of the bench for a moment :)
there are only 10 types of people
them that understands binary
and them that doesn't

zoomkat

Quote
I apologize if this is already discussed elsewhere, but I keep getting errors when I try to search the forums (Daemon not available?).


The board seems to be working today. Other forum search methods in my signature line below.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

oric_dan

#3
Feb 17, 2013, 07:02 pm Last Edit: Feb 17, 2013, 07:13 pm by oric_dan Reason: 1
Beside embedding your code using the # icon, the problem here sounds like you didn't
install the dht11 library in the IDE 1.0.3 directory, ...\arduino-1.0.3\libraries.

You need to re-install all extraneous libraries whenever you install a new IDE version.
Newly installed IDEs do, however, use the same sketch folders.

Also, how are you connecting to iPad and PC? Certainly iPad doesn't have an ethernet jack.

PeterH

You haven't told us what the error message was, but a stab in the dark is that you haven't installed all the libraries needed to compile your sketch.

The double-counting is probably caused by your PC browser - which you haven't identified, by the way - trying to download the favicon for your site.
I only provide help via the forum - please do not contact me for private consultancy.

gowfster

Thanks for the replies.
1)  I'm a newbie to the forum, and only been tinkering with Arduino for 6 months on the side, so excuse my not being up to speed on forum nuances.
2)  You were right - it was the library;  I thought I had copied them all over, but had missed this one.  I'm really quite surprised that the error message in the compiler doesn't stop on the Include line saying it cant find the file vs a line later in the file that uses that call.  I've moved it though, and it works fine now. Thanks!
3)  I'm using Arduino on my home network via hardwire ethernet.  My Ipad connects remotely via wifi.  (I am dying to move the arduino to wifi also... bought a sainsmart wifi shield, but now regretting that when I find it is different library than the formal arduino shield, and maybe over my head to make it work)
4) Ipad and the Apple devices in the house use Safari, and all work as expected. 
5) After your hint about the browser (see I mistakenly think they are all the same) I experimented.  Chrome always counts by two's, so each time I hit the IP address intentionally from PC, the counter that is fed back increments by 2.  In IE9 and Safari, it only increments by 1.  I don't know much at all about the web servers, and the protocols... but it seems like you are on to something that Chrome is doing something beyond what I think it is doing.  If it is a favicon thing... makes me want to actually figure out how to respond to that request, or prevent it from being issued.
6)  I find that between IE and Chrome/Safari, that the resultant text display differs.  In IE9, there is an extra line feed or two around the counter printing in the header, whereas the Chrome/Safari pages look correct, where the header is all on one line.

Thanks for putting up with my learning the ropes...

gowfster

Oh, and thanks for the hint about Searching.  I only looked at the Big Grey box at the top of the screen, and that isn't working.  using the Search up in the banner works like a charm.

PaulS

Quote
the problem here sounds like you didn't
install the dht11 library in the IDE 1.0.3 directory, ...\arduino-1.0.3\libraries.

That is NOT where it goes. If it had been downloaded to the proper place (the libraries folder in the sketch directory), then the 1.0.3 version of the IDE would have been able to find it.

oric_dan


Quote
the problem here sounds like you didn't
install the dht11 library in the IDE 1.0.3 directory, ...\arduino-1.0.3\libraries.

That is NOT where it goes. If it had been downloaded to the proper place (the libraries folder in the sketch directory), then the 1.0.3 version of the IDE would have been able to find it.

Well, that probably explains a lot, ;-).

HazardsMind

Quote
That is NOT where it goes. If it had been downloaded to the proper place (the libraries folder in the sketch directory), then the 1.0.3 version of the IDE would have been able to find it.

That is very strange because, I've always put my downloaded libraries in the Arduino 1.0.3 libraries folder, and not once have I ever had any problems. I dont even have a libraries in my sketch folder. By any chance could it be my windows version? I have Vista home premium.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

oric_dan

I just found this, of course it's been there all the time, just waiting for me to find it.
http://arduino.cc/en/Guide/Libraries

retrolefty


Quote
That is NOT where it goes. If it had been downloaded to the proper place (the libraries folder in the sketch directory), then the 1.0.3 version of the IDE would have been able to find it.

That is very strange because, I've always put my downloaded libraries in the Arduino 1.0.3 libraries folder, and not once have I ever had any problems. I dont even have a libraries in my sketch folder. By any chance could it be my windows version? I have Vista home premium.


Yes it will work. However what will you do when the next IDE version comes out, move all those libraries out and into the next IDE manually? It can be a lot of work and error prone. That is why they added the feature of a optional user library directory in the sketch directory, as that doesn't get deleted or overwritten when you install a new IDE release. Once you get it set up and working you will be much happier in the long run. Trust me, been there done that, still got the T-shirt.

Lefty

PaulS

Quote
I dont even have a libraries in my sketch folder.

Don't you know how to create a directory?

PeterH


That is why they added the feature of a optional user library directory in the sketch directory, as that doesn't get deleted or overwritten when you install a new IDE release.


That's fine as long as the Arduino runtime doesn't have any more changes made that break backwards compatibility.
I only provide help via the forum - please do not contact me for private consultancy.

retrolefty



That is why they added the feature of a optional user library directory in the sketch directory, as that doesn't get deleted or overwritten when you install a new IDE release.


That's fine as long as the Arduino runtime doesn't have any more changes made that break backwards compatibility.


That has nothing to do with the subject of installing 3rd party libraries and where they are best stored. There are 3rd party libraries out there that don't work with the current IDE and it will always be up to the user to test and see if such libraries are compatible or not.

The ability to store user libraries into the user's library folder was a very good advancement in the evolution of the arduino IDE, don't be stubborn just use it.  ;)

Lefty

Go Up