Web server using WiFi232 module - Has anyone done it yet?
Alex.Stanfield
Posts: 198
Hi, I'm starting a new project (P1 based) and wanted to give it a simple web interface (basically text and some action buttons). I have one of those USR-WIFI232 modules that I haven't used before.
So, is there a sample code for a simple web server (either spin/pasm or SimpleIDE C/C++) laying around?
Has anyone built a web-server based on these uart 232 modules?
Any ideas or pointers are welcome.
Thanks
Alex
So, is there a sample code for a simple web server (either spin/pasm or SimpleIDE C/C++) laying around?
Has anyone built a web-server based on these uart 232 modules?
Any ideas or pointers are welcome.
Thanks
Alex
Comments
Have you thought of using one of the ESP8266 modules? They seem to have a lot of sw done for the onboard ARM processor, and for external processors such as the AVR. It should not be that hard to convert the code to a prop. IIRC there has been some ESP8266 code done for the Prop. These ESP8266 modules are <$4. See www.esp8266.com for more info.
That is a great idea i have to try in the future but
1) I don't have any esp8266 around for several weeks
2) I still have these usr-wifi modules laying around that i'd like to use in this project, so I must insist with these for the time being
Alex
I have some working code that I will try and get out by Friday.
Jim
Thanks a lot Jim!
I'm looking forward 'til Friday...
Alex
Here is my primary source of info for primary set up of the wifi modules [URL] http://propellerpowered.com/forum/index.php?topic=230.0 [/URL]
You need to have your wifi set up and working as per the instructions on OBC's website at the link. Once that is done you can load my code. I can access the server from my iPad. Biggest problem is my router keeps resetting the port and I have to go back, find the port and reset the adapter. I should be able to send you the code tomorrow morning.
Jim
Fixed the link, (extra space after URL).
Jim
Now I need an http parser and get into designing the web pages.
It's really simple, and simple as it is I haven't tested multiple simultaneous browser requests. the manual says it will send everything together one client request after the other and each response to every client. I wonder which would be the best approach to make the app "user proof"...
Alex
Here is a simplistic server that runs html code.
wifi_webserver_090414 - Archive [Date 2015.02.26 Time 09.02].zip
Jim
Thanks Jim! I'll give it a try asap
Alex
Jim
If you come up with some HTML code that allows the clock to be sent out as just a single line without refreshing the entire page I would appreciate it.
Thanks
Jim
1- I wanted to do this project in C so ramping up on the toolchain was kind of a headwind for getting to try the module
2- I finally got some time to experiment with the module using SimpleIDE and was successful, however the experience was disappointing...
- Even though the setup is quite flexible and straightforward, this module is kind of dumb and you don't get all the control I wished over it.
- For starters you don't know who's talking to you when data comes you way (I mean using the embedded socket listener that passes a web request to the propeller)
- Then even when you get to parse the http request and manage to send a response the response is not sent until de tcp timeout expires (kind of strange but not surprising)
- So the best i could get for responses was 1 sec wait (min timeout) plus the "transaction" time involved in the Propeller, not really a show stopper but not very appealing
Anyway, since I'm waiting for a needed max31855 module to arrive I decided to peek at the ESP8266 (following Cluso99's advice). Definitely this module looks great! So great that unfortunately I might ditch the Propeller too this time and run the app directly inside the module (in LUA language)! Wifi is a must but the rest is just a PID controller with ramping for a Kiln. The Propeller is just too much.
I would like to use the Propeller but in this case it would add complexity and assuming the ESP8266 has the needed strength it wouldn't make any sense.
Alex
Agreed, for simple designs, the ESP8266 can run standalone.
I have an app that requires a number of inputs and outputs and protocols, so the prop as the add-on processor is ideal. I also have apps that will likely just be ESP8266 standalone.