Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ahwman

macrumors member
Original poster
Jul 11, 2007
67
4
I’m trying to send a TCP request to a device via the terminal in MacOS but can’t figure out how to do so. Based on my research, it appears the NC command should be able to handle TCP requests. The command I’m trying to send follows.

IP: 192.168.1.104
Port: 4998
Body: "sendir,1:1,1,38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798"

I would greatly appreciate any help… 😀
 

Bigwaff

Contributor
Sep 20, 2013
2,775
1,848
Bash:
echo "sendir,1:1,1,38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798" > data.in
nc 192.168.1.184 4998 < data.in

Lots of info found in
Bash:
man nc
 

ahwman

macrumors member
Original poster
Jul 11, 2007
67
4
Bash:
echo "sendir,1:1,1,38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798" > data.in
nc 192.168.1.184 4998 < data.in

Lots of info found in
Bash:
man nc
Thanks so much. I’ll play with it and see if I can’t get it working… 😀
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.