Resin Hotspot Static IP how to assign clients IP?


#1

I was trying to create a static IP hotspot on resin:
My script is not working following https://docs.resin.io/deployment/network/2.x/#setting-a-static-ip
Will clients get auto-dhcp? My aim is to connect to 192.168.1.127:5000, having a Flask Webserver running on that IP.

[connection]
id=resin-hotspot
uuid=36060c57-aebd-4ccf-aba4-ef75121b5f77
type=wifi
autoconnect=false
interface-name=wlan0
permissions=
secondaries=

[wifi]
band=bg
mac-address-blacklist=
mac-address-randomization=0
mode=ap
seen-bssids=
ssid=rpi-hotspot

[wifi-security]
group=
key-mgmt=wpa-psk
pairwise=
proto=
psk=mypass

[ipv4]
address1=192.168.1.127/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;
dns-search=
method=manual

Thanks for help.


#2

Hi. Have you copied this script in the right location? It should be placed in the “system-connections” directory.
If you did that, what are the symptoms? Does the wifi interface get assigned the desired IP address?


#5

Hi. I have copied it to system-connections. It does not assign the desired IP or opens the AP. I am using wlan0 (Rpi3 Interal Wifi) looking at ifconfig


#7

I have managed to setup the second wifi. I had to activate the connection using nmcli connection up <connection-id>.

Now if I use the static IP, my connecting devices are not assigned an IP. Do I need something like dnsmasq? How can my clients now receive an IP? I have the simple-node-server with hello world running on port 80.
So everyone who connects to the device should see on :80 the node server. Thanks!

I have used ipv4 connection shared and set the address1 and gateway to the same ip. It works. I have a problem with autoconnect=true. If I set autoconnect=true, the device won’t connect to the internet.


#8

@rquant, hi, I see that your question is from a few weeks ago, but in case you are still looking for solution, dnsmasq will serve that purpose indeed. This is how WiFi Connect works as well and those are the settings used there: https://github.com/resin-io/resin-wifi-connect/blob/master/src/dnsmasq.rs

WiFi Connect’s dnsmasq additionally acts as a DNS server, so according to your use case your configuration may need only the DHCP server part.