Ewon web Server

Yes It is. I can do everything: Ping the device at 195.0.0.10, login to the ftp sever and manually retrieve the files using fileZilla. Maybe it didn’t work for you because I was connected to e catcher using the same credentials I sent you. I just log out, can you please give it another try?
It’s true that sometimes the device is not on, the reason for the ftp errors. But now, I am absolutely positive that It’s on.

@afotso1

Your device is running a slightly non-standard FTP server. I would like to approach this from a different direction. Do I have your permission to stop and edit your BASIC script?

Yes, you can

@afotso1

How frequently do you need the document.html file to sync to your Flexy?

I will need it daily. We are building a website that will get the file daily for processing. However, the website is not hosted on the flexy, but on a remote server. so, the remote server should connect to the flexy daily to get the file and use it for processing

@afotso1

After some testing it appears your FTP device isn’t allowing retrieval of the files via HTTP. I am still doing some testing to see if we can pull the file via FTP however I have an alternate solution you can use to get off the ground immediately.

The idea in this solution is to use the eWON as an intermediary. The eWON will grab the files and store them once per day and then your can simply retrieve the file from the eWON using an API call. The only special thing this will require is getting the file on an interval you determine. Below is a script I wrote to handle this for you.

INIT Section:
ONDATE 1, "* 23* * *", "@getLogFile"

FUNCTION getLogFile
    p$ = "/SDMemory/May/document.html
    GETFTP p$, "/usr/api.html"
ENDFN

The above function will run at 11 PM every day. You can update the interval as needed.
Then you would simply use the USER File export block descriptor to retrieve the file from the eWON. Also it is important to note, I rename the file to api.html so we can keep track of which api file is being used.

URL:

https://m2web.talk2m.com/t2mapi/get/ewon name/rcgi.bin/ParamForm?AST_Param=$dtUF$ufapi.html ... OTHER POST Data

Will this fit your needs?

Hi Jordan,
Yes, this should work. However, I tried the api you’ve sent but its not working. Here is the error message:
502 - Unable to reach device [WalMart - Corrine, UT] error code [52]
I also have the 2 warning messages below:

  • Notice: Undefined variable: dtUF

  • Notice: Undefined variable: ufapi
    Here is the API I used:

    Do I need to include any file before using those parameters?

I tried this on 2 different sites. One time out, the other display an error message saying user don’t have rights to access the device. So, I am wondering if you made any modification to the corrine ewon before being able to access it. Thanks

@afotso1

That specific eWON appears to be offline currently. That would explain the invalid access errors.
Also, you have to make sure to run the function I sent over as that is what actually pulls the file in and renames it.

You can manually trigger it by calling:

https://m2web.talk2m.com/t2mapi/get/ewon name/rcgi.bin/ExeScriptForm?command1=@getLogFile ... OTHER POST DATA

Then you can call the actual retrieval function. I tested that this morning and both worked just fine however I did delete the api.html file so as to leave your eWON in the same state I got it.

I tried the ExeScriptForm api which also fails. The command isn’t executed even thought am able to manually connect to the ewon. Maybe is the way I am sending my HTTP request which isn’t right. I will keep working on it. If you think of anything that can help me solve this please let me know. Thanks for your help

@jseanor
I tried everything but it’s still not working. The ExeScriptForm fails, it doesnt specifically says why. The Paraform keeps on saying device unreachable even though am able to connect to the device through ecatcher and ping everything. Also, My browser keeps saying that variables dtUF and UF are undefined. Do I need to initialize them somewhere?
errors

Here is the exact syntax I use for the ExeScriptForm:

$url = “https://m2web.talk2m.com/t2mapi/get/WalMart%20-%20Corrine,%20UT/rcgi.bin/ExeScriptForm?command1=@getLogFile&t2maccount=account&t2musername=user&t2mpassword=pass&t2mdeveloperid=id&t2mdeviceusername=usr&t2mdevicepassword=pass”;

$result = callJsonApi($url);
$myJSON = json_encode($result);
echo $myJSON;

Jordan, I am really stuck. don’t know why it’s not working need some help thanks

@afotso1

I just tested everything and it worked fine. The errors you showed (undefined errors) are because you have undefined values in you PHP application. Unfortunately I cannot debug your PHP application.

As far as your API requests, here is a Postman collection of the API information. Simply import it into Postman and you can see the exact requests. They are working fine on my end.




Postman Lib: Niagara.postman_collection.json (3.1 KB)


If you would like for me to aid more in your application, we do offer paid services. If you would like to go the services route send me over a private message and we can discuss things further.

Topic closed due to inactivity.