Im trying to download a file from a FTP server using active mode.However,it looks like my connection just"expire" or something each time.First,I open a port on my computer using netcat,ex:
nc -vv -l -p 62077
this will listen on port 62077 on my computer.Then,I open another netcat windows,log in to the FTP link using port 21,and once im in the directory where the file I want is in,I do
PORT (my IP separated by , ),(242,125(wich equals to port 62077)\r\n
However,after I enter this command,nothing happen for about 10-15 seconds,and the netcat just quit without saying anything.Nothing happen either on the netcat window that is listening on port 62077.It does that everytime,I dont know what I am doing wrong.I did the same thing with Filezilla(in active mode) and examinated the commands with wireshark,I do the exact same command as Filezilla,however filezilla will be able to retrieve the file while netcat wont.I want to retrieve it with netcat and I dont know what im doing wrong.I am using Windows 10.
thank you!
After you have established your listening nc socket, and after you have sent the USER, PASS, and PORT commands, you then need to trigger the file transfer to that listening socket using e.g.:
RETR /path/to/file/to/download
on the control connection. (Unless you actually are already doing this, but didn't mention it in the post?)
Also, just to note: you mention using something like this:
PORT 1,2,3,4,(242,125)\r\n
Right? Those parentheses might also be an issue. Instead, you might try:
PORT 1,2,3,4,242,125\r\n
without any parentheses.
Now, depending on the IP address you sent (hopefully not a private network address), the data transfer may still not happen, due to firewalls/routers/NAT on the client side of things. Given that your Filezilla download of the same file works, I suspect that those firewall/router/NAT issues may not apply.
Hope this helps!
I'm trying to create serial communication in NetBSD. This
communication will connect the computer with a controller via RS-485.
The problem is that I don't know if it necessary some configuration or driver to do it.
Specifically, the communication will be through the RS-485 port. I've tried to use /dev/tty01, but there are no pulses in serial output.
Are there some configurations , drivers or codes necessary to open, send and receive serial data in NetBSD?
I didn't have sucess until now.
Thanks
Nothing special needed.
If your serial is a real serial, then you could connect via:
# cu -l /dev/tty00
if your serial is a serial over USB then:
# cu -l /dev/ttyU0
However in both cases you have to be root, or change permissions on the device.
If the output is not visible, then adjust the speed with -s switch.
I'm trying to modify the data being printed to an Epson POS printer before it is printed. I'm currently doing this by using a print monitor instead of the Epson port in the printer port config. In the WritePort() routine for the monitor, I am writing the modified data to COM1 directly. This does send the data to the printer, but it is not doing the negotiation with the printer that is done if the Epson port is selected instead of the port monitor.
Is there a way to send the data from my monitor through the Epson port in order to get the real driver to kick in? It seems to be a monitor as well as it shows up in the list returned from EnumMonitors().
I've seen similar questions asked, but I've been unable to find the answer on any forum.
Thanks!
I use modified QExtSerialPort because I don't need any libs. I write to port successfully and successfully read from port if data generated by device itself. But on my commands to it it doesn't answer. bytesAvailable () always returns 0 on any attempt to read after successful command record.
Under Windows all works fine.
I test com port with CoolTerm application and it work properly too.
How to fix this behavior?
Thx.
I need to communicate with a serial device by sending it ascii characters. I know that in Linux you can use fopen() to write to a serial port, but I didn't know if you could do that from a shell. If not, is there another simple way to do this?
I believe you can simply redirect/cat data to the serial port from the shell. You'll want to use setserial(8) to configure baud and other information first.