Well... How Are Things Going?

Discussions related to the WiServer add-on code for WiShield. WiServer is a friendly, easy-to-use front end for webserver and webclient usages.

Moderator: shard7

Well... How Are Things Going?

Postby shard7 » Sun Jun 28, 2009 8:35 pm

It's been a few days since the new WiServer code went live, and we'd love to know what you think of it. We're aware of some compilation issues that have been cropping up with the different libraries, and we're actively working to fix those (unfortunately the Arduino IDE doesn't handle different build configurations without a lot of jedi mind tricks...)

Have you been able to get it running and serving web pages? Have you maxed out your posting limit on Twitter yet? ;-)

Also, if you encounter any issues with WiServer, please post the details in a new topic and we'll look into it!
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Startup checklist

Postby peterM » Thu Jul 02, 2009 1:56 pm

Going great, finally, yay! (See my post in the other thread.)

I'm currently running SimpleClient to post a couple of pointless variables to my web site, using GET to PHP with a MySQL database. (I'll post the code soon when its presentable.) If you like looking at black and white text: http://www.bitfizz.com/ardu/reportSee.php

I thought it might be useful for somebody starting-out with this software to see the steps I took in getting going. This is a combo of the great advice [thanks everyone!] that's been collecting in the last couple of weeks. Seems to work!

    I'm using the Arduino Duemilanove ATMEGA 328.
    Downloaded a fresh copy of Arduino 0016.
    In the Arduino app directory, removed the Ethernet library from /hardware/libraries.
    Made a WiShield directory in /hardware/libraries.
    Into that, copied the latest code package from github, plus the two g2100 files from the WiShield Driver link. (These links are in the wiki.)
    Found apps-conf.h and made this edit:
Code: Select all
//#define APP_WEBSERVER
#define APP_WISERVER

NOTE: After you make an edit like this in the library, you need to delete all the .o files in there (if any-usually there are a bunch of them), carefully. Then reopen and reverify your sketch.

Knowing what a rat's nest TCP communication can be, its super-impressive that the team has gotten this down to such an amazingly simple interface!

Interesting Things are now going to happen...
peterM
 
Posts: 16
Joined: Sat May 09, 2009 4:58 pm
  • Website

Re: Well... How Are Things Going?

Postby shard7 » Fri Jul 03, 2009 8:18 am

Good stuff. We had hoped that code could be dropped into the Arduino environment and just work, but apparently we have a little more work to do, LOL. Thanks for posting your checklist, that'll help us to resolve issues and improve the build instructions.

And please keep us posted on your progress and the amazing things that you end up doing with your WiShield.
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Re: Well... How Are Things Going?

Postby rusty » Fri Jul 03, 2009 2:18 pm

Seems to be fairly stable. I modified the sample server to display
the uptime, decoded from millis().

This is my main web page
Value of pin 0 is 163
uptime is 3-days, 12:37:01

But I'd REALLY like to have UDP though, please?

-Rusty-
User avatar
rusty
 
Posts: 18
Joined: Tue May 05, 2009 2:22 am
Location: Van Alstyne, TX

Re: Well... How Are Things Going?

Postby shard7 » Fri Jul 03, 2009 7:35 pm

Rusty,

Nice, good to see that the code's stable.

WiServer is there to make life easier if your application needs to send and receive data via HTTP, but UDP is available if you write code that interfaces directly with the uIP stack instead of using WiServer. Do you have a need to access UDP as well as using HTTP? Or is it sufficient to just use UDP?
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Re: Well... How Are Things Going?

Postby rusty » Fri Jul 03, 2009 11:11 pm

Actually, the answer is "Yes", both webserving and UDP send/recv. :-)
Have a look at NetMedia's SitePlayer Server and it uses a "piddly" 8051 variant.
Yes, the '328 has less flash but... it's rare all that memory is needed for web content.

No, I wasn't pinging you specifically for UDP. I was just asking for the capability, in general.
Right now, unless I've misread the code, UDP is turned off.

So far so good. Nice job with the WiServer code, shard! I thank you!
User avatar
rusty
 
Posts: 18
Joined: Tue May 05, 2009 2:22 am
Location: Van Alstyne, TX

Re: Well... How Are Things Going?

Postby shard7 » Sat Jul 04, 2009 6:28 am

You're welcome! :-)

I appreciate the feedback about UDP. Obviously we'll want to enhance and improve WiServer as time permits, so hearing about stuff you'd like to be able to do is good to know. It would be pretty easy to re-enable UDP at the uIP layer, but we'd need to expose it in WiServer and make sure it plays nicely with the rest of the code.
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Re: Well... How Are Things Going?

Postby peterM » Sat Jul 04, 2009 9:32 am

This may expose my virginity in using C pointers, but here goes...

Using Simple Client, I am trying to change one of my GET variable values each time submit() is called on my instance of GETrequest, named "getSiteMsg" here. Here's what that looks like in the Arduino 16 script:
(To start with, I'm just trying to send a literal string.)

Code: Select all
void loop(){
  if (millis() >= (prevMillis+updateInterval)) {
    getSiteMsg.submit();
    prevMillis = millis();
   
    char newURL[] = "/ardu/reportDoG4.php?WID=96&arduWiFi=1";  //create a new string
    char* pnU = newURL;  //create a pointer to that string
    getSiteMsg.setURL(pnU); //creates 'undefined reference' error here
  }
  WiServer.server_task();
  delay(10);
}


This loop code works fine without the three commented lines.
But on compile, I get:
o: In function `loop':
undefined reference to `GETrequest::setURL(char*)'


I quite sure I'm following your class definition for this in WiShield.h correctly. I've done the "delete all the .o files" thing. Maybe I'm just using lousy pointer syntax??

Or maybe I should be trying to send a revised URL by constantly re-instantiating GETrequest (nasty!)?

(Happy 4th everyone :) )
peterM
 
Posts: 16
Joined: Sat May 09, 2009 4:58 pm
  • Website

Re: Well... How Are Things Going?

Postby shard7 » Sat Jul 04, 2009 8:31 pm

Doh! That'd be my bad... I just checked the code a it looks like I forget to include an implementation for setURL(char*)! I'll try to get that fixed and pushed to GitHub within the next day or so. Sorry about that! And thanks for letting me know about it. And with the function actually there, you shouldn't have to create char* pnU, just passing the char array should work fine.

BTW, be careful about changing the attributes of a request right after you submit it. If it's still being actively processed, API calls that try to change it will be ignored. A better approach is to set the attribute right before you submit it.
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Re: Well... How Are Things Going?

Postby shard7 » Sat Jul 04, 2009 8:51 pm

Ok, that was an easy fix. Please pull the latest source from GitHub, delete any .o files in the WiShield directory, and rebuild your sketch. And let me know if you have any further issues or questions.
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Next

Return to WiServer

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest