Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto Connect nodes at Boot
#11
(04-12-2018, 07:29 AM)SkyVinnie Wrote: Hi Guys i have just worked out how to get the nodes to auto connect on reboot / startup. 

I am a linux noob and have only just learnt how to use it for this project!


This is what i have discovered. 

Master / Node 1 

IP.ADD.HERE = your ip address looks like ( 192.162.100.40 )

Step 1. 

cd ~ 
vi master.sh

In the text editor enter. 

Code:
#!/bin/sh

export GOPATH="$HOME/go"



cd $GOPATH/bin
nohup ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 & echo $! > manager.pid

sleep 30

nohup ./node -connect-manager -manager-address IP.ADD.RES:5998 -manager-web IP.ADD.HERE:8000 > /dev/null 2>&1 & echo $! > node.pid

Step 2. chmod +x master.sh


Step 3. crontab -e 
Scroll to the bottom of the page and enter

Code:
@reboot /root/master.sh

Step 4. reboot 



Nodes 2/3/4/5/6/7/8

Step 1. 

cd ~ 
vi startnode.sh

In the text editor enter. 
Code:
#!/bin/sh

export GOPATH="$HOME/go"


cd $GOPATH/bin/
sleep 30

nohup ./node -connect-manager -manager-address IP.ADD.HERE:5998 -manager-web IP.ADD.HERE:8000 > /dev/null 2>&1 & echo $! > node.pid

Step 2. chmod +x startnode.sh


Step 3. crontab -e 
Scroll to the bottom of the page and enter. 

Code:
@reboot /root/startnode.sh

Step 4. reboot 

Repeat for all your other boards. 

Check your manager at 192.xxx.xxx.xxx:8000

Now on boot / reboot your nodes should connect after 30 seconds


Awesome post Vinny, I'd really like to get this going for my DIY Skyminer. I'm running 10 RPI 3B+ nodes and the setup is online.

When I follow your steps I get the error E353: Nothing in register " (see screenshots).
When I scroll up in the terminal I noticed that the '!/bin/sh part didn't show, even though I just copy/pasted it.

Any clue how to continue?
[Image: Nothing_in_register_error.png]

[Image: Nothing_in_register_error_2.png]
Reply
#12
when i try to do this i get this response can you help me

nohup: appending output to '/home/pi/nohup.out'
nohup: failed to run command './manager'
pi@raspberrypi:~ $ : No such file or directory
Reply
#13
(06-13-2018, 12:03 PM)Cryptogod1337 Wrote:
(04-12-2018, 07:29 AM)SkyVinnie Wrote: Hi Guys i have just worked out how to get the nodes to auto connect on reboot / startup. 

I am a linux noob and have only just learnt how to use it for this project!


This is what i have discovered. 

Master / Node 1 

IP.ADD.HERE = your ip address looks like ( 192.162.100.40 )

Step 1. 

cd ~ 
vi master.sh

In the text editor enter. 

Code:
#!/bin/sh

export GOPATH="$HOME/go"



cd $GOPATH/bin
nohup ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 & echo $! > manager.pid

sleep 30

nohup ./node -connect-manager -manager-address IP.ADD.RES:5998 -manager-web IP.ADD.HERE:8000 > /dev/null 2>&1 & echo $! > node.pid

Step 2. chmod +x master.sh


Step 3. crontab -e 
Scroll to the bottom of the page and enter

Code:
@reboot /root/master.sh

Step 4. reboot 



Nodes 2/3/4/5/6/7/8

Step 1. 

cd ~ 
vi startnode.sh

In the text editor enter. 
Code:
#!/bin/sh

export GOPATH="$HOME/go"


cd $GOPATH/bin/
sleep 30

nohup ./node -connect-manager -manager-address IP.ADD.HERE:5998 -manager-web IP.ADD.HERE:8000 > /dev/null 2>&1 & echo $! > node.pid

Step 2. chmod +x startnode.sh


Step 3. crontab -e 
Scroll to the bottom of the page and enter. 

Code:
@reboot /root/startnode.sh

Step 4. reboot 

Repeat for all your other boards. 

Check your manager at 192.xxx.xxx.xxx:8000

Now on boot / reboot your nodes should connect after 30 seconds


Awesome post Vinny, I'd really like to get this going for my DIY Skyminer. I'm running 10 RPI 3B+ nodes and the setup is online.

When I follow your steps I get the error E353: Nothing in register " (see screenshots).
When I scroll up in the terminal I noticed that the '!/bin/sh part didn't show, even though I just copy/pasted it.

Any clue how to continue?
[Image: Nothing_in_register_error.png]

[Image: Nothing_in_register_error_2.png]

Vi can be qute annoying for people new to linux. I suggest replacing the command vi with nano. you might find it a little easier to edit the messages and copy paste. That said something when highlighting things on this forum my box randomly shrinks so I only copied half the line or half the code. That may have been what happened to you. 


(06-19-2018, 02:43 AM)FANTOMLR Wrote: when i try to do this i get this response can you help me

nohup: appending output to '/home/pi/nohup.out'
nohup: failed to run command './manager'
pi@raspberrypi:~ $ : No such file or directory

are you adding this to the Raspberrypi pre made image tutoral?
Reply
#14
Linux newbie here, i just skipped the whole VI process and made a startnode.sh in windows and used winscp to upload all the files to every node and set properties to execute that way. much simpler.
Reply
#15
(04-12-2018, 07:29 AM)SkyVinnie Wrote: Hi Guys i have just worked out how to get the nodes to auto connect on reboot / startup. 

I am a linux noob and have only just learnt how to use it for this project!


This is what i have discovered. 

Master / Node 1 

IP.ADD.HERE = your ip address looks like ( 192.162.100.40 )

Step 1. 

cd ~ 
vi master.sh

In the text editor enter. 

Code:
#!/bin/sh

export GOPATH="$HOME/go"



cd $GOPATH/bin
nohup ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 & echo $! > manager.pid

sleep 30

nohup ./node -connect-manager -manager-address IP.ADD.RES:5998 -manager-web IP.ADD.HERE:8000 > /dev/null 2>&1 & echo $! > node.pid

Step 2. chmod +x master.sh


Step 3. crontab -e 
Scroll to the bottom of the page and enter

Code:
@reboot /root/master.sh

Step 4. reboot 



Nodes 2/3/4/5/6/7/8

Step 1. 

cd ~ 
vi startnode.sh

In the text editor enter. 
Code:
#!/bin/sh

export GOPATH="$HOME/go"


cd $GOPATH/bin/
sleep 30

nohup ./node -connect-manager -manager-address IP.ADD.HERE:5998 -manager-web IP.ADD.HERE:8000 > /dev/null 2>&1 & echo $! > node.pid

Step 2. chmod +x startnode.sh


Step 3. crontab -e 
Scroll to the bottom of the page and enter. 

Code:
@reboot /root/startnode.sh

Step 4. reboot 

Repeat for all your other boards. 

Check your manager at 192.xxx.xxx.xxx:8000

Now on boot / reboot your nodes should connect after 30 seconds


I have not been able to get this Auto start to work. If anyone could please help me out a little I would really appreaicate it.  I am runnin a OrangePiPC. I followed all the steps in puTTy:



Step 1. 
mythicmining@Mythicnode1:~$ cd
mythicmining@Mythicnode1:~$ vi master.sh

In the text editor enter. 
I pressed (i) to insert

Code:
#!/bin/sh

export GOPATH="$HOME/go"



cd $GOPATH/bin
nohup ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 & echo $! > manager.pid

sleep 30

nohup ./node -connect-manager -manager-address 192.168.1.163:5998 -manager-web 192.168.1.163:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 & echo $! > node.pid

Hit the Esc Key, typed :wq  and hit the Enter Key

Step 2.
mythicmining@Mythicnode1:~$ chmod +x master.sh

Step 3.
mythicmining@Mythicnode1:~$ crontab -e

Using the /usr/bin/vim.basic editor (option 2)

Press (i) scroll all the way down to the bottom and type 

Code:
@reboot /root/master.sh

Hit the Esc Key, typed :wq  and hit the Enter Key
I then get this message: 
crontab: installing new crontab

Step 4.
mythicmining@Mythicnode1:~$ reboot


The Orange Pi PC reboots, and nothing ever happens, I have let it sit for 30 minutes. I reconnect using puTTy and type

Code:
cd $GOPATH/bin
nohup ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 & echo $! > manager.pid

(Press the ENTER Key)

nohup ./node -connect-manager -manager-address 192.168.1.163:5998 -manager-web 192.168.1.163:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 & echo $! > node.pid

(Press the ENTER Key) then everything comes right up. I have attached a picture of the all the codes in the editors down below.


[Image: codes.jpg]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)