Ewon TechForum
Providing technical solutions to technical requests


BASIC SCRIPT program.bas from one eWON to others
Nikolai Offline
Junior Member
#1
Hi All. 
Is it possible to send program.bas file from one eWON to other?  
Because some eWONs are not reachable by ethernet but old script switching it to modem connection for 1 minute per day. 
May be somebody used new BASIC function - REQUESTHTTPX for similar task? 
I suppose there is no possible to use PUTFTP in that case.
Are there some possibilities to do that?
Reply

simon Offline
eWON Support
#2
Hi,

Yes, you have to use PUTFTP to push the new program.bas to the other Ewon.
By HTTP, it is perhaps possible but you'll have to do some reverse engineering...

Simon
Reply

Nikolai Offline
Junior Member
#3
Actually I already tried PUTFTP but it didn't work.
I used usual way:

X$ = "program.bas"
Y$ = "[$dtUF $ctG $uf/program.bas]"
Z$ = "adm:adm@213.18x.xxx.208:21"
PUTFTP X$, Y$, Z$
f% = GETSYS PRG,"ACTIONID"
GOTO WAIT_STEP

only got errors
What I did wrong?
Reply

AngelaT Offline
Ewon Distributor
#4
Did you put a copy of the program.bas into the usr directory? The $dtUF EBD only works with files in the usr directory so you are probably getting file not found errors when it tries to retrieve the file. Use the $dtPG EBD instead.
Reply

Nikolai Offline
Junior Member
#5
Of course I put the file in a usr directory.
Reply

simon Offline
eWON Support
#6
Hi,

- Have you tried "/program.bas" ?
- You should remove the ctG in the EBD. The file cannot be gzip'ed

Simon
Reply

Nikolai Offline
Junior Member
#7
- Yes, I did all, but only response 24003. If I send it to our server with DNS - no problem.
- Perhaps server rejects ip address. Any ideas?
Reply

Nikolai Offline
Junior Member
#8
Simon,
I tried send some command from one ewon to other but these command are executes on source ewon instead of target ewon.
This code:
T2MAccount$ = "xxxx"
T2MUsername$ = "yyy"
T2MPassword$ = "zzzz"
T2MDeveloperId$ = "wwww"
Target_eWON_Name$ = "nnnn"
Target_eWON_Username$ = "adm"
Target_eWON_Password$ = "adm"

url$ = "https://m2web.talk2m.com/t2mapi/get/"+Target_eWON_Name$+"/rcgi.bin/ExeScriptForm?Command1=SETSYS COM, Command2=SETSYS COM,"WANCnx","1", Command3=SETSYS COM,"WANPermCnx","1",Command4=SETSYS COM,"SAVE"

url$ = url$ + "&t2maccount="+T2MAccount$+"&t2musername="+T2MUsername$+"&t2mpassword="+T2MPassword$
url$ = url$ +"&t2mdeveloperid="+T2MDeveloperId$+"&t2mdeviceusername="+Target_eWON_Username$+"&t2mdevicepassword=" + Target_eWON_Password$

REQUESTHTTPX url$, method$, "", ""

actionID% = GETSYS PRG, "ACTIONID"
PRINT "request actionid is "; actionID%

What is wrong at that time?
Reply

simon Offline
eWON Support
#9
Hi Nikolai,

Have you set the target Ewon name in Target_eWON_Name$ ? or the Ewon name (in eCatcher) of the one you execute the script on ?

Did you "program.bas" copy script finally work ?

Simon.
Reply

Nikolai Offline
Junior Member
#10
Yes, I've set exact target name like it is in eCatcher. But very strange behavior.. May be need change method from get to any other?

No, program.bas is not copied to other ewon, ftp always returns 24003 error.
Reply

simon Offline
eWON Support
#11
1. That is strange. The GET method should work. You can try my specific Java IOServer that makes the same but better Wink on https://techforum.ewon.biz/thread-286-po...tml#pid686
2. The error 24003 means a connection issue (connect socket failed).

Simon
Reply

Nikolai Offline
Junior Member
#12
Also get invalid parameter (5) 21: a$ = RESPONSEHTTPX "RESPONSEBODY"
Reply

Nikolai Offline
Junior Member
#13
..should be RESPONSE-BODY, so finally I got response body: {"message":"invalid credentials","code":403,"success":false}
solved it
then got:
.. <h1>Bad request</h1>
.. <p.Your browser sent a request that this server could not understand.<br/>
server doesn't understand this script:
...
T2MUsername$ = "adm"
T2MPassword$ = "adm"
method$ = "GET"

url$ = "https://m2web.talk2m.com/t2mapi/get/"+Target_eWON_Name$+"/rcgi.bin/ExeScriptForm&Command1="SETSYS COM,"LOAD","&Command2="SETSYS COM,"WANCnx","1"
url$ = url$ + "&Command3="SETSYS COM,"SAVE"

url$ = url$ + "&t2maccount="+T2MAccount$+"&t2musername="+T2MUsername$+"&t2mpassword="+T2MPassword$
url$ = url$ +"&t2mdeveloperid="+T2MDeveloperId$+"&t2mdeviceusername="+T2MUsername$+"&t2mdevicepassword=" + T2MPassword$

REQUESTHTTPX url$, method$

are there some detailed info how proceed REQUESTHTTPX?
Reply

Nikolai Offline
Junior Member
#14
.. I used ewon names with spaces, after I found out that my account advanced but not admin! thats why finally got forbidden..
Reply

simon Offline
eWON Support
#15
;-) good you found out!
Reply



Possibly Related Threads…
01-04-2020, 08:30 AM
Last Post: Jean-Paul
23-03-2020, 04:24 PM
Last Post: simon
09-03-2020, 02:29 PM
Last Post: simon
09-03-2020, 01:48 PM
Last Post: simon
  Creating Totaliser Within eWON Started by Josh
3 Replies - 1.030 Views
14-02-2020, 06:06 PM
Last Post: simon
24-01-2020, 09:45 PM
Last Post: tedsch
  eWON and ThingWorx Started by simon
13 Replies - 6.282 Views
17-01-2020, 05:55 PM
Last Post: ltitel
27-11-2019, 10:30 PM
Last Post: simon
30-10-2019, 10:02 PM
Last Post: Nikolai
22-10-2019, 10:42 AM
Last Post: simon



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy