Shop OBEX P1 Docs P2 Docs Learn Events
My chickens have the internet.... — Parallax Forums

My chickens have the internet....

doggiedocdoggiedoc Posts: 2,241
edited 2013-02-13 13:35 in Accessories
I have redone the Coop Server using MikeG's new code base.... it works great!

So far, no hangs!

Hit it to see: http://208.104.39.5:5000

Thanks!

Doc
«1

Comments

  • Mike GMike G Posts: 2,702
    edited 2013-01-29 17:48
    The page is not fully rendering and it is rendering as text. There can be a couple of reasons for this behavior. If you post your source and HTML I can probably fix it pretty quickly.

    Edit: it works in IE but Firefox thinks it's plain text.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 17:55
    Thanks Mike... it's actually only text right now. I didn't want to introduce too many variables until I was sure it was runny smoothly. Your new code base really seems to be the ticket!

    I plan to add some 'style' to it soon.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 17:56
    Well Smile. Now it's not loading. :(
  • Mike GMike G Posts: 2,702
    edited 2013-01-29 18:00
    Thanks Mike... it's actually only text right now. I didn't want to introduce too many variables until I was sure it was runny smoothly. Your new code base really seems to be the ticket!
    No, I mean the header is plain/text. IE is a little forgiving in this regard but other browsers will only show literally plain text - the HTML. It looks like the HTML page is not complete. There could be an unexpected zero terminator in the dynamic text.
    Well Smile. Now it's not loading
    That's my fault... I ran a small stress test.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 18:05
    Mike G wrote: »
    No, I mean the header is plain/text. IE is a little forgiving in this regard but other browsers will only show literally plain text - the HTML. It looks like the HTML page is not complete. There could be an unexpected zero terminator in the dynamic text.
    It's a cut and paste job... so I may have left some old code behind by mistake... I'll post my code.
    That's my fault... I ran a small stress test.
    Whew! I was panicking!
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 18:32
    Found the extra zero terminator.... cleaning it up now and will upload shortly.
  • Mike GMike G Posts: 2,702
    edited 2013-01-29 18:33
    Replace index in the DAT section with the following.
    DAT
      index byte  "HTTP/1.1 200 OK", CR, LF, {
    }             "Content-Type: text/html", CR, LF, CR, LF, {
    }             "<HTML>", {
    }             "<HEAD>", {
    }             "<TITLE>Willoughby Farm</TITLE>", {
    }             "</HEAD>",  {
    }             "<SCRIPT LANGUAGE='JavaScript'>",CR,{
    }             "Temp3 = 0",CR,  {
    }             "function Counter() {",CR, {
    }             "         Temp3 = Temp3 + 1;",CR, {
    }             "         document.frm1.seconds.value=Temp3;",CR,{
    }             "         timerID = setTimeout('Counter()',1000);",CR,{
    }             "         }",CR, {
    }             "</SCRIPT>" , {
                
    }             "<BODY Onload='Counter()'>",{
    }             "<FONT FACE=BOOKMAN OLD STYLE SIZE=8><BR>Doc's Flock<BR></FONT>", {
    
            
    }             "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>",{
    }             "Coop Status Page  ",  {
    }             "(...a work in progress!)<BR><BR></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>Coop Time: "
    time1   byte  "  /" '<--- This is a place holder ; number is dynamically updated
    time2   byte  "  /20" '<--- This is a place holder ; number is dynamically updated
    time3   byte  "   " '<--- This is a place holder ; number is dynamically updated
    time4   byte  "  :" '<--- This is a place holder ; number is dynamically updated
    time5   byte  "  :" '<--- This is a place holder ; number is dynamically updated
    time6   byte  "  <BR>" '<--- This is a place holder ; number is dynamically updated
            byte  "</FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>Coop Temperature: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2 COLOR=RED>"
    temp    byte  "      °F "'<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>Coop Humidity:    "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2 COLOR=RED>"
    humi    byte  "       % <BR>"'<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Most Recent Light Level: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    num1    byte  "0000 <BR>" '<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Last Average Light Level: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    num2    byte  "0000 <BR>" '<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Current Door Position: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    str1    byte  "      <BR>" '<--- This is a place holder ; val is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Current Switch Position: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    str2    byte  "      <BR><BR><BR>" '<--- This is a place holder ; val is dynamically updated
            byte  "</FONT></FONT>"
    
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>"
            byte  "<FORM NAME='frm1'>"
            byte  "Elapsed seconds since last page Refresh ="
            byte  "<INPUT NAME='seconds' SIZE=4 VALUE=''>"
            byte  "</FORM>"
            byte  "</FONT>"
    htmlfin
            byte  "</FONT>"
            byte  "</BODY>"
            byte  "</HTML>"
            byte  0
    

    There was a zero terminator in the DAT, I took out. The index byte array was missing the HTTP header, I added it.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 18:57
    Fixed! Thanks Mike! I added the to HTML declarations and took out the extra zero terminator. I sprinkled a few CRs in there to make the 'view source' look better too. :D

    I really appreciate your help. My html skills are even more crude than my spin coding skills. :D:D

    I've uploaded it now and all looks good.

    Paul
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-29 19:39
    Who knew that my computer journey started so long ago would take a turn where I was actually checking in on a chicken coop in South Carolina? Isn't technology grand!!!!

    Looking good, Paul!! Will we be ale to start counting them before they hatch soon?
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 19:42
    Thanks Rick!! Technology is cool!! I added a hit count while I was sitting out there. That's all for tonight. :)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-01-29 20:01
    Paul, very nice! But your webpage needs a photo. A minor change makes it so:
    DAT
      index byte  "HTTP/1.1 200 OK", CR, LF, {
    }             "Content-Type: text/html", CR, LF, CR, LF, {
    }             "<HTML>", {
    }             "<HEAD>", {
    }             "<TITLE>Willoughby Farm</TITLE>", {
    }             "</HEAD>",  {
    }             "<SCRIPT LANGUAGE='JavaScript'>",CR,{
    }             "Temp3 = 0",CR,  {
    }             "function Counter() {",CR, {
    }             "         Temp3 = Temp3 + 1;",CR, {
    }             "         document.frm1.seconds.value=Temp3;",CR,{
    }             "         timerID = setTimeout('Counter()',1000);",CR,{
    }             "         }",CR, {
    }             "</SCRIPT>" , {
                
    }             "<BODY Onload='Counter()'>",{
    }             "<FONT FACE=BOOKMAN OLD STYLE SIZE=8><BR>Doc's Flock<BR></FONT>", {
    
            
    }             "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>",{
    }             "Coop Status Page  ",  {
    }             "(...a work in progress!)<BR><BR></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>Coop Time: "
    time1   byte  "  /" '<--- This is a place holder ; number is dynamically updated
    time2   byte  "  /20" '<--- This is a place holder ; number is dynamically updated
    time3   byte  "   " '<--- This is a place holder ; number is dynamically updated
    time4   byte  "  :" '<--- This is a place holder ; number is dynamically updated
    time5   byte  "  :" '<--- This is a place holder ; number is dynamically updated
    time6   byte  "  <BR>" '<--- This is a place holder ; number is dynamically updated
            byte  "</FONT>"
            byte "<img src=http://forums.parallax.com/attachment.php?attachmentid=98964&d=1359518024/>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>Coop Temperature: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2 COLOR=RED>"
    temp    byte  "      °F "'<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>Coop Humidity:    "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2 COLOR=RED>"
    humi    byte  "       % <BR>"'<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Most Recent Light Level: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    num1    byte  "0000 <BR>" '<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Last Average Light Level: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    num2    byte  "0000 <BR>" '<--- This is a place holder ; number is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Current Door Position: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    str1    byte  "      <BR>" '<--- This is a place holder ; val is dynamically updated
            byte  "</FONT></FONT>"
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4><BR>Current Switch Position: "
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=4 COLOR=RED>"
    str2    byte  "      <BR><BR><BR>" '<--- This is a place holder ; val is dynamically updated
            byte  "</FONT></FONT>"
    
            byte  "<FONT FACE=BOOKMAN OLD STYLE SIZE=2><BR>"
            byte  "<FORM NAME='frm1'>"
            byte  "Elapsed seconds since last page Refresh ="
            byte  "<INPUT NAME='seconds' SIZE=4 VALUE=''>"
            byte  "</FORM>"
            byte  "</FONT>"
    htmlfin
            byte  "</FONT>"
            byte  "</BODY>"
            byte  "</HTML>"
            byte  0
    

    -Phil
    631 x 322 - 39K
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-29 20:14
    You very right Phil! I'm already in bed or I'd go out there and upload that!!

    Thanks!!

    Oh, that's a great image choice, btw!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-01-29 20:20
    Paul,

    If you've got surgery duty tomorrow, the chickens can wait! Get some sleep. :)

    -Phil
  • WildatheartWildatheart Posts: 195
    edited 2013-01-29 20:26
    Good job, Doc. I'm still struggling to get a light turned on.
  • Sir GawainSir Gawain Posts: 32
    edited 2013-01-29 21:01
    As with other internet privacy concerns, do you think this is a good idea? How do you know that some foxes also don't "have the internet" and are spending all their time cruising for chickens to exploit.
    And by exploit I mean eat to bits.
    Yah, technofox doing a quick Parallax websearch for "supper tonight" or "free lunch"
    and their you go.
    Just sayin......


    "I feel like chicken tonight...."
    :innocent:
  • garyggaryg Posts: 420
    edited 2013-01-29 21:17
    I've been following the Chicken Coop threads for a while now.
    I truely do not understand what is going on with the Spinneret Web Server and what appears to be some
    kind of Propeller applications.
    Would anyone be willing to contribute info to the dumb guy that happened to get interested in something Way over his head?

    I realize that the Chicken Coop thing has to do with tracking inputs and relaying information about the
    chicken coop status over the internet.
    It seems like Doggiedoc has accomplished a milestone in understanding the Spinnernet.

    Is there a simple explination that someone with an 8th grade education could understand?
    I'm not an 8th grade education person, but would appreciate any very super simple discussion of what is going on here.

    It may just be that I need to understand steps 1 through 32 before I can understand what is going on with the Spinneret.

    Thanks
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-30 07:52
    Sir Gawain wrote: »
    As with other internet privacy concerns, do you think this is a good idea? How do you know that some foxes also don't "have the internet" and are spending all their time cruising for chickens to exploit.
    And by exploit I mean eat to bits.
    Yah, technofox doing a quick Parallax websearch for "supper tonight" or "free lunch"
    and their you go.
    Just sayin......


    "I feel like chicken tonight...."
    :innocent:
    I've addressed those 'free loading' foxes in this thread. But hey... foxes need to eat too, right?

    :D:D:D
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-30 07:59
    garyg wrote: »
    I've been following the Chicken Coop threads for a while now.
    I truely do not understand what is going on with the Spinneret Web Server and what appears to be some
    kind of Propeller applications.
    Would anyone be willing to contribute info to the dumb guy that happened to get interested in something Way over his head?
    The code listed above is the program that runs a the top level on the spinneret processor (a propeller). This manages (with the help of lower level code) the interaction with the WIZnet chip on the spinneret which serves up the html to the client browser. The propeller chip also manages the communication with another propeller running it's own code that monitors the listed parameters and handles the door opening and closing.
    I realize that the Chicken Coop thing has to do with tracking inputs and relaying information about the
    chicken coop status over the internet.
    It seems like Doggiedoc has accomplished a milestone in understanding the Spinnernet.
    I've used a lot of other people's code to get to this point. Very little of it is my own code.

    It may just be that I need to understand steps 1 through 32 before I can understand what is going on with the Spinneret.

    Thanks
    If you are completely new to the propeller, then there are some great resource on this site to get you started... I'll list some shortly.

    Doc
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-30 18:15
    Paul,

    If you've got surgery duty tomorrow, the chickens can wait! Get some sleep. :)

    -Phil

    Is this better? http://208.104.39.5:5000/

    Thanks for the frame grab!

    Paul
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-01-30 18:49
    Now we're talkin'! Very nice!

    -Phil
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-30 19:06
    It's still really basic but you're right, it needed an image!! Thanks again. :)
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-01-30 19:27
    Looking good Doc. Now just get that PTZ web cam going so we can see what really goes on in those chicken coops!!!!
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-31 18:23
    I'm a bit concerned about my bandwidth. I wonder if a web cam would hamper that.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-01-31 18:30
    As long as you are not on dial up I would not be too concerned about bandwidth. I run 8 cameras that can be viewed from anywhere and have never had any issues. I am using standard DSL. I have even connected wirelessly to the Internet and although the video is slow to load, it does come up.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-31 18:42
    Did yo para link to the PTZ web cam you mentioned. I looked in the other thread but couldn't find. Oh, and what did you mean by 'forward another port to it' in the other thread?
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-01-31 18:56
    No link. Do you need a suggestion for one? I can find one that would work for you if you like. I do not publish any of my own for others to see. It is the outside of my home and my home office that I monitor and do not want it public. I also have a license plate recognition camera that watches our mail boxes. Do not really want plates being viewed by the public unless necessary.

    Port forwarding is what you need to do to have the camera be viewable. Your current port is 5000 so you could not use that for the camera. The default is normall 80. Some web cams allow you to change them but some are fixed. Let me know if you need help.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-31 19:21
    Sorry, I meant a link to the brand you recommend. I'll try a search with Google.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-01-31 19:31
    I found this one that looks promising.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-02-13 09:55
    I took Phil's advice on adding the image and took it a bit further. With a little Javascript and some more images from that same video it now cycles through a handful of images. I added a small border around the image and softened the background color a little too.

    http://208.104.39.5:5000

    Thanks!
Sign In or Register to comment.