Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. A server to communicate with a robot

A server to communicate with a robot

Scheduled Pinned Locked Moved Design and Architecture
questionsysadmincsharpdatabasedesign
12 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cocoonwls
    wrote on last edited by
    #1

    Hi all, Any suggestion or tips on application architecture if i need to develop a server application which is using to communicate with remote machine? (remark : machine firmware is using ROS.) Original idea: a) Client UI (.aspx) <---request/response---> web server(IIS) & db <---communicate via network connection---> machine b) robot will keep update status to db via web server application every few second. c) Meanwhile, server application need to do some algorithm then response to robot every few second or any instruction from robot. d) Client need to connect to server every second to get the latest data (monitoring purpose) e) Client can control robot via server application. My question are, 1) shall i develop the server application using web technology or using window programming? (I found some article said that can using websocket .NET 4.5 as server,is suit for my case? ) 2) what is the pro and con for both web and window programming? Any tips or suggestions are welcome Thanks in advance wls

    L K M 3 Replies Last reply
    0
    • C cocoonwls

      Hi all, Any suggestion or tips on application architecture if i need to develop a server application which is using to communicate with remote machine? (remark : machine firmware is using ROS.) Original idea: a) Client UI (.aspx) <---request/response---> web server(IIS) & db <---communicate via network connection---> machine b) robot will keep update status to db via web server application every few second. c) Meanwhile, server application need to do some algorithm then response to robot every few second or any instruction from robot. d) Client need to connect to server every second to get the latest data (monitoring purpose) e) Client can control robot via server application. My question are, 1) shall i develop the server application using web technology or using window programming? (I found some article said that can using websocket .NET 4.5 as server,is suit for my case? ) 2) what is the pro and con for both web and window programming? Any tips or suggestions are welcome Thanks in advance wls

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      cocoonwls wrote:

      what is the pro and con for both web and window programming?

      That's a general question, not limited to your project. A webapp requires a webserver, a windows app a desktop. With a desktop app you know the user, in a webapp you can have multiple. Webapps have no access to local resources, local apps do.

      cocoonwls wrote:

      1. shall i develop the server application using web technology or using window programming?

      I'd recommend diving into their tutorials first. Looks[^] like ROS runs under a 'nix system, meaning that the harder part is making the call from the robot.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      C 1 Reply Last reply
      0
      • L Lost User

        cocoonwls wrote:

        what is the pro and con for both web and window programming?

        That's a general question, not limited to your project. A webapp requires a webserver, a windows app a desktop. With a desktop app you know the user, in a webapp you can have multiple. Webapps have no access to local resources, local apps do.

        cocoonwls wrote:

        1. shall i develop the server application using web technology or using window programming?

        I'd recommend diving into their tutorials first. Looks[^] like ROS runs under a 'nix system, meaning that the harder part is making the call from the robot.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        C Offline
        C Offline
        cocoonwls
        wrote on last edited by
        #3

        Hi, thank you for your response. Actually making the call from robot was done by team member (via wifi protocol). Now i need to build a server application to handler/receive multiple request from robot. I am now researching on .Am i in the right track? Note: My final output is allow user to control the robot via client application which is develop by using HTML5,jqery,javascript and asp.net with C# (idealy) Regards.

        L 1 Reply Last reply
        0
        • C cocoonwls

          Hi, thank you for your response. Actually making the call from robot was done by team member (via wifi protocol). Now i need to build a server application to handler/receive multiple request from robot. I am now researching on .Am i in the right track? Note: My final output is allow user to control the robot via client application which is develop by using HTML5,jqery,javascript and asp.net with C# (idealy) Regards.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          cocoonwls wrote:

          Actually making the call from robot was done by team member (via wifi protocol).

          Yup, sounds like TCP/IP, but that does not answer whether the robot will be pushing/reading from a socket, or is expecting a webpage. You'd need to ask the team-member.

          cocoonwls wrote:

          I am now researching on websockets .Am i in the right track

          Depends on what the team-member says, but I'd expect that it'd be the right track.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          C 1 Reply Last reply
          0
          • L Lost User

            cocoonwls wrote:

            Actually making the call from robot was done by team member (via wifi protocol).

            Yup, sounds like TCP/IP, but that does not answer whether the robot will be pushing/reading from a socket, or is expecting a webpage. You'd need to ask the team-member.

            cocoonwls wrote:

            I am now researching on websockets .Am i in the right track

            Depends on what the team-member says, but I'd expect that it'd be the right track.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            C Offline
            C Offline
            cocoonwls
            wrote on last edited by
            #5

            Quote:

            Yup, sounds like TCP/IP, but that does not answer whether the robot will be pushing/reading from a socket, or is expecting a webpage. You'd need to ask the team-member.

            The robot will keep sending request to server (handshaking with server) , thus most of the time the server application will be in listening mode. Unless there have certain command need to robot take action, then server application will send a command via socket (robot have their own API). Okay, now i am quite clear what should i do but one more things. For the server application, i need to response a webpage to client, so do i need to separate the server application ? what i mean is one server application do for serve robot, and another one do for client.My client need to monitor all the robot information on-time (update each 1 to 3 second). Thanks again :)

            L 1 Reply Last reply
            0
            • C cocoonwls

              Quote:

              Yup, sounds like TCP/IP, but that does not answer whether the robot will be pushing/reading from a socket, or is expecting a webpage. You'd need to ask the team-member.

              The robot will keep sending request to server (handshaking with server) , thus most of the time the server application will be in listening mode. Unless there have certain command need to robot take action, then server application will send a command via socket (robot have their own API). Okay, now i am quite clear what should i do but one more things. For the server application, i need to response a webpage to client, so do i need to separate the server application ? what i mean is one server application do for serve robot, and another one do for client.My client need to monitor all the robot information on-time (update each 1 to 3 second). Thanks again :)

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              That will depend on how your teammate will have implemented it on his side. You should ask if he/she can actually communicate using webpages (does the robot have a server where you can request pages from?) A socket would be simpeler, as you'd open it and wait for a text to arrive :)

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              C 1 Reply Last reply
              0
              • L Lost User

                That will depend on how your teammate will have implemented it on his side. You should ask if he/she can actually communicate using webpages (does the robot have a server where you can request pages from?) A socket would be simpeler, as you'd open it and wait for a text to arrive :)

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                C Offline
                C Offline
                cocoonwls
                wrote on last edited by
                #7

                Quote:

                A socket would be simpeler, as you'd open it and wait for a text to arrive Smile | :)

                Okay, i think i will continue in websocket solution which is able to communicate with ROS :) This is my last question, shall i develop the websocket as a window service or just host in IIS? Thanks in advance

                L 1 Reply Last reply
                0
                • C cocoonwls

                  Quote:

                  A socket would be simpeler, as you'd open it and wait for a text to arrive Smile | :)

                  Okay, i think i will continue in websocket solution which is able to communicate with ROS :) This is my last question, shall i develop the websocket as a window service or just host in IIS? Thanks in advance

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Host it in IIS. Windows Services are meant for applications that do NOT require interaction with the user, and are usually started before a user logs on. It would introduce complexity without any extra benefits. If you want to create a WinForm UI, then create a WinForm app. The choice would be between a webapp and a WinForm app, not a Windows service. Given your experience, I'd recommend the webapp.

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                  C 1 Reply Last reply
                  0
                  • L Lost User

                    Host it in IIS. Windows Services are meant for applications that do NOT require interaction with the user, and are usually started before a user logs on. It would introduce complexity without any extra benefits. If you want to create a WinForm UI, then create a WinForm app. The choice would be between a webapp and a WinForm app, not a Windows service. Given your experience, I'd recommend the webapp.

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                    C Offline
                    C Offline
                    cocoonwls
                    wrote on last edited by
                    #9

                    Eddy,thousand thanks for your suggestion and tips :laugh: Another question :) if websocket compare with WCF, which technology is more suitable for communication with machine/robot?

                    L 1 Reply Last reply
                    0
                    • C cocoonwls

                      Eddy,thousand thanks for your suggestion and tips :laugh: Another question :) if websocket compare with WCF, which technology is more suitable for communication with machine/robot?

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      You're welome. I haven't used WCF yet, so I can't comment there. I'd be going for a prototype using the socketclasses, probably TcpClient - though WCF is supposed to be a bit more friendly and flexible.

                      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                      1 Reply Last reply
                      0
                      • C cocoonwls

                        Hi all, Any suggestion or tips on application architecture if i need to develop a server application which is using to communicate with remote machine? (remark : machine firmware is using ROS.) Original idea: a) Client UI (.aspx) <---request/response---> web server(IIS) & db <---communicate via network connection---> machine b) robot will keep update status to db via web server application every few second. c) Meanwhile, server application need to do some algorithm then response to robot every few second or any instruction from robot. d) Client need to connect to server every second to get the latest data (monitoring purpose) e) Client can control robot via server application. My question are, 1) shall i develop the server application using web technology or using window programming? (I found some article said that can using websocket .NET 4.5 as server,is suit for my case? ) 2) what is the pro and con for both web and window programming? Any tips or suggestions are welcome Thanks in advance wls

                        K Offline
                        K Offline
                        Keld Olykke
                        wrote on last edited by
                        #11

                        Hi, Since a robot is a real-time system, I wouldn't want to mix it directly into a web server. I would make an application in C# or Java with a dedicated socket for communication with the robot. This application can continuously communicate with the robot - read states and send commands. When that is in place, you can do use a database or the file system to pass data to and from a webserver. In this way you have the application in control of when to read a command from a client, when to send the command to the robot and when to sample the states of the robot. In a typical web servers everything is request based. A request is initiated by the client and your code is basically a method call that has to return as fast as possible. It might be easy at start, but it is a poor way to monitor a robot. As an example it becomes a difficult task to track the robot and document where the robot was and then deduce why it did as it did. I would let a standalone application dump the robot's state to a file system periodically and let it check the file system for the next command to send. In this way - if it is made flexible enough - you can have a folder with commands that takes your robot for a spin and produces a folder with its monitored states. If it fails, you can redo the experiment after changing what not on the robot, and you will have all data stored in the file system for your report. Afterwards you can make a web server page that reads/writes the file system. Kind Regards, Keld Ølykke

                        1 Reply Last reply
                        0
                        • C cocoonwls

                          Hi all, Any suggestion or tips on application architecture if i need to develop a server application which is using to communicate with remote machine? (remark : machine firmware is using ROS.) Original idea: a) Client UI (.aspx) <---request/response---> web server(IIS) & db <---communicate via network connection---> machine b) robot will keep update status to db via web server application every few second. c) Meanwhile, server application need to do some algorithm then response to robot every few second or any instruction from robot. d) Client need to connect to server every second to get the latest data (monitoring purpose) e) Client can control robot via server application. My question are, 1) shall i develop the server application using web technology or using window programming? (I found some article said that can using websocket .NET 4.5 as server,is suit for my case? ) 2) what is the pro and con for both web and window programming? Any tips or suggestions are welcome Thanks in advance wls

                          M Offline
                          M Offline
                          manoranjan
                          wrote on last edited by
                          #12

                          Websocket is an extension of http protocol. Therefore, your machine (robot) needs to understand websocket (and http) protocol if you plan to use websockets. You also need IIS to run your web application. Plain TCP sockets require less overhead but *may* require the robot to open a listening port (and your web application will send its updates to this listening port). Whether you need an extra listening port on the robot depends on implementation of your robot. You can use a web app to serve Client UI and plain sockets to communicate with your robot. Additionally, you can use websockets to send monitoring data to Client UI. However, you need latest browser for websockets to work.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups