wiotp out Node-RED node on Raspberry Pi connects to Watson IoT and stays disconnected after flow change - watson-iot

I added a wiotp out node to the flow and created a device on the Watson IoT platform. The initial connect was successful and logged on the platform:
Token auth succeeded: ClientID='d:ltxxxx:RaspberryPi:RPi3', ClientIP=146.52.28.xxx
I then added an Inject node, deployed again and the wiotp out node remains disconnected.
WIOTP log:
Closed connection from 146.52.28.xxx. The connection has completed normally.
Node-RED output:
[BaseClient:connect] Iotfclient is offline. Retrying connection
[BaseClient:onClose] Connection was closed.

rebooted the Raspbarry Pi, reconnected and it's working for now

Related

esp32 reconnect to loss wifi or disconnected mqtt

I am using esp32 code where it connects with wifi and sends data over mqtt.But on any MQTT failure,it does not reconnect. We should not need to reboot the device from outside, it should get back online whenever the problem is solved. The machine may restart after a long time when it is needed ,but remember on any failure it should not keep rebooting.

client-mode="true" and retryInterval on the inbound adapter with Client Connection factory

In spring Documentation --> 32.6 TCP Adapters it is mentioned that we use clientMode = "true" then the inbound adapter is responsible for the connection with external server.
I have created a flow in which the TCP Adapter with client connection factory makes connection with external server the code for the flow is :
IntegrationFlow flow = IntegrationFlows.from(Tcp.inboundAdapter(Tcp.nioClient(hostConnection.getIpAddress(),Integer.parseInt(hostConnection.getPort()))
.serializer(customSerializer)
.deserializer(customSerializer)
.id(hostConnection.getConnectionNumber())).clientMode(true).retryInterval(1000).errorChannel("testChannel").id(hostConnection.getConnectionNumber()+"adapter"))
.enrichHeaders(f->f.header("CustomerCode",hostConnection.getConnectionNumber()))
.channel(directChannel())
.handle(Jms.outboundAdapter(ConnectionFactory())
.destination(hostConnection.getConnectionNumber()))
.get();
theFlow = this.flowContext.registration(flow).id(hostConnection.getConnectionNumber()+"outflow").register();
I have created multiple flow by iterating over the list of connections and
iterate the above code in for loop and register them in flowcontext with unique ID.
My clients are created successfully with no issue and then establish there connection as supported by topology.
Issue :
I have counted the number of client connection created successfully so I have counted that 7 client connection (7 Integration flow) made successfully and they initiate connection from themselves.
when I create 8th client connection (8th flow created and registered successfully) but the .clientMode(true) is not working means the client don't initiate connection itself after first failure means it try for the first time to make connection if connected successfully then no issue but in case of failure it don't retry again.
Also my other created clients i.e 7 clients connection which are created successfully they also stopped initiating connection from itself when they got disconnected.
Note: There is no issue with flow only the TCP Adapters they stop initiating the connection
The flow is created and registered successfully as there is no issue it is because when I run a control bus command #adapter_id.retryConnection() it got connected with the server.
I don't understand that what is the issue with my flow that i couldn't initiate a connection after a particular count i.e seven or is there limitation in creating number of clients.
One possibility is the taskScheduler's thread pool is exhausted - that shouldn't happen with the above configuration, but it depends on what else is in the application. Take a thread dump (e.g. jstack) to see what the taskScheduler threads are doing.
See the documentation for information about how to configure the threads in the scheduler. However, if it solves it, you should really figure out what task(s) are using scheduler threads for long tasks.
Also turn on DEBUG logging to see if it provides any clues.

IPFS p2p experimental feature

Can't understand basic usage of this feature:
https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#ipfs-p2p
Open a listener on one node (node A) ipfs p2p listener open > p2p-test /ip4/127.0.0.1/tcp/10101
Ok. It's easy.
Where /ip4/127.0.0.1/tcp/10101 put address of application > you want to pass p2p connections to
What application? Side app? What does it mean "pass p2p connections to"? Where? Usual host:port format?
On the other node, connect to the listener on node A ipfs > p2p stream dial $NODE_A_PEERID p2p-test /ip4/127.0.0.1/tcp/10102
Why different port? How connect if node B dial makes similar listener as listener on node A?
Node B is now listening for a connection on TCP at > 127.0.0.1:10102, connect your application there to complete the connection
What app? How connect? How this scheme is working and looking?
Maybe somebody has a code example? Thank you all.

IBM IoT Raspberry Pi Connection refused not authorized

I have been using a Raspberry Pi 3 along with IBM Watson IoT platform and was just deploying some flows. However, I think I may have mixed up the device id between Gateway and Device.
When I registered my Raspberry Pi as a Device and a Gateway, I gave both connections the same Device ID. In hindsight, I can see why this might have been stupid. I am just going to disconnect all connections and create two new connections. However, I have a different problem right now. Whenever I try to launch NodeRed from my Raspberry Pi, I get the following log
3 Feb 17:07:27 - [error] IBMIoT: Error: Connection refused: Not authorized
[BaseClient:connect] Iotfclient is offline. Retrying connection
[BaseClient:onClose] Connection was closed.
This just keeps repeating over and over again, and I have no idea what to do to fix it.
That suggests you still have an IoT node in your flow with the incorrect credentials.
Assuming you are running Node-RED 0.15 or later, open the search dialog (Ctrl-. on 0.15 or Ctrl-F on 0.16) and search for ibmiot. That will reveal any existing configuration nodes you have. Clicking on one in the search results will reveal it in the Config node sidebar tab. Double click on it and either delete it or correct the credentials.
If you're on an older version (I suggest you upgrade), you can open the config node sidebar from the dropdown menu and manually look for the ibmiot nodes.

Unable to connect to feedback.sandbox.apple.com via tcp client in pushsharp

Unable to connect to the feedback.sandbox.push.apple.com with port number 2196.
Opened the ports (5223, 2915, 2916, 443) in windows firewall with TCP/SSL.
Tried connecting via telnet too, but did not help.
Getting the below exception
Service Exception: PushSharp.Apple.ApplePushService -> System.Net.Sockets.Socket
Exception (0x80004005): A connection attempt failed because the connected party
did not properly respond after a period of`enter code here` time, or established connection faile
d because connected host has failed to respond 17.172.232.45:2196
at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
at PushSharp.Apple.FeedbackService.Run(ApplePushChannelSettings settings, Can
cellationToken cancelToken) in d:\Sample Apps\Push Notification\PushSharp-master
\PushSharp-master\PushSharp.Apple\FeedbackService.cs:line 60
at PushSharp.Apple.ApplePushService.<>c__DisplayClass4.<.ctor>b__1(Object sta
te) in d:\Sample Apps\Push Notification\PushSharp-master\PushSharp-master\PushSh
arp.Apple\ApplePushService.cs:line 51
Failure: PushSharp.Apple.ApplePushService -> The maximum number of Send attempts
to send the notification was reached! -> {"aps":{"alert":"Hello World!","badge"
:7,"sound":"sound.caf"}}
Also, this does not need certificate to connect to sandbox, so why this exception?
You do need a development certificate from the Apple Developer portal to connect to sandbox. But I don't know if you need to use it to connect to feedback.sandbox.apple.
I can't seem to find a straight answer on this whether feedback services still works. I think APNS Feedback services are now deprecated. This could be why you're getting this error.
Does APNS Feedback service no longer exist as per new APIs?
APNS Feedback Service - is it still alive?

Resources