Author Topic: Web Server without SD card  (Read 11662 times)

emcniece

  • Newbie
  • *
  • Posts: 23
  • Seriously guys... I have too many hobbies. <3 DS
Web Server without SD card
« on: September 20, 2013, 11:50:05 am »
I'm interested in making a device in which the primary interface is through the Wifi card. Ideally, this thing would be very similar to the Wifi example that the DigiX comes with - you know, when you do the initial configuration at 10.10.100.254.

Is it possible to re-style or create a new setup screen like that? I seem to recall somewhere that there is a sketch that serves web pages up from an SD card, but I would like to save the SD card for data logging... so the web page(s) might need to be stored in the device memory itself.

Alternatively, the default 10.10.100.254 setup screen could stay as-is and I could use a web server library to do the other pages I need. Is http://playground.arduino.cc/Code/WebServer a good or compatible library for the Digix?
« Last Edit: September 20, 2013, 07:19:45 pm by emcniece »

emcniece

  • Newbie
  • *
  • Posts: 23
  • Seriously guys... I have too many hobbies. <3 DS
Re: Web Server without SD card
« Reply #1 on: September 20, 2013, 07:20:46 pm »
Seems that the WebServer tutorial at http://arduino.cc/en/Tutorial/WebServer is designed specifically for the Arduino Ethernet shield. Does anybody have any idea as to how to accomplish this with the DigiFi library?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Web Server without SD card
« Reply #2 on: September 20, 2013, 08:22:34 pm »
The wifi module can be flashed to change the software screen but it isn't at all like coding in ARduino - in addition I don't imagine it can present data from the DigiX, attached is the datasheet on this


The module can also be put in server mode and most libraries could be adopted to it - with 512k of flash on the DigiX you could serve basic pages form flash instead of sd card - though with the size of an sd card you could certainly put both pages and logged data on it. We'll be working on a server library as well.

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Web Server without SD card
« Reply #3 on: September 20, 2013, 10:02:00 pm »
I'm interested in making a device in which the primary interface is through the Wifi card. Ideally, this thing would be very similar to the Wifi example that the DigiX comes with - you know, when you do the initial configuration at 10.10.100.254.

I haven't played around with the wifi side of the DigiX as yet, other than to configure the wifi module to work with my network. However, I would probably go the same way as I did with the Arduino Mega + Ethernet Shield in a long-term datalogging project - data is stored on the microSD card, and configuration, system status and access to data files is powered by the Arduino. All web pages are generated by the Arduino dynamically, and the templates for the web pages were stored in the Arduino's flash memory / in the sketch.

Cheers,
Pete

emcniece

  • Newbie
  • *
  • Posts: 23
  • Seriously guys... I have too many hobbies. <3 DS
Re: Web Server without SD card
« Reply #4 on: September 27, 2013, 09:52:06 am »
For anyone interested - we had a lengthy discussion over at https://github.com/digistump/DigiFi/issues/4, and as a result there is now a basic web server example in the library!


Big thanks to Erik who chatted with me for a few hours last night on Github, you rock. :)

ags131

  • Newbie
  • *
  • Posts: 9
Re: Web Server without SD card
« Reply #5 on: September 27, 2013, 10:41:44 pm »
Another interesting thing I found while looking for a way to disable web panel, at+webswitch commmand.  (setPageDisplayMode in library)
It allows you to swap between normal or minimal page. (ew and iw respectively)
When set to iw it gives upload options for pages.
I haven't figured out how this works yet, (Its 1 am here, so not awake anymore :P) but it DID replace the web UI. (Once swapped back to ew mode) Im not sure what filenames it expects. Or even format.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Web Server without SD card
« Reply #6 on: September 28, 2013, 01:00:48 am »
The attached file might help with format and such for pages (for anyone who hasn't followed along - we don't recommend you mess with your wifi module's config pages unless you really know what you're doing, we won't replace them if you brick them)


When you disable it with at+webswitch were you able to use port 80 then? I should try it myself, but it is now 1am here as well...

ags131

  • Newbie
  • *
  • Posts: 9
Re: Web Server without SD card
« Reply #7 on: September 30, 2013, 02:26:00 pm »
at+webswitch only switches it to a mimimal upload page, I don't think it unblocks.

EDIT:
Ahh, that PDF also explains why I couldn't get a plain HTML to display.
« Last Edit: September 30, 2013, 02:28:20 pm by ags131 »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Web Server without SD card
« Reply #8 on: September 30, 2013, 06:33:29 pm »
too bad - I thought was the case - but thought maybe you had discovered something else with it - thanks!

natan

  • Newbie
  • *
  • Posts: 3
Attached PDF
« Reply #9 on: November 23, 2013, 03:14:44 am »
in the attached PDF it is mentioned that a tool is required to pack the html file, where can i find that tool?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Web Server without SD card
« Reply #10 on: November 28, 2013, 02:08:42 am »
All of the files provided by the manufacturer are here: http://digispark.s3.amazonaws.com/Wifi.zip
« Last Edit: November 29, 2013, 01:28:42 am by digistump »

natan

  • Newbie
  • *
  • Posts: 3
Re: Web Server without SD card
« Reply #11 on: December 02, 2013, 01:46:26 pm »
Thank you very much  ;D

TimO

  • Newbie
  • *
  • Posts: 36
Re: Web Server without SD card
« Reply #12 on: December 30, 2013, 07:42:25 am »
Has anyone worked out a way to disable, or move the configuration web server?  The best idea I've come up with so far, and I don't particularly like it, is to replace the home page of the configuration web server (as mentioned upthread), and have something like an HTML Redirect ie

Code: [Select]
<META HTTP-EQUIV="refresh" CONTENT="0; url=http://digix.web.server:8080/">
I haven't tried it, but in principle I guess it should work, it's not a very elegant solution though.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Web Server without SD card
« Reply #13 on: December 30, 2013, 10:57:00 am »
I've spent all of 2 minutes reading this thread on my phone ... fwiw

Is there access to the login processing code?  Can you add users? Can you choose the start page based on the user? { not that a break here wouldn't be critical too }