Problem with listing FTP file names on M66 OpenCPU with AT+QFTPNLST - ftp

I have a hardware with quectel M66 module. I am also using the module as main processing unit, so the default Opencpu is quite changed. Also there is a watchdog applied to the module.
I am trying to open an FTP connection and get the file list on FTP with AT+QFTPNLST
opened connection with
AT+QIFGCNT=0
AT+QFTPUSER="---"
AT+QFTPPASS="---"
AT+QFTPOPEN="---",---
AT+QFTPPATH="/"
AT+QFTPCFG=4,"/COM/"
AT+QFTPNLST
FTP connection opens without problems (AT+QFTPSTAT returns OPENED). I can read, get, put etc. on FTP.
AT+QFTPNLST returns OK, CONNECT, and +QFTPNLST:1 but not the file name list. then the device goes to restart (because of the watchdog).
Any ideas why that happens?
thanks.

Related

AS400 FTP to windows server

I want to write a CLLE Program to transfer Files from the IFS to a Webserver.
The Webserver is registered in the Hosttable from the Iseries.
(commandline: CFGTCP -> Option 10 -> Scroll to the Webserver IP)
Current CLLE Program: (only the ftp-access)
PGM
OVRDBF FILE(INPUT) TOFILE(CMDDTAR7_2/US9FIP) OVRSCOPE(*JOB)
OVRDBF FILE(OUTPUT) TOFILE(CMDDTAR7_2/US9FOP) +
OVRSCOPE(*JOB)
FTP RMTSYS('10.1.2.99')
ENDPGM
After i call my Program i get some results in a PF-File.
The Results are in German but i translated shortly for you.
The Connection is unavalable to 10.1.2.99 on Port 21. Try it again later.
[...]
My Question at the end.
Do you have some solutions for me to transfer xml files to my Webserver from the iseries?
You're writing about a web server and you want to transfer files by ftp. Perhaps you're mixing up protocols here. I'll concentrate to resolve your apparent ftp connection problem.
Seems that the destination host 10.1.2.99 doesn't accept connections on Port 21.
Please make sure, there's no firewall or other stuff blocking your request to the destination host. Moreover, on the host 10.1.2.99 try telnet 10.1.2.99 ftp or ftp 10.1.2.99 in a command window, depending on OS and installed components.
Before automating, just test manually if you can successfully connect and log in via standard command line: ftp 10.1.2.99.
Transferring data by FTP is just fine in a local LAN. Beware that any data including username and password will be transferred in clear text and thus can be possibly read by others as the intended hosts.
Following up to your comment: Actually there are many possibilities to copy files. If you're running a recent version of IBM i, I'd opt for using scp. It's encrypted and thus safe for running outside of local LANs. Great to automate by utilizing Key-Authentication instead of passwords. And many web hosting companies offer scp/sftp access.

what is the meaning of FTP attributes in Filewatcher Property file?

The Properties file of a file watcher contains many attributes. I was not able to find the use of certain attributes. The attributes are
FTPModeBinary and
FTPConnectionPASV
these take true or false as its value.
Can anyone please help me to understand the use of these attributes?
"Binary" (as opposed to "text") transfers the file exactly as-is without doing any end-of-line conversions (like LF to CR/LF).
"Passive" means that the FTP server always opens a listening socket for the data connection and the client connects to it. (FTP uses a separate TCP channel for the actual data transfer.) Traditionally, FTP would have the sender open a connection to the receiver but this began breaking when people started residing behind NAT firewalls as there's no easy way to open a connection back to the client in that case. Without passive, it's actually possible to instruct two FTP servers to transfer a file between themselves without ever passing through the client.

How to configure the path for the UDP on the UNIX domain socket?

I am new to socket programming. I'm tring to establish an UNIX domain socket with DATAGRAM. I look up the information about the configuration of sun_path in struct sockaddr_un for a while, seems like there are not enough sources to help me.
I created 3 files, unix_socket.c (provides an interface for socket connection), udp_server.c and udp_client.c, all are located in the directory "/home/Socket".
When I set the sun_path as "home/Socket", the server side always generates an error "Address already in use".
I also tried using "localSocket" and "echo_socket", but the client side always generates an error "No such file or directory".
I have no idea what's going on. Could anybody help me fix it? Really appreciate.
Thank you very much
The /home/Socket is already a folder, so it cannot be overwritten by a UNIX socket (think of it as a sort of a special file). Try another path like /home/Socket/mysocket.
You should also check out the bind(2) manpage and the example therein.

BizTalk 2006 - receive file through FTP - timeout issues

When trying to receive a (large, approx. 100MB) file using an FTP adapter in BizTalk 2006, we run into the following problem, which causes the file to be processed over and over again.
Retrieving the file succeeds; it is placed into the MessageBox and processed properly
When the FTP adapter issues the DELE statement, it never reaches the FTP server the file is on (we have verified this by taking a look at the FTP server's logs)
there are no signs of timeouts on the FTP server; the FTP server log does not mention a timeout occurring
After the interval time set on the adapter expires, the FTP server will still find the large file that we have already processed in the previous run, because the DELE statement failed
The event log in BizTalk states that ‘The connection to the FTP server was broken prematurely’. That is why we think there is a timeout issue.
We have seen that retrieval of the file takes around 35 minutes. The FTP server timeout is set to 1 hour. no problems there I guess.
Then we found the following article: http://www.ncftp.com/ncftpd/doc/misc/ftp_and_firewalls.html#FirewallTimeouts. It states that a firewall / routing device might be responsible for the timeouts. The team managing our firewalls and routers told us that there were no timeouts set here.
Which leaves us in the dark on the cause of our problem. Does anyone of you have any suggestions? Or even better, the solution!!
Have you tried the solutions in this article?
I avoid using the FTP adapter. Instead I use a third party utility to retrieve files and move the transferred file to a file adapter receive location. Third party utilities allow you to configure rules, recovery actions etc, freeing BizTalk from having to manage the transfer.

Uploading to mainframe using FTP

I just want to know how you upload datasets specifying its characeteristics?
E.G. using the command quote site lrecl=500 recfm=fb
Well, the command was accepted when I tried to use it, but the problem is that when I tried to upload the file using the command 'send' ftp hangs up, and definitley closes the session.
This is the sample:http://www.mvsforums.com/helpboards/recent.php?sid=dab6b1f3cda149c7d7db855d90acaab1
ftp> quote site lrecl=500 recfm=fb
200 SITE command was accepted
ftp> send C:\test\test.txt 'ADM.SAMPLE.TEST'
200 Port request OK.
425 Can't open data connection.
ftp>
Any help will be appreciated.
Thanks.
I sometimes get this error because of firewall problems when trying to ftp behind a router. You might try switching to active or passive mode (depending of what you are currently using) to see if this helps.
I have a couple of programs that do this, but without specifying record size. The blocking command should be okay. Are you sure you don't have a permissions issue? Does ADM.SAMPLE.TEST already exist, and is it 500 bytes at least? If not, have them create it for you and see if the ftp works then.
You should be able to specify the data set allocation parameters using the site command.
site u=SYSDA rec=VB lr=6144 blk=0 ucount=2 tr pri=3000 sec=200
That translates to:
unit=SYSDA
record format=variable block
logical record length=6144
block size=0
unit count=2
track (allocation units)
primary space=3000
secondary space=200

Resources