Communication via http

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

Moderator: Rathinagiri

User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Communication via http

Post by mol »

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: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Communication via http

Post by serge_girard »

Marek,

Can you please explain more about what you want?
I have a NETIO server but I don't think you mean that.
Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Communication via http

Post by mol »

I need to build app, which will wait for transmision at eg. 80 port.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Communication via http

Post by srvet_claudio »

Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Communication via http

Post by mol »

I remember your work. But, I need minimum solution
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Communication via http

Post by mol »

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: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Communication via http

Post by edk »

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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Communication via http

Post by mol »

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: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Communication via http

Post by edk »

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