Hi folks
I work for a manufacturer of semiconductor equipment that I see from browsing the archives some of you are familiar with. I’m no expert on QNX but have got to know 4.25 reasonably well by necessity. Everyone who really understands it seems to have moved on some time ago.
I’m trying to achieve something that I hoped would be quite easy, but is turning out not to be. The idea is, from a QNX machine, to
$ telnet <ip> 80
to a robot controller with an embedded webserver and issue a GET to retrieve a couple of log files. If I try this from Windows telnet, it works just fine. Send the GET, hit enter twice and it spits the whole logfile out. It sends various headers but doesn’t seem to demand any of them.
From QNX 4.25 telnet, however, it just doesn’t work.
Firstly, it seems to mess with CR/LFs (by turning CR from 0x0D into 0x00 0x0D) although I guess that’s to be expected and I don’t think it’s actually the problem.
The real problem is that this web server doesn’t seem to want to start responding until a TCP FIN is sent. After opening the socket it will close it after 10 seconds if there is no input, but once you send a command, it’ll sit there waiting for a FIN for any amount of time and I can’t find any way of persuading QNX telnet to send a FIN, other than by exiting or killing the process. So once you close the telnet session you’re piping the input into, the server starts responding and actually sends a HTTP 200 OK response and some headers before QNX hits it with TCP RST until it stops.
I’ve copied the exact request that works from a Windows machine, saved it from wireshark, verified it in a hex editor, piped it into QNX telnet with the -8 option (for 8 bit mode, just in case that does anything) and it does not work. There is nothing I can find that makes the webserver start talking and keeps the socket open.
If someone is familiar with the issue and has a solution, that would be great. Alternatively, from browsing the archives, I see a few people claiming to have successfully ported netcat to QNX4.25. I don’t have a toolchain for QNX4.25 and wouldn’t fancy my chances of achieving this goal even if I did. If anyone has a binary of this somewhere they can share, I would be very grateful.
The only other alternative I can think of is that QNX4.25, or at least our build of it, does come with perl. I know nothing about perl and don’t want to, but it does seem possible chatgpt might guide me towards a working app that can send arbitrary commands over a TCP socket and save the output.
I’ll see what you guys have to say before pursuing that.
Many thanks
Gavin
EDIT: I should clarify I tried 1) using telnet interactively 2) piping input from a file into telnet and 2a) doing that, using a sleep 1
command. I even tried piping the input into a FIFO then into telnet - none of it works. Whatever I do, the server only starts responding then the process is killed. QNX telnet to Windows webserver does not have this problem. Neither does QNX telnet to Python webserver running on Linux.