Shop OBEX P1 Docs P2 Docs Learn Events
Webserver server restart switch — Parallax Forums

Webserver server restart switch

davidginn524davidginn524 Posts: 12
edited 2012-05-11 10:43 in Accessories
Greetings, First posts. i am just curious on actually quite a few things. I just ordered one of these babies and what I want to do is create a hard reset button for my server.

Occasionally my server locks up or i need to restart it and it does not come back up. This is a major problem because I am running its remotely. So all i can do is a "soft" reset. I have looked at commercial options at their all like 300 bucks. Which i deff don't want to spend. currently what I have in place of this is I hooked up a crappy router to my server. There are the hard reset pins on the motherboard i took those and hooked it up to some random places on the router. By power cycling the router it sends a signal to the reset switch in turn hard resting it.

Obviously not the most ideal solution and its very annoying to do because i have to another computer to remote into, log into the router webpage and reset it.



So getting to the solution. I have rummaged around on here and I found source code for a mini webserver its already presetup etc. Really in theory the only thing I need to do it create the webpage I want . do a basic authentication. then have a button that I can press reset and it sends signal to one of the outputs on the spinneret to the motherboard to reset it. hopefully this makes sense so far yes? problem is. I have never programmed one of these in my life. The most ive done is basic pic chips via USB in a class one time. im good at programming webpages not chips.

so in my head this is possible right?

Also is there anyone that can help me with this? (when i get the spinneret in about a week )

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-12-20 18:02
    Welcome to the forum davidginn524.

    It's real easy to drive a pin high.

    Tutorial
    http://spinneret.servebeer.com:5000/

    Example
    http://www.agaverobotics.com/spinneret/controlpanel.htm

    Wouldn't a better solution be to figure out why your server is becoming unresponsive?
  • davidginn524davidginn524 Posts: 12
    edited 2011-12-20 20:03
    haha you're right, but this is cooler! :P Sorry maybe I made it to seem like it crashes a lot. Its only crashed 1 time in the past month and sometimes when i restart it , it doesn't get passed my raid card bios's which i still haven't figured out. I have been on tech support with the manufacturer for forever and their complete morons. o well it happens
  • davidginn524davidginn524 Posts: 12
    edited 2011-12-21 12:59
    gosh ! these things are freaking SAAAWEETT. I think im going to have to buy a few more of them. Even though i haven't even gotten my first one yet. Ill hook some up to my lights and my fan ultimate laziness. Just need to modify the code a little of BillyChasen 's door unlock one and ill prob even do the door unlock thing also
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-02-07 03:46
    Have you seen the stuff that Tux Graphics did with their (AVR & ENC28J60) board. This monitored, via pings, the life of a connection and if it didn't reply within 6 attempts then a reset was issued, via a relay for two seconds etc. there could be some ideas there for you.

    http://tuxgraphics.org/electronics/201102/eth-network-watchdog.shtml
  • davidginn524davidginn524 Posts: 12
    edited 2012-03-09 09:12
    wow sorry for such a late response LIKE 2 MONTHS. well, the I ordered the webserver from DIYbin.com and i pretty much got scammed out of 50 bucks. they don't return calls or email. It still says in processing/awaiting shipment. that was almost 3 months ago. I have not ordered another one since. I will hopefully once I get paid order 1 from a different location.I did have one question on it though. i was looking to buy it and then the website said I needed this http://www.hobbyengineering.com/H4304.html It was my understanding that I could just use the microsd card . Do I have to have the above? or is that more for convenience of not having to unplug and plug the sd card in every time you make a change to the code. Also I wanted to wait to see how much up-time I could have without failure and I went 4 months and 2 days till a power blip or something went wrong because all my drives failed and it started going crazy and shutdown by itself in like 3 min while i was remoted in to it. I will look into the link you provided also Toby
  • davidginn524davidginn524 Posts: 12
    edited 2012-03-09 09:43
    Also toby , I saw on the website they have a garage door opener application. couldn't in theory you do the same thing with this? by driving the pin high for a second would be the "on" switch to tell the garage door to open. it would be the same thing as the garage door opener right?
  • davidginn524davidginn524 Posts: 12
    edited 2012-04-25 13:40
    ok I FINALLY got my web server. I will be setting it up tonight after much trouble. Anyway the above tutorial about driving a LED high looks fairly simple. The only problem I see is when i go herehttp://www.agaverobotics.com/spinneret/controlpanel.htm#I look at the web server. I see an extra board attached to it. Do I have to have that to do this tutorial? because in the tut. it says i believe pin 23 is the user controlled LED. looked at the documentation there is no pin 23 even though it does list it on part of the documentation. I guess I'm asking for clarification.?!?If I don't have to get the extra board (which I hope I dont have to) how do I go about doing that? Anyone?
  • Mike GMike G Posts: 2,702
    edited 2012-04-25 21:28
    User Button and LEDs
    The user button and LEDs share an I/O pin. When the P23 is an input, it is pulled
    low but will read high on button press. When P23 is driven high the user LEDs will
    turn on. When the button is pressed while P23 is an input, the user LEDs may glow
    dimly, so it is recommended to drive the pin low unless actively reading it.

    Spinneret Web Server Manual
  • davidginn524davidginn524 Posts: 12
    edited 2012-04-26 06:25
    Thank you
    Yes I saw that in the documentation. But since I do not program chips/hardware for a living I am a little confused on that. Because In the documentation it only has 12 pins on the main connector. I get that you can press the button and it will drive the LED
  • Mike GMike G Posts: 2,702
    edited 2012-04-26 06:49
    I get that you can press the button and it will drive the LED
    No, a high on pin 23 lights the LED. The user LED is on the Spinneret board next to the status LEDs. See page 3 and 4 in the Spinneret manual.
  • davidginn524davidginn524 Posts: 12
    edited 2012-05-08 06:44
    Good morning! I finally got around and setup everything, and I got the led working. Fairly simple and straight forward. What I see in the code was this function PRI LedStatus(state) dira[23]~~ outa[23] := state returnsince it puts the user led high or low. which is on pin 23. I am assuming that if i change the 23 to a pin i want it would set it to high or low? is that correct
  • Mike GMike G Posts: 2,702
    edited 2012-05-08 08:39
    I am assuming that if i change the 23 to a pin i want it would set it to high or low? is that correct
    Correct. Pin 24, 25, 26, and 27 are available.
    http://www.agaverobotics.com/spinneret/controlpanel.htm

    If you read further into the tutorial you will find you can simply send an HTTP GET with an LED parameter in the URL.
  • davidginn524davidginn524 Posts: 12
    edited 2012-05-11 07:09
    Mike G wrote: »
    Correct. Pin 24, 25, 26, and 27 are available.http://www.agaverobotics.com/spinneret/controlpanel.htmIf you read further into the tutorial you will find you can simply send an HTTP GET with an LED parameter in the URL.
    Ahha! I finally get it!, Sorry about that. I was reading the diagram wrong. the pins 24 25 etc are on the main Jtag, But I was correlating the numbers (24) to an actual physical pin. Not a pin that is linked to a different number pin :) Thanks
  • Mike GMike G Posts: 2,702
    edited 2012-05-11 10:43
    You lost me, pins 24, 25, 26, and 27 are the actual Propeller Pins.
Sign In or Register to comment.