• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Network Application With Embedded Hardware System Listening via TCP/IP Port Not Responding  RSS feed

 
Anil Sable
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Am working on a Java Networking Project, A Project is Based on Hardware Embedded System and Java Network Application as a Client.
The Working Scenario is Hardware Embedded System Connect with other client via a TCP/Ip Protocol. Hardware Embedded System Create Socket With Fixed IP Address and Port That every client java application needs to connect.
So I Have to Send Codes to Hardware Embedded System and System Do Function According to Code.

Ok Data For Program is
-----------------------------
Hardware Embedded System IP = 192.168.100.2
Hardware Embedded System port = 4004
Hardware Embedded System test signal = 5020fa
Hardware Embedded System respons of test signal response if success = 5070fa

Currently am Working with Simulator of Hardware Embedded System which running on Same Computer and port no 4004 . . .

My Program for Hardware Embedded System Connectivity is as Follow
--------------------------------------------------------------------------



Am Not Getting Response form Hardware System

My Question on Situation as
------------------------------------
1. Is Anything Wrong in programm.
2. Am working with hardware so do i need to pass data in other format . . ( I tried with binary, octal, hexadecimal, decimal, hexcode, string, utf8, utf16, utf32, ascii, usascii all all character set available in java)
3. any other suggestion that i should try to make it working
 
Henry Wong
author
Sheriff
Posts: 22853
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am not sure I understand the issue. You say that this is a hardware device, yet, you access it via the loopback interface... which implies that it is a service on the same machine. Can you clarify a bit?

Henry
 
Anil Sable
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
I am not sure I understand the issue. You say that this is a hardware device, yet, you access it via the loopback interface... which implies that it is a service on the same machine. Can you clarify a bit?

Henry


Actually Program is going to communicate with hardware device. but initially for development purpose am using Hardware Device Simulator which is running on Same Machine . . .
 
Henry Wong
author
Sheriff
Posts: 22853
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anil Sable wrote:
Actually Program is going to communicate with hardware device. but initially for development purpose am using Hardware Device Simulator which is running on Same Machine . . .


Well, since it is a simulator, can you confirm that it receive the message and responded? It is much easier to debug both sides, instead of just from one side. Also, it may be a good idea to catch and print out any exception that you may have received.

Henry
 
Anil Sable
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Anil Sable wrote:
Actually Program is going to communicate with hardware device. but initially for development purpose am using Hardware Device Simulator which is running on Same Machine . . .


Well, since it is a simulator, can you confirm that it receive the message and responded? It is much easier to debug both sides, instead of just from one side. Also, it may be a good idea to catch and print out any exception that you may have received.

Henry



Actually Simulator is build by other person . . . and we don't have code for simulator . . . so we have to just relay on our program for debugging . . . and no exception is thrown in my code . . is just block while reading server response . . . .

Actually simulator is working when we start simulator . . . it bind current comupter ip with port address 4004 . . . my program is able to connect to simulator and able to send data also . . but it is not responding any response back to my client program . . . i have one question in my mind that when we communicate with hardware which data format should i use to send data like converting message i.e. '5020fa' in binday, hex, integer(hexadecimal), ascii, unicode or any other ?

and what are other possibilities for securing hardware application from get hacked by any outsider client ?
 
Henry Wong
author
Sheriff
Posts: 22853
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anil Sable wrote:
Actually Simulator is build by other person . . . and we don't have code for simulator . . . so we have to just relay on our program for debugging . . . and no exception is thrown in my code . . is just block while reading server response . . . .


You can only debug and fix what you can see. If you cannot see (or confirm) something, then you are just guessing on the fix. In this case, you can connect without any problems, and you can send without any problems... the reason for the lack of response can be anything from a firewall issue, an encoding issue, an invalid request, etc. Any fix would be a guess, and since you know the hardware better than us, your guess is better than ours. Good luck.

Anil Sable wrote:
and what are other possibilities for securing hardware application from get hacked by any outsider client ?


Depends on how paranoid you are. At minimum, you probably want some sort of SSL connection, which includes some sort of encryption to prevent the data from being transmitted in the clear. To add to that, you probably want some sort of authentication mechanism to confirm the identity of the client. Regardless, in either case, you will need to modify the protocol, which means that it can't be done from one side.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!