I'm trying to use the JsonTypeAdapter in a modem to transmit some data from a remote source.
The adapter is enabled through the modems startup script (JsonAdapter.enable()), and a TCP connection is established
to the modem at port 1100. I follow the "Hello world" example in the Fjåge documentation and send the following JSON to the modem:
{"action":"send","message":{"clazz":"org.arl.unet.DatagramReq","data":{"data":{"clazz":"[B","data":"aGVsbG8gd29ybGQh"},"msgID":"8152310b-155d-4303-9621-c610e036b373","perf":"REQUEST","recipient":"phy","sender":"MyCustomInterface"}}}
I've set the logLevel to 'ALL' and can see that I get an incoming TCP connection in the log, but no data is being transmitted by the modem.
I'm subscribing to the physical agent but am not getting any notifications in the WebShell (using UnetSocket works fine though).
I'm guessing that either the JsonAdapter isn't active on this TCP connection, the JSON string is faulty or not being sent properly by my application, or something else that I've missed.
I copied any pasted your JSON message, and it worked perfectly fine for me. Steps I took:
I used unet audio SDOAM to test:
$ bin/unet -c audio
Modem web: http://localhost:8080/
> iface
tcp://192.168.1.8:1100 [API]
ws://192.168.1.8:8080/ws [API]
tcp:///192.168.1.8:1100//127.0.0.1.55832 [API]
unetsh: console://- [GroovyScriptEngine]
websh: ws://192.168.1.8:8080/fjage/shell/ws [GroovyScriptEngine]
The 192.168.1.8:1100 API interface tells me which port the modem is listening on (port 1100). So, I connect to it:
$ nc 192.168.1.8 1100
{"alive": true}
The {"alive": true} tells me that I'm connected to the right port, and the modem is saying "hello" :-)
Now, I copy'n'paste your JSON message:
{"action":"send","message":{"clazz":"org.arl.unet.DatagramReq","data":{"data":{"clazz":"[B","data":"aGVsbG8gd29ybGQh"},"msgID":"8152310b-155d-4303-9621-c610e036b373","perf":"REQUEST","recipient":"phy","sender":"MyCustomInterface"}}}
I get a response back:
{"action":"send","message":{"clazz":"org.arl.fjage.Message","data":{"msgID":"41b8264c-be98-4bbe-8b72-8986606513ae","perf":"AGREE","recipient":"MyCustomInterface","sender":"phy","inReplyTo":"8152310b-155d-4303-9621-c610e036b373","sentAt":1586233766542}},"relay":false}
confirming that the message was received, and is being relayed to other slave containers. This is shortly followed by a "buzz" sound that my SDOAM makes to send the frame over the sound card, and the two messages (TxFrameStartNtf and TxFrameNtf) to confirm that the transmission was successfully completed:
{"action":"send","message":{"clazz":"org.arl.unet.phy.TxFrameStartNtf","data":{"txTime":15784016,"txDuration":1511416,"type":2,"msgID":"0a5bae1e-b16c-4bbb-8fcf-36ad55ffc64e","perf":"INFORM","recipient":"#phy__ntf","sender":"phy","inReplyTo":"8152310b-155d-4303-9621-c610e036b373","sentAt":1586233767349}},"relay":false}
{"action":"send","message":{"clazz":"org.arl.unet.phy.TxFrameNtf","data":{"txTime":15759432,"type":2,"location":{"clazz":"[D","data":""},"msgID":"f6e1dee6-ed31-4850-9d90-7b591a740971","perf":"INFORM","recipient":"MyCustomInterface","sender":"phy","inReplyTo":"8152310b-155d-4303-9621-c610e036b373","sentAt":1586233768761}},"relay":false}
IS SOLVED
I am trying to connect an ESP8266 01 (Controlled thru an Arduino) as a Client to an ESP8266 setup as an Server via TCP with AT-Commands. But as soon as I send the command "AT+CIPSTART" the response is "Link type Error". The SDK version is 2.0.0.
I have tried it with AT+CIPMUX on 1 and 0 and with every Id but the response is always Link type ERROR
Left is the Server / On the right the Client
Edit: Some random times after a couple of restarts it works but only 3% of the time.
IS SOLVED
I found the Answer. So what i did wrong was i didn't initialize the AP with AT+CIPMUX=1. That means it wasn't able to open multiple id. So i just deleted the "0," from AT+CIPSTART=0,"TCP".... to AT+CIPSTART="TCP"... and the command worked.
You can also just initialize the AP with AT+CIPMUX=1.
But now as soon as i send a message it disconnects/restarts and it won't receive the message.
EDIT: SECOND PROBLEM IS SOLVED
I am new react native and trying to connect to an URL "someurl.com" which is running on port 8051 via TCP.
I have tried it through web socket but its not working.
In iOS they have implemented it by using streams. Below is the code sample in iOS.
CFReadStreamRef readStream;
CFWriteStreamRef writeStream;
CFStreamCreatePairWithSocketToHost(
NULL,
(CFStringRef)/*DemoServer_Client, DemoServer_Client_Port*/ /*DemoServer*/ClientServer,
Client_Production_Port,
&readStream,
&writeStream);
I have tried it by using react-native-tcp npm but it's giving undefined object near Socket.connect. Please see below screenshot.
sockets connect error
Please help me in connecting to this server and getting the response in react-native.
Thanks
When I try to launch the Monaca Localkit application, it shows "Unable to start HTTP server. Maybe the port is occupied. Please change the port and restart the program."
Then, I have changed my port setting many times, but it still shows the same message.
My default port setting is 8001. And I checked whether other application is using this port by netstat command. But no application is using.
I tried to re-install Monaca Localkit application too. But the result is the same as before.
How can I fix this problem? Please give me an advise.
It means that another program is using that port, maybe another instance of localkit? If yes, terminate the program to free the port. You should also check if your firewall allows communications through port 8001.
If you want just to change port, you can open Localkit and go, from the menu bar, to Monaca Localkit -> Preferences and change Listening Port.
My WCF Service is hosted under net.tcpbinding and in case it is not running when client makes a call to its methods but let me tell you our some of clients get access and some of not. i even check antivirus setting and firewall setting for each client but haven't came up with right answer , client gets the EndpointNotFoundException with this message:
There was no endpoint listening...
i have check the path of service there is no mistake in path. and in my nettcp service based on window credential type and enabletcpportsharing is also on.
Still searching for right solution.
Thank you!
After trying telnet (IP Address of app server) Port. so i can understand it's blocking by window firewall or router firewall. if telnet open window from client machine that's mean its working and if not opening in window then call Network administrator to open that port
Eg. telnet xxx.xx.xx.xx 80 in command prompt