B4J Question WebApp for rPi to change IP?

Giu

Member
Licensed User
Longtime User
Hi.

I would like to create some kind of webapp to change the IP raspberry pi is using. I'm looking into info for webapps, but, somebody knows how to make the change of IP?

Thanks.
 

Siam

Active Member
Licensed User
Longtime User
Hi,

you must write the new IP to /etc/network/interfaces i think the simplest way is you Overwrite this file with the new Settings(i'm not shure that this work).
if your original config shows like this example:
B4X:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.178.110
netmask 255.255.255.0
gateway 192.168.178.1

Then you must write all the data containig this file to the new file and only change the network settings.
after that you must start a shell command ( jshell library)

B4X:
sudo /etc/init.d/network restart

to update the settings

But look out if you make here some errors you can't connect to the pi over the network.

regards

Andy
 
Last edited:
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

I have this requirement too. Do you have solved your question with your method ?
 
Upvote 0
Top