-
Hi @viglucci I try to setup a browser based app to control a hardware (kemper amplifier, where i wiresharked the ip traffic from / to the android app). I tried the above examples(which are not not browser compatible just yet i think, but anyways ) with only the client part called. 1.) In wireshark i can see that the hardware is sending a tcp packet with data, how can i subscribe to that data (when parsing the data i need to do further actions).
2.2.) here in my sent message there are prepend hex before "hello World" -> how can this be avoided (this ? https://www.wireshark.org/lists/wireshark-users/200805/msg00206.html) ?
3.) my first tryouts were made with node's net module, and also as with the net module i have "tcp retransmission errors" when sending data to the hardware, so assuming i can only receive but cannot send tcp messages. Any Idea why (i can ping the hardware) ? As of point 3.) because it is the most important point for me, the communication between hardware and android app is:
maybe the hardware needs a udp message to accept tcp conversation ? can i send a udp message with rsocket too ? Thank you (of course i could share some example when it works, in case you could need it)! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hiya @schoko11 Happy to hear you are looking at rsocket-js for your project. After reading your question(s), I am a tad bit uncertain though where in your solution you are attempting to leverage RSocket/rsocket-js. Unless I am mistaken, it sounds like your Kemper device is transmitting data using TCP, but does not sounds like it utilizes the RSocket protocol. If you want to use RSocket to communicate with the device, or as a portion of the communications you'll need to convert the TCP streamss from the device into RSocket compatible streams. Given that, you'll need to find some way to understand how the protocol from the Kemper device functions, and then from there you may be able to write a layer/service to do the translation, however trying to connect a RSocket client directly to the device is unlikely to be successful. Are you trying to use RSocket for this project, or mainly just asking general questions about TCP with nodejs/javascript? If you are looking to leverage RSocket/rsocket-js for this project, based on my limted understanding of what it sounds like you are looking to accomplish, this is how I would suspect you might approach it: A few additional things I can address from your questions above:
IF you decide you want to use RSocket as part of your project, and that usage is to occur within a browser, then you'll need to use the WebSocket transport rather than the TCP transport. TCP is not supported natively in browser environments. That said, you again aren't going to be able to connect the RSocket WebSocket client directly to your kemper device, you are going to need to author a which exposes a RSocket WebSocket server interface to satisfy the needs of the RSocket WebSocket client.
The RSocket protocol requires certain framing on packet types. This is part of the protocol and not something that can be avoided if using RSocket-js.
The net module from Node is the correct way to create a TCP client (or server), however, again you won't be able to run this within a browser environment.
Honestly I'm not sure and I don't think I'll be able to assist you much with troubleshooting these particular issues. I can't claim to be deeply familiar with TCP or the net module, apart from leveraging them to the extent that was needed to implement the RSocket TCP Client/Server transports for this package.
RSocket supports UDP at the protocol level, however there is not a UDP transport currently implemented for rsocket-js. Regardless, even if there were it would not be suitable for this usecase unless the RSocket protocol was understood on the receiving end. |
Beta Was this translation helpful? Give feedback.
-
Well it is "sockets" with nodes net module (have to dig into this topics too), some pieces underneath
i now have a basic thing tested with
next up would be a tryout of this with socket.io or alternatives... |
Beta Was this translation helpful? Give feedback.
Hiya @schoko11
Happy to hear you are looking at rsocket-js for your project. After reading your question(s), I am a tad bit uncertain though where in your solution you are attempting to leverage RSocket/rsocket-js.
Unless I am mistaken, it sounds like your Kemper device is transmitting data using TCP, but does not sounds like it utilizes the RSocket protocol. If you want to use RSocket to communicate with the device, or as a portion of the communications you'll need to convert the TCP streamss from the device into RSocket compatible streams. Given that, you'll need to find some way to understand how the protocol from the Kemper device functions, and then from there you may be able to writ…