Sponsored Content
Top Forums Shell Programming and Scripting Script to send serial commands over ethernet Post 302836057 by chebarbudo on Tuesday 23rd of July 2013 12:41:45 PM
Old 07-23-2013
Error Script to send serial commands over ethernet

Hi there,

I have a Debian server (192.168.1.1) connected through ethernet to a RS232 device servers (192.168.1.5) that is then connected through RS232 to a Video Projector.

The idea is that I want to send commands to the video projector (eg. turn on/off) via the device server.

According to the Benq Video Projector Manual, the command to read the power status is :
Code:
<CR>*pow=?#<CR>

The Moxa NPort 5150 Manual tells me to use port 4001 for communication.

All right then...

How do I send my command?

I tried
Code:
root@arcturus:~# telnet 192.168.1.5 4001
Trying 192.168.1.5...
telnet: Unable to connect to remote host: Connection refused
root@arcturus:~# echo -e '\r*pow=?#\r' | netcat 192.168.1.5 4001
(UNKNOWN) [192.168.1.5] 4001 (?) : Connection refused

Do you have any idea on how I should do that?

== edit start =========================
I found out that if I use UDP mode, the connection is accepted but freezes.
I have to press Ctrl+C to return to tty:
Code:
root@arcturus:~# echo -en '\r*pow=?#\r' | netcat -n -v -u -o /tmp/hextraffic.dump 192.168.1.5 4001
(UNKNOWN) [192.168.1.5] 4001 (?) open
^C sent 9, rcvd 0

== edit end ===========================



Regards
Santiago

Last edited by chebarbudo; 07-23-2013 at 01:54 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HELP: Need to send commands to Program

Hi, I am an absolute beginner in Unix and I need to send a commands to a program I have created a script that will let me login to the program, however, i cannot get the script to send commands to this program. When the cript logs into the program, the display/ prompt is as follows: 1>... (1 Reply)
Discussion started by: the_m4ch1ne
1 Replies

2. Shell Programming and Scripting

How to send AT commands after getting into Kermit window?

We're using Kermit 8.0.209 in Linux environment. We're trying to invoke kermit from an application, send some AT commands and receive the responses from the End terminals like mobiles/modems. We access these deivces through serial ports. For eg., to send a file we use command-line options like... (4 Replies)
Discussion started by: pratiul
4 Replies

3. Shell Programming and Scripting

Make ssh and send commands

Hi, I'm trying to make an SSH into a SGSN node and collect some commands printouts.:confused: I really don't know how this can be done. I think it must be like this: #!/bin/bash ssh user@192.168.88.10 Then I must enter the password, but I don't know how to do it, I tried with: echo... (3 Replies)
Discussion started by: nagomes
3 Replies

4. Cybersecurity

Logging shell commands and send it out

Dear friends I'm looking for a solution to log all commands that users do in my RedHat box, and send it out to other remote server, Is there any guide for that Thanks ---------- Post updated at 04:20 AM ---------- Previous update was at 03:47 AM ---------- I can think of something else I... (7 Replies)
Discussion started by: reaky
7 Replies

5. IP Networking

Need a bridge from an ethernet interface to a serial interface

This is my situation DOS pc serial cable (sl0) Linux Pc eth1 192.168.0.10 <-------------------->192.168.0.2 <------------>192.168.0.1 (router) I connected the linux pc and the dos pc with a SLIP (serial line internet protocol), so they can communicate in the sl0 interface. ... (3 Replies)
Discussion started by: mghis
3 Replies

6. Linux

send remote commands to windows machine?

hey guys, I've done some searching and other than winexe I haven't been able to find a way to send remote commands to a windows machine. The problem I get is with winexe whenever you send the process to the background in a script, I get the following error. :wall: Any help is appreciated! ... (0 Replies)
Discussion started by: terrell
0 Replies

7. Programming

unable to send read and write serial port

hey frns pls help me out !! i hav a code of c that i have to include in my project. i am using a device (geomeda) that has unix based OS. it also support SIM card for connecting to server . I need to send SMS to user from this device.. below code is not working .. i am unable to send sms and the... (7 Replies)
Discussion started by: yashwantkumar
7 Replies

8. Shell Programming and Scripting

Send/receive file through serial using minicom

i have connected with my board through serial interface using minicom and i am running a bash script, which should test ethernet (ping test), USB read/write, RS232 .. I have managed to test ethernet and USB read/write. I test ethernet with ping. I test USB read/write, using dd and verifying... (10 Replies)
Discussion started by: linuxmember
10 Replies

9. UNIX for Dummies Questions & Answers

How to Send AT Commands to mgetty?

Hello All, I've been working on something which requires a dialup USB Modem. I have been using minicom with success entering "AT Commands" directly into the terminal window that shows after running the minicom command. I had already configured the modem through minicom and was able to... (2 Replies)
Discussion started by: mrm5102
2 Replies

10. Shell Programming and Scripting

Communicating with ethernet to serial LED sign - is this feasible?

I have a london-electronics LED sign I picked up on eBay which I would like to display custom messages on programmatically. It is working ok. Opening it up, it has an ethernet to serial connection currently plugged in and a serial connection currently unplugged internally (same connectors).... (9 Replies)
Discussion started by: windswept321
9 Replies
CURLOPT_DNS_SERVERS(3)					     curl_easy_setopt options					    CURLOPT_DNS_SERVERS(3)

NAME
CURLOPT_DNS_SERVERS - set preferred DNS servers SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_SERVERS, char *servers); DESCRIPTION
Pass a char * that is the list of DNS servers to be used instead of the system default. The format of the dns servers option is: host[:port][,host[:port]]... For example: 192.168.1.100,192.168.1.101,3.4.5.6 The application does not have to keep the string around after setting this option. DEFAULT
NULL - use system default PROTOCOLS
All EXAMPLE
TODO AVAILABILITY
This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. Added in 7.24.0 RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, CURLE_NOT_BUILT_IN if support was disabled at compile-time, CURLE_BAD_FUNCTION_ARGUMENT when given an invalid server list, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_DNS_LOCAL_IP4(3), CURLOPT_DNS_CACHE_TIMEOUT(3), libcurl 7.54.0 December 21, 2016 CURLOPT_DNS_SERVERS(3)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy