2 Replies Latest reply on Nov 3, 2014 3:32 PM by Puck

    starting a webserver


      I took the webserver project in the Galileo example directory and all I want is to print out a series of time stamped sensor values from printed every 30 seconds. This works, it merely adds some lines of c++ to the webserver but during the development of this all I ran into some issues that I do not understand, so:


      • when I compile the webserver example it uploads to the Galileo 1 board (yes, all latest updates are applied)
      • when I go to the webpage it should create a running sketch but it never runs the first time, the browser simply reports connection refused.
      • after uploading the same sketch a number of times from the arduino ide, and restarting the browser eventually the webserver works.


      So what am I doing wrong here? Lets try something else via ssh login


      • I copied the running elf from the sketch directory to something like webserver_v1.elf
      • In this window echo $SSH_TTY which gave me  /dev/pts/X
      • with kill -9 <pid> I killed the running sketch
      • I opened a second window within ssh: echo $SSH_TTY
      • the latter gives me a /dev/pts/Y
      • In /dev/pts/X I execute: ./webserver_v1.elf  /dev/pts/Y


      Now the webserver starts and it nicely logs in screen /dev/pts/Y, furthermore the webserver directly answers all browsers without refusing any connections. I suspect there should be a simpler way to do this, but somehow the sketch upload procedure in the arduino IDE isn't able to handle this properly. Why? Is there an easier and fail safe way to start the webserver so that browsers can directly connect to it? And also, does the sketch still run when I remove the USB cable? This procedure above does work without a USB cable.