Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 11
16  Using Arduino / Storage / Re: Bitlashsd error on: October 14, 2012, 07:02:45 pm

PS: Update. OOPS: The define needs to be enabled, not disabled.  I've fixed fix the doc bug and have amended the text above.  For avoidance of doubt, please make line 340 look like:
/quote]
The OOPS did the trick! Thanks!  Great Language, but for a old dummy like probably a steep learning curve.

Jim
17  Using Arduino / Storage / Bitlashsd error on: October 14, 2012, 04:33:01 pm
I trying to learn Bitlash to make a websever, storing pages on a SD card. Currently I am working on bitlashsd at the moment to understand SD using bitlash. I'm getting the following errors:

bitlash\bitlash.cpp.o: In function `scriptfileexists':
C:\arduino-1.0.1\libraries\bitlash\/src/bitlash-instream.c:50: multiple definition of `scriptfileexists(char*)'
bitlashsd.cpp.o:C:\Users\jim\AppData\Local\Temp\build8548542757815330962.tmp/bitlashsd.cpp:142: first defined here
bitlashsd.cpp.o: In function `setup':
bitlashsd.cpp:(.text.setup+0x40): undefined reference to `sdcat()'
bitlashsd.cpp:(.text.setup+0x42): undefined reference to `sdcat()'
bitlashsd.cpp:(.text.setup+0x64): undefined reference to `func_fprintf()'
bitlashsd.cpp:(.text.setup+0x66): undefined reference to `func_fprintf()'
bitlashsd.cpp.o: In function `sdappend()':
bitlashsd.cpp:(.text._Z8sdappendv+0x40): undefined reference to `sdwrite(char*, char*, unsigned char)'

I'm using the SDFat library referred in the documentation and the Sd card on an ethernet shield with a Mega 2560.

Jim
18  Using Arduino / Networking, Protocols, and Devices / Re: Need internet help on: October 09, 2012, 04:49:36 pm
Thanks, zoomkat I'm studying that!

Jim
19  Using Arduino / Networking, Protocols, and Devices / Re: Need internet help on: October 08, 2012, 05:57:50 pm
Code:
         doZero;
          doOne;
These are not function calls. They do nothing.
They were stubs of code to be added
Code:
They were stubs of code to be added
        client.print ("<a href=\"http://192.168.0.14\" ></a>");
What's this doing?
a attempt o force page to refresh that I forgot to delete
Code:
a attempt o force page to refresh that I forgot to delete          client.println("<html>");
          client.println("<body>");
There are no matching close tags.
I wondered about that, they are not in the sample code either. He said that it worked on the web page


Thanks for looking! Jim
20  Using Arduino / Networking, Protocols, and Devices / Re: Need internet help on: October 08, 2012, 02:41:11 pm
I'm nearly positive that your code doesn't really look like that. Try again.
Sorry, I used "copy for forum" and that is what I got. Try this
Code:
#include <SPI.h>
#include <Ethernet.h>
#define BUFSIZ 100
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {192,168,0,14};
Server server(80);
void setup()
{
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.begin(9600);
}
void loop()
{
  char clientline[BUFSIZ];
  char c;
  int index = 0;
  int stat = 0;
  // listen for incoming clients
  Client client = server.available();
  if (client)
  {
    boolean currentLineIsBlank = true;
    while (client.connected())
    {
      if (client.available())
      {
        char c = client.read();
        if (c != '\n' && c != '\r') {
          clientline[index] = c;
          index++;
          if (index >= BUFSIZ)
            index = BUFSIZ -1;
          continue;
        }
        clientline[index] = 0;
        if (strstr(clientline, "GET / ") != 0)
        {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<html>");
          client.println("<body>");
          client.print("<FORM action=\"http://192.168.0.14/\" >");
          client.print("<INPUT type=\"hidden\" name=\"status1\" value=\"1\">");
          client.print("<INPUT type=\"submit\" value=\"Led On\"> </FORM>");
          client.print("<FORM action=\"http://192.168.0.14/\" >");
          client.print("<INPUT type=\"hidden\" name=\"status0\" value=\"0\">");
          client.print("<INPUT type=\"submit\" value=\"Led Off\"> </FORM>");
          break;
        }
        else if (strstr(clientline, "status0") != 0)
        {
         Serial.print(clientline);
         doZero;
         client.print ("<a href=\"http://192.168.0.14\" ></a>");
          break;
        }
        else if (strstr(clientline, "status1") != 0)
        {
         Serial.print(clientline);
          doOne;
          break;
        }
         else
        {
          client.println("HTTP/1.1 404 Not Found");
          client.println("Content-Type: text/html");
          client.println();
        }
      }
    }
    delay(1);
    client.stop();
  }
}
void doZero()
{
}
void doOne()
{
}

Jim
21  Using Arduino / Networking, Protocols, and Devices / Need internet help on: October 08, 2012, 11:49:03 am
I'm trying to set up a webserver which accepts comands fron the internet. I used
as an example the program at
http://www.charmcitynetworks.com/techblog/web-controlled-window-air-conditioner-using-and-arduino/
my code:
Code:
#include <[color=#CC6600]SPI[/color].h>
#include <[color=#CC6600]Ethernet[/color].h>
#define BUFSIZ 100
[color=#CC6600]byte[/color] mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
[color=#CC6600]byte[/color] ip[] = {192,168,0,14};
[color=#CC6600]Server[/color] server(80);
[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
  [color=#CC6600]Ethernet[/color].[color=#CC6600]begin[/color](mac, ip);
  server.[color=#CC6600]begin[/color]();
  [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]begin[/color](9600);
}
[color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]()
{
  [color=#CC6600]char[/color] clientline[BUFSIZ];
  [color=#CC6600]char[/color] c;
  [color=#CC6600]int[/color] index = 0;
  [color=#CC6600]int[/color] stat = 0;
  [color=#7E7E7E]// listen for incoming clients[/color]
  [color=#CC6600]Client[/color] client = server.[color=#CC6600]available[/color]();
  [color=#CC6600]if[/color] (client)
  {
    [color=#CC6600]boolean[/color] currentLineIsBlank = [color=#CC6600]true[/color];
    [color=#CC6600]while[/color] (client.[color=#CC6600]connected[/color]())
    {
      [color=#CC6600]if[/color] (client.[color=#CC6600]available[/color]())
      {
        [color=#CC6600]char[/color] c = client.[color=#CC6600]read[/color]();
        [color=#CC6600]if[/color] (c != [color=#006699]'\n'[/color] && c != [color=#006699]'\r'[/color]) {
          clientline[index] = c;
          index++;
          [color=#CC6600]if[/color] (index >= BUFSIZ)
            index = BUFSIZ -1;
          [color=#CC6600]continue[/color];
        }
        clientline[index] = 0;
        [color=#CC6600]if[/color] (strstr(clientline, [color=#006699]"GET / "[/color]) != 0)
        {
          [color=#7E7E7E]// send a standard http response header[/color]
          client.[color=#CC6600]println[/color]([color=#006699]"HTTP/1.1 200 OK"[/color]);
          client.[color=#CC6600]println[/color]([color=#006699]"Content-Type: text/html"[/color]);
          client.[color=#CC6600]println[/color]();
          client.[color=#CC6600]println[/color]([color=#006699]"<html>"[/color]);
          client.[color=#CC6600]println[/color]([color=#006699]"<body>"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<FORM action=\"http://192.168.0.14/\" >"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"hidden\" name=\"status1\" value=\"1\">"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"submit\" value=\"Led On\"> </FORM>"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<FORM action=\"http://192.168.0.14/\" >"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"hidden\" name=\"status0\" value=\"0\">"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"submit\" value=\"Led Off\"> </FORM>"[/color]);
          [color=#CC6600]break[/color];
        }         
        [color=#CC6600]else[/color] [color=#CC6600]if[/color] (strstr(clientline, [color=#006699]"status0"[/color]) != 0)
        {
         [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color](clientline);
         doZero;
          [color=#CC6600]break[/color];
        }
        [color=#CC6600]else[/color] [color=#CC6600]if[/color] (strstr(clientline, [color=#006699]"status1"[/color]) != 0)
        {
         [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color](clientline);
          doOne;
          [color=#CC6600]break[/color];
        }
         [color=#CC6600]else[/color]
        {
          client.[color=#CC6600]println[/color]([color=#006699]"HTTP/1.1 404 Not Found"[/color]);
          client.[color=#CC6600]println[/color]([color=#006699]"Content-Type: text/html"[/color]);
          client.[color=#CC6600]println[/color]();
        }
      }
    }
    [color=#CC6600]delay[/color](1);
    client.[color=#CC6600]stop[/color]();
  }
}
[color=#CC6600]void[/color] doZero()
{
}
[color=#CC6600]void[/color] doOne()
{
}

it works somewhat, using my test program shows two buttons. The Serial monitor shows that clicking
the on button gives:
GET /?status1=1 HTTP/1.1
and clicking the off button gives:
GET /?status1=0 HTTP/1.1
The problem is that the browser then gives error message
The connection was reset
and browser address line is
http://192.168.0.14/?status1=1  or 0
what I need is to reload 192.168.0.14, how do I do that?
Jim
22  Using Arduino / Displays / Re: Need help with webserver on: October 04, 2012, 07:44:11 pm
You might get better results if you post this question in one of the other forum areas.  My guess would be to try the Networking, Protocols, and Devices area.

Don

Would the moderator of this forum move this to Networking, Protocols, and Devices

Jim
23  Using Arduino / Displays / Need help with webserver on: October 03, 2012, 01:45:52 pm

I'm trying to set up a webserver which accepts comands fron the internet. I used
as an example the program at

http://www.charmcitynetworks.com/techblog/web-controlled-window-air-conditioner-using-and-arduino/

my code:

Code:
#include <[color=#CC6600]SPI[/color].h>
#include <[color=#CC6600]Ethernet[/color].h>
#define BUFSIZ 100
[color=#CC6600]byte[/color] mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
[color=#CC6600]byte[/color] ip[] = {192,168,0,14};
[color=#CC6600]Server[/color] server(80);
[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
  [color=#CC6600]Ethernet[/color].[color=#CC6600]begin[/color](mac, ip);
  server.[color=#CC6600]begin[/color]();
  [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]begin[/color](9600);
}
[color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]()
{
  [color=#CC6600]char[/color] clientline[BUFSIZ];
  [color=#CC6600]char[/color] c;
  [color=#CC6600]int[/color] index = 0;
  [color=#CC6600]int[/color] stat = 0;
  [color=#7E7E7E]// listen for incoming clients[/color]
  [color=#CC6600]Client[/color] client = server.[color=#CC6600]available[/color]();
  [color=#CC6600]if[/color] (client)
  {
    [color=#CC6600]boolean[/color] currentLineIsBlank = [color=#CC6600]true[/color];
    [color=#CC6600]while[/color] (client.[color=#CC6600]connected[/color]())
    {
      [color=#CC6600]if[/color] (client.[color=#CC6600]available[/color]())
      {
        [color=#CC6600]char[/color] c = client.[color=#CC6600]read[/color]();
        [color=#CC6600]if[/color] (c != [color=#006699]'\n'[/color] && c != [color=#006699]'\r'[/color]) {
          clientline[index] = c;
          index++;
          [color=#CC6600]if[/color] (index >= BUFSIZ)
            index = BUFSIZ -1;
          [color=#CC6600]continue[/color];
        }
        clientline[index] = 0;
        [color=#CC6600]if[/color] (strstr(clientline, [color=#006699]"GET / "[/color]) != 0)
        {
          [color=#7E7E7E]// send a standard http response header[/color]
          client.[color=#CC6600]println[/color]([color=#006699]"HTTP/1.1 200 OK"[/color]);
          client.[color=#CC6600]println[/color]([color=#006699]"Content-Type: text/html"[/color]);
          client.[color=#CC6600]println[/color]();
          client.[color=#CC6600]println[/color]([color=#006699]"<html>"[/color]);
          client.[color=#CC6600]println[/color]([color=#006699]"<body>"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<FORM action=\"http://192.168.0.14/\" >"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"hidden\" name=\"status1\" value=\"1\">"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"submit\" value=\"Led On\"> </FORM>"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<FORM action=\"http://192.168.0.14/\" >"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"hidden\" name=\"status0\" value=\"0\">"[/color]);
          client.[color=#CC6600]print[/color]([color=#006699]"<INPUT type=\"submit\" value=\"Led Off\"> </FORM>"[/color]);
          [color=#CC6600]break[/color];
        }         
        [color=#CC6600]else[/color] [color=#CC6600]if[/color] (strstr(clientline, [color=#006699]"status0"[/color]) != 0)
        {
         [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color](clientline);
         doZero;
          [color=#CC6600]break[/color];
        }
        [color=#CC6600]else[/color] [color=#CC6600]if[/color] (strstr(clientline, [color=#006699]"status1"[/color]) != 0)
        {
         [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color](clientline);
          doOne;
          [color=#CC6600]break[/color];
        }
         [color=#CC6600]else[/color]
        {
          client.[color=#CC6600]println[/color]([color=#006699]"HTTP/1.1 404 Not Found"[/color]);
          client.[color=#CC6600]println[/color]([color=#006699]"Content-Type: text/html"[/color]);
          client.[color=#CC6600]println[/color]();
        }
      }
    }
    [color=#CC6600]delay[/color](1);
    client.[color=#CC6600]stop[/color]();
  }
}
[color=#CC6600]void[/color] doZero()
{
}
[color=#CC6600]void[/color] doOne()
{
}


it works somewhat, using my test program shows two buttons. The Serial monitor shows that clicking
the on button gives:

GET /?status1=1 HTTP/1.1

and clicking the off button gives:

GET /?status1=0 HTTP/1.1

The problem is that the browser then gives error message

The connection was reset

and browser address line is

http://192.168.0.14/?status1=1  or 0

what I need is to reload 192.168.0.14, how do I do that?

Jim
24  Community / Products and Services / Re: Acrylic Case for Arduino Unos on: September 27, 2012, 08:10:15 pm
Hello Jim,

Taller cases are one of the things we are working on now. They should be available within the next few days.

The current case has 1 inch of spacing inside the case. We were thinking of doubling that to a 2 inch spacing. Would this be more in line of what you are looking for? or would you want something even taller?

I will post some design concept pictures up of the taller cases either later tonight or tomorrow and perhaps you can give me any thoughts you may have on it.

Jason
Mad Lab Industries
http://MadLabIndustries.com



I have a mega with 2 shields, but 1 is an ethernet shield which requires more headroom and the other is a sensor shield with connection on the top. I probably need 4 inches.

Jim
25  Development / Suggestions for the Arduino Project / Re: Auto open Serial Monitor option please on: September 25, 2012, 08:10:09 pm
Yes smiley-sad only newer arduino.

But if you want to keep 0022 you can check the changes here https://github.com/eried/Arduino/commits/master and add them to your version smiley-grin
From the titles it is hard to find which ones I want. I am specifically interested in 2, 3, 5, 6, 9, 11, 12.

Jim
26  Community / Products and Services / Re: Acrylic Case for Arduino Unos on: September 25, 2012, 07:43:57 pm
I would be interested in when taller cases will be available.

Jim
27  Development / Suggestions for the Arduino Project / Re: Auto open Serial Monitor option please on: September 25, 2012, 07:31:37 pm
I haven't tried this myself, but it might be worth a try:

http://www.eevblog.com/forum/microcontrollers/%28mod%29-arduino-enhanced-release-1-0-1-for-windows-%28installer-drivers-etc%29/

"Hold Control key on Upload: To open the Serial Monitor automatically when upload complete"

Looks real good! I'm still on 0.22, Is it version specific?

Jim
28  Using Arduino / Installation & Troubleshooting / Com in use error after long session on: September 24, 2012, 08:07:11 pm
I'm experiencing a strange problem. After a long edit/compile/download session suddenly on a compile i will get pages of processing errors. If I save and close the IDE and open it again, the sketch will compile normally. However if I try to download, I will get error "ComX in use". The only way to recover is to reboot the computer. I'm running IDE  0.22 on Windows 7. Anyone have any ideas?

Jim
29  Using Arduino / Programming Questions / Re: sending text with quotes in it to client on: September 17, 2012, 07:45:26 pm
you have to use an escape character

Code:
"this is a string with a quotation mark \" in it"
I tried that,but I got the same error as before.

Or use a single quote ' in the html instead of the double quote " .

Did not know single quotes would be accepted. Will try this tomorrow! Thanks to you both for responding!

Jim
30  Using Arduino / Programming Questions / sending text with quotes in it to client on: September 16, 2012, 08:34:09 pm
I want to set my web page so it updates once a minute. The string you send is <META HTTP-EQUIV="refresh" CONTENT="60">.
The double quotes are creating a compiler error. The line that causes the error is "client.print("<META HTTP-EQUIV="refresh" CONTENT="15">");"
What is the proper way to send this string?

Jim
Pages: 1 [2] 3 4 ... 11