-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection between Publisher & Subscriber lost when IP changes #59
Comments
Spacebrew uses both the publisher/subscriber name and its IP address to identify the endpoint. You might want to setup a static IP address on your laptop, or setup a script to bootstrap the connections using the admin API. |
Hello thanks for your answer. I will be more explicit in the way I want to use the Spacebrew: I will have different ArduinoYun boards connected via Wifi, behind a router in differents locations (they can be even different cities) sending sensors information to the Spacebrew server. They will be the Publishers. On the other hand there will be other clients that will receive and work with the data (Subscribers). So, the information flow will be constant and can't lost the connection between Publishers and Subscribers when the Public IP of them changes. I have made a test to check what the public IP are: 1 - I have checked my public IP in internet (the router) a is 77.211.58.145 2- I have connected 2 button examples and the Admin to the spacebrew server sandbox.spacebrew.cc and I got that the IP of the 2 buttons are 77.211.58.145. This has sense 3- I have connected 2 button examples and the Admin to my own server in Heroku and I get that the IP of the 2 buttons are 10.99.161.33 and 10.13.189.201. This hasn't sense The buttons work in both servers, but the difference is that in mine the IPs change every hour losting the connections between Publishers & Subscribers and on the other hand the buttons in the Spacebrew server remains stable. The questions would be: 1- Why the the buttons connected with the Spacebrew server, get the Public IP of my router and the ones with my server get private IP when the Spacebrew's admin utility in both cases are running locally in my computer? 2- What I have to do to get my own server, working as the Spacebrew server? 3- Could you give more details about setup a script to bootstrap the connections using the admin API? because give an static publicIP is not an option because can be a lot of Yun boards sending information. Thanks |
I have the same problem for a similar use case, where my Spacebrew clients are behind a router whose IP address changes.
For example, to connect all publish routes named "slider1" to all receive routes named "slider2" on the Spacebrew server running on localhost:
node_persistent_admin.js is actually an admin client to the Spacebrew server, so you have to keep it running separately from the server. When the persistent admin is running it watches connections to the Spacebrew server and makes connections between the clients based on the persistent routes (string matching on the client and route names). |
The node_persistent_admin is designed for this sort of use case. You would
|
Thanks! Yes, node_persistent_admin loads the persistent routes at startup. But first you have to manually save the routes (with "save") in the CLI. I added an example in my comment above. |
Hello! When I try to run "node_persistent_admin.js" I get an error in CLI:
What Im doing wrong? |
Hello
I have my own Spacebrew server installed in Heroku and I have tried the button example and it works fine (changing the color background). The problem comes when my laptop's external IP, changes, For example from 10.179.151.165 to 10.231.195.45. Then I can see two version of the same button and the connection between publisher and subscriber is lost (In the same button) so when I press the button, the background color doesn't change.
There are something I have missed?
Thanks
The text was updated successfully, but these errors were encountered: