Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2016, 06:50:06 18:50


Login with username, password and session length


Pages: [1]
Print
Author Topic: embedded web server using ethernet to serial, possible?  (Read 1245 times)
0 Members and 1 Guest are viewing this topic.
gabriel
Active Member
***
Offline Offline

Posts: 112

Thank You
-Given: 152
-Receive: 46


« on: June 28, 2015, 04:18:56 16:18 »

Hello:
I bought an ethernet to serial converter recently, is it possible to make an embedded web server using it and a PIC micro? and how?
any useful link is appreciated

thank you
Logged
pablo2048
Active Member
***
Offline Offline

Posts: 103

Thank You
-Given: 96
-Receive: 82


« Reply #1 on: June 28, 2015, 05:36:31 17:36 »

IMHO if it's based on Ralink SOC, then i suggest OpenWRT (http://wiki.openwrt.org/toh/hilink/hlk-rm04)
Logged
akacalo
Newbie
*
 Muted
Offline Offline

Posts: 9

Thank You
-Given: 9
-Receive: 2


« Reply #2 on: July 07, 2015, 12:29:28 12:29 »

I think you can do it. Here I explain you, in a very simple form, the phases your web server needs to do to proccess a request

1- Analyze the headers of the requests, this wil tell you what resource are the client looking for. A very simple example:
Code:
GET /index.html HTTP/1.1 -> This is the request method (GET or POST are the most common, but you can implement others like PUT or DELETEi)
Host: example.com  -> This is the host that the client is connecting to, I think you won't need to analyze it, unless you want multiple domains in same ip, which are very complex to implement
Content-Type: text/html -> This obviously, is the content type, you usually will get this if your client wants an html page

2- Write the response headers
Here you send the response headers. Here is an  example:
Code:
HTTP/1.1 200 OK -> his is the code for an ok request, also there are other codes 404 Not Found, 403 Forbidden and 500 Internal Server Error are very simple codes
Content-Type: text/html -> This you send what type of data are you sending, text/html for html, text/xml for xml or text/plan for a txt file.
Content-Length: number -> You here put the size of the data you want to send.

3- Send two CRLF to separate the headers from the content
4- Send the contents

I hope you find this useful.

IMHO if it's based on Ralink SOC, then i suggest OpenWRT (http://wiki.openwrt.org/toh/hilink/hlk-rm04)

WOW, I have used OpenWRT, but didn't know that there are adapters with OpenWRT!
Logged
h0nk
Active Member
***
Offline Offline

Posts: 120

Thank You
-Given: 88
-Receive: 83



« Reply #3 on: July 07, 2015, 05:42:54 17:42 »


Hello Gabriel,

i would be wise to specify Your adapter more exact.

The range spans from "old" Printservers with a serial port,
over Lantronix X-Ports, Equinox Ethernet-Serial Consolboxes to
modules with Ralink/Atheros/... SoC's and many more...

Some require an external Controller to implement a HTTP-protocol,
some are already equipped with a embedded Webserver.


Best Regards
Logged
gabriel
Active Member
***
Offline Offline

Posts: 112

Thank You
-Given: 152
-Receive: 46


« Reply #4 on: July 08, 2015, 07:19:41 07:19 »

Hello:
it's http://www.aliexpress.com/item/Serial-Port-Server-Module-Ethernet-Network-To-RS232-TCPIP-RJ45-To-TTL-Seckill-ENC28J60/32266748325.html

or

http://www.aliexpress.com/item/uart-WIFI-module/548545095.html

thanks
Logged
pablo2048
Active Member
***
Offline Offline

Posts: 103

Thank You
-Given: 96
-Receive: 82


« Reply #5 on: July 08, 2015, 08:02:20 08:02 »

The second one You mentioned already has web server built in, but its not supported by OpenWRT yet (and seems to be little overpriced to me compared with RM04). For the first one i didn't find any open source firmware but only the datasheet here http://www.oomipood.ee/kasutusjuhend/USR-TCP232-T24_EN.pdf so no luck here :-(
Logged
loosha
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 4
-Receive: 4


« Reply #6 on: July 08, 2015, 10:33:53 10:33 »

Hello.
        Just I think this links are solve your problem.

http://www.ebay.com/bhp/enc28j60-module
http://www.mikroe.com/downloads/get/539/en_article_c_pic_02_09.pdf


LOOSHA   Grin
Logged
akacalo
Newbie
*
 Muted
Offline Offline

Posts: 9

Thank You
-Given: 9
-Receive: 2


« Reply #7 on: July 08, 2015, 01:32:04 13:32 »


With that you have to implement an entire web server in the pic, as I semi-explained before. As @pablo2048 mentioned a one with open wrt will be very simple to implement a web server, because is based on Linux and you can manually compile lots of open source web servers.

But if you need to have a web server on a pic this is the best choice, I am playing with it now and seems very good.
« Last Edit: July 08, 2015, 01:36:15 13:36 by akacalo » Logged
UKFlyer
Inactive

Offline Offline

Posts: 4

Thank You
-Given: 0
-Receive: 1


« Reply #8 on: July 08, 2015, 06:09:53 18:09 »

Google "MM2: Web controlled Thermostat"

This has code (Basic so easy to read) that shows how to use a ethernet to serial converter (happens to be a wireless version but this has no impact on the code) to create a simple web site
Logged
h0nk
Active Member
***
Offline Offline

Posts: 120

Thank You
-Given: 88
-Receive: 83



« Reply #9 on: July 08, 2015, 07:52:18 19:52 »


Hello Gabriel,

the main controller on Your ethernet to serial adapter is an LPC1114F from NXP.
This is an ARM-M0-Core which should capable doing the HTTP-stuff.
With Google You should find some projects with this combination (LPC1114F ENC28J60).
E.g.: https://developer.mbed.org/users/ban4jp/code/uIP-1-0_webserver/file/685224d2f66d/dev-enc28j60

But You have to check, if You will be able to reprogram the main controller.
You may use a serial bootloader, a JTAG-adapter or if the LPC1114F supports this
a SWD (Single-Wire-Debug)-Adapter.


Good luck, and

Best Regards
Logged
bigtoy
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 127
-Receive: 197


« Reply #10 on: July 09, 2015, 05:40:38 05:40 »

I know the OP was asking about PIC, but how about Arduino? Lots of easy-to-use stuff available there, and cheap.

https://www.youtube.com/watch?v=Xj7BQMd0wc8
Logged
akacalo
Newbie
*
 Muted
Offline Offline

Posts: 9

Thank You
-Given: 9
-Receive: 2


« Reply #11 on: July 10, 2015, 01:07:07 01:07 »


Arduino is very good to view library developed on top of it for controlling different modules and then port to pic c language, like Ccs or xc.

If you do a search on GitHub.com you will find a lots of open source projects that may help with your project.
Logged
gabriel
Active Member
***
Offline Offline

Posts: 112

Thank You
-Given: 152
-Receive: 46


« Reply #12 on: July 10, 2015, 07:31:01 07:31 »

Yep, I'll switch to arduino, very simple, cheap, too much libraries and books

Thanks all!!
Logged
hammerhead
Inactive

Offline Offline

Posts: 4

Thank You
-Given: 4
-Receive: 1


« Reply #13 on: December 03, 2015, 07:01:13 07:01 »

Actually, the PIC makes a pretty good little embedded web server.   I've used both the PIC18F67J60 and PIC32MX795F512.  The 67J60 has an integrated MAC/PHY so it's a nice little all-in-one.  It is lacking in horsepower if you want to do anything with SSL so I moved to the PIC32 for more recent projects.  Both have eval boards and free TCP/IP stacks from Microchip with working demos that are easily reconfigured to suit your application.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC