Communication via http

Other General Resources like icon sets, sound files etc.,

Moderator: Rathinagiri

User avatar
mol
Posts: 2910
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 149 times
Been thanked: 82 times
Contact:

Communication via http

Post by mol » Thu Jan 04, 2018 1:09 pm

Hi guys!
I've realised my first Arduino project. It will switch on/off lamp indicators depend on barcode scanner read in the warehouse.
Barcode scanner sends barcode to computer, computer sends info to my arduino which lamp should be switched on.

I've created http server which wait for info from computer via http.
I can control lamps via internet browser, calling arduino server: http://192.168.20.190/BRAMKA=3
I want to create simple application, which can call such a page.
Second problem is to act as http server to read info from wifi barcode reader.
Can anybody provide simplest http server application?

regards, Marek

User avatar
serge_girard
Posts: 1957
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 345 times
Been thanked: 77 times
Contact:

Post by serge_girard » Fri Jan 05, 2018 12:48 pm

Marek,

Can you please explain more about what you want?
I have a NETIO server but I don't think you mean that.
Serge

User avatar
mol
Posts: 2910
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 149 times
Been thanked: 82 times
Contact:

Post by mol » Fri Jan 05, 2018 4:23 pm

I need to build app, which will wait for transmision at eg. 80 port.

User avatar
srvet_claudio
Posts: 1979
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 34 times
Been thanked: 131 times
Contact:

Post by srvet_claudio » Fri Jan 05, 2018 5:28 pm

Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
mol
Posts: 2910
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 149 times
Been thanked: 82 times
Contact:

Post by mol » Fri Jan 05, 2018 7:51 pm

I remember your work. But, I need minimum solution

User avatar
mol
Posts: 2910
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 149 times
Been thanked: 82 times
Contact:

Post by mol » Sat Jan 06, 2018 8:52 am

I've simplified my procedure to control lamps:

Code: Select all


PROCEDURE SendRequestViaWWW
	param cURL
	
	local lSilent := .f.
	LOCAL oCon, i
	local ret := .f.
	local cOdp:=""
	
	for i:=1 to 3
		// number of tries
		oCon := TipClientHttp():New( cUrl )
		IF oCon:Open()
			cOdp := oCon:ReadAll()
			msgdebug("Connected?", cOdp)
			oCon:close()
			ret := .t.
			exit
		endif
	next i
	
	if !ret
		MsgBox("Error in connection " + oCon:lastErrorMessage())
	endif
RETURN ret
I can switch on/off 32 sending www request:

Code: Select all

SendRequestViaWWW("http://192.168.20.190/BRAMKA=16")

Now, I need to create server, which will wait for request from codebar scanner

edk
Posts: 229
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 67 times
Been thanked: 167 times

Post by edk » Sat Jan 06, 2018 10:17 am

Marek, maybe this will be helpful: micro web server on hb (uhttpd)
https://github.com/harbour/core/tree/ma ... as/httpsrv
and
https://github.com/vszakats/harbour-cor ... ib/hbhttpd


User avatar
mol
Posts: 2910
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 149 times
Been thanked: 82 times
Contact:

Post by mol » Sat Jan 06, 2018 2:42 pm

I've created my solution. It's very small and it's doing what I want.
A month ago, I even didnt dream I'll be able to control some devices from harbour app via wifi.
I'll present my app later.

edk
Posts: 229
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 67 times
Been thanked: 167 times

Post by edk » Sat Jan 06, 2018 3:21 pm

So I'm waiting impatiently 8-)
Last edited by edk on Sun Jan 07, 2018 11:34 am, edited 2 times in total.

Post Reply