Parth1234
Posts: 91
Joined: Mon Mar 12, 2018 3:14 pm

Software program to access remote machine over TCP/IP network

Sat Dec 29, 2018 8:53 am

raspberry and remote machine connected with LAN cable in same network. I want to send command via raspberry GUI that command will run on remote machine. Whatever command I will type on GUI of raspberry, that should be run on remote machine

Code: Select all

from tkinter import *

def callcommand():
        
top = Tk()

CommandLabel = Label(top, text="command", width=12 , height= 5 )
CommandLabel.grid(row=1, column=0)
EntryLabel = Entry(top, relief=RIDGE,  bd = 10)
EntryLabel .grid(row=1, column=1)

SubmitButton = Button(top, text="Submit", width=12, height= 2, command=callcommand)
SubmitButton.grid(row=2, column=1,  sticky=S+W)

top.mainloop()
What should i do in call command function to run the command on remote machine ?
Note : modified post
Last edited by Parth1234 on Sat Dec 29, 2018 6:23 pm, edited 2 times in total.

pfletch101
Posts: 630
Joined: Sat Feb 24, 2018 4:09 am
Location: Buffalo, NY, USA

Re: Is it possible to operate cmd of Windows from PI GUI

Sat Dec 29, 2018 4:56 pm

By default, Windows will only respond to 'commands' from its own GUI and/or from applications already running on it. If you want a program running on your pi to issue commands to a networked Windows system, I think that you will need to have a program running on the Windows system which is 'looking out' for messages from the pi and 'translating' them into commands for the Windows system. If there are only a couple of specific commands that you need to issue, there are a lot of fairly straightforward potential ways of implementing this. If you want a more general Windows command interface functioning from the pi, it is likely to be a bit more challenging, but certainly still doable.

If you give more details about what you are trying to do, people may be able to give more specific suggestions.

Parth1234
Posts: 91
Joined: Mon Mar 12, 2018 3:14 pm

Re: Software program to access remote machine over TCP/IP network

Sat Dec 29, 2018 6:12 pm

pfletch101 wrote:
Sat Dec 29, 2018 4:56 pm
If you give more details about what you are trying to do, people may be able to give more specific suggestions.
I want to develop a software program to access the remote machine over TCP/IP network. the software program will run on raspberry pi, then if I enter two commands through software they will be directly executed on the remote machine (Network printer)

command for network printer
  • get data
    send data
when i enter command " send data" in software, Pi will send data to the printer over TCP/IP
when i enter command " get data" in software, Pi will receive data from the printer over TCP/IP

I found that we can develop software with socket programming. I am not sure, I just need guidelines to make a software program

pfletch101
Posts: 630
Joined: Sat Feb 24, 2018 4:09 am
Location: Buffalo, NY, USA

Re: Software program to access remote machine over TCP/IP network

Sat Dec 29, 2018 9:24 pm

Is the printer truly a network printer - i.e. one that has an independent (probably WiFi) connection to the network and can be used by any other system on the network that has drivers for it, or is it attached to a (presumably Windows) computer and used as a shared device on its host system?

In the former case, you will need to access it through its web interface, and you will obviously need to know how to use the API or other protocols which need to be employed to communicate with it; in the latter case, you will either need to know how to communicate with it through the existing printer driver, or to be able to write your own driver which will do this. Neither of these options is likely to be quick or easy to accomplish!

Bi-directional communication with a printer (other than detecting Busy/Ready/Error status) is an unusual requirement for anything except a printer driver. What are you doing that requires this?

User avatar
DaveDriesen
Posts: 113
Joined: Sun Mar 31, 2013 8:28 pm
Location: Top of the food chain
Contact: Website

Re: Software program to access remote machine over TCP/IP network

Sun Dec 30, 2018 11:24 pm

Are you working on some kind of multifunctional? Where on one occasion you would send raw print data to the printer for printing, and on another you'd be trying to retrieve a network scan?

I went through a similar process while reverse engineering drivers for Xerox multifunctionals a couple of years ago. In my case I had working Windows drivers and needed to develop a linux/arm alternative that would run on the pi.

If you are in a similar situation, it's a good idea to install wireshark and capture/study the conversations the devices are having when they are executing the desired tasks. This should teach you a lot about what information to send and how to interpret any data received.

Then use sockets to perform the same actions. It is quite advanced though..

If you're also working on Xerox devices I may be able to dig up some old protocol information from my own work.. Been a few years though.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27432
Joined: Sat Jul 30, 2011 7:41 pm

Re: Software program to access remote machine over TCP/IP network

Mon Dec 31, 2018 9:11 am

Surely you are just talking about SSH or for graphical desktops, VNC?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “General discussion”