Changing RaspPi hostname caused flows to disappear

984 views
Skip to first unread message

Jon Murphy

unread,
Dec 20, 2016, 1:57:03 AM12/20/16
to Node-RED
Tonight I changed the hostname of a RaspPi 2B (running Jessie) from the default "raspberrypi" to "RaspPi2B".  I used the command `sudo hostnamectl set-hostname RaspPi2B`.  After a `sudo reboot` all of my created flows were gone.  Nothing but one blank tab.  

I did a `sudo hostnamectl set-hostname raspberrypi`  and all of my flows came back.  How do I change the hostname?

Colin Law

unread,
Dec 20, 2016, 2:02:10 AM12/20/16
to node...@googlegroups.com
Use raspi-config

Colin

On 20 Dec 2016 6:57 a.m., "Jon Murphy" <jcmur...@gmail.com> wrote:
Tonight I changed the hostname of a RaspPi 2B (running Jessie) from the default "raspberrypi" to "RaspPi2B".  I used the command `sudo hostnamectl set-hostname RaspPi2B`.  After a `sudo reboot` all of my created flows were gone.  Nothing but one blank tab.  

I did a `sudo hostnamectl set-hostname raspberrypi`  and all of my flows came back.  How do I change the hostname?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/6b7cb0c5-153f-413c-bb46-cc400c835d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julian Knight

unread,
Dec 20, 2016, 2:08:03 AM12/20/16
to Node-RED
You need to go to your .node-red config folder and find the flow file. Then rename it, the format will be obvious when you look at it as it has the hostname in it.

Alternatively, you can keep the same flow file name but then you need to start Node-RED with a parameter that tells it which file to use.

Dave C-J

unread,
Dec 20, 2016, 3:58:23 AM12/20/16
to node...@googlegroups.com
or you can edit the settings.js file and fix it permanently in there.

Jon Murphy

unread,
Dec 20, 2016, 8:24:13 PM12/20/16
to Node-RED
Got it!  Thank you everyone!

FYI - the hostnamectl command does not update the /etc/hosts file.  You may want to follow these steps:


cat /etc/hostname ## review current hostname info

cat /etc/hosts ## review current hosts info

sudo hostnamectl set-hostname <new_machine_name> ## set new hostname

sudo nano /etc/hosts ## edit hosts file
## look for line 127.0.1.1 raspberrypi
## then change raspberrypi to <new_machine_name>
127.0.1.1 <new_machine_name> 
## exit and save

sudo reboot

sudo nano ~/.node-red/settings.js
## look for //flowFile: ‘flows.json’
## then change to 
flowFile: 'flows_raspberrypi.json'
## exit and save



From: Dave C-J
Sent: December 20, 2016 at 2:58:20 AM CST
To: node...@googlegroups.com
Subject: Re: [node-red] Re: Changing RaspPi hostname caused flows to disappear
Reply all
Reply to author
Forward
0 new messages