Some Qs about Pi3 AP config and I think a docs update that is needed

raspberrypi3
wifi
resinos

#1

Hi all

I was trying to do what looked to be trivial with network manager but turned out not to be. In brief, I couldn’t get the docs given AP config to work but managed by basically copying a config from a working Ubuntu Server Pi3 setup/trial and error. But so I’m not actually sure what setting exactly did it - anyone able to advise for future reference?

Docs version is here - AP just never came up
The only actual differences in what I have actually working are:

  1. I named the file to correspond to ID and SSID (all identical). I think this might actually be it so docs should be updated cause they say the opposite right now.
  2. [wifi] I removed line 11:
    band=bg
  3. [ipv4] I manually specified:
    address1=10.42.1.1/24
  4. [ipv6] I disabled:
    ip6-privacy=0
    method=ignore
  5. I obv changed UUID to correct value

Linked questions

  • Is there a way to update the network config via resin cml?
  • And/or how could I configure multiple images with unique SSIDs and this network config automatically?

#4

Hello! I also have been unable to get the hotspot working according to the documentation. Could you please post your working example, in full, except with the UUID, SSID and PSK changed (of course)?

Re updating network config: I don’t see a way to update network configuration using the resin CLI.
Personally, I doubt such a feature exists, as the tool uses the network to access the target device, hence such a feature would give the user a way to create a problem using the resin CLI that they could not solve using the resin CLI.

Re configuring images: the only way I see to customise images is to download a non-customised image of the correct architecture and device type from the resin.io web site, then modify it locally. If you examine the image using ‘fdisk’, you will see the offsets of the various partitions within it. You can then loopback mount partitions and modify them to your heart’s content, using commands of the form: mount -o loopback,offset=12345 /path/to/my/image_file.img /some/mount/point.

Hope this helps!


#5

@whjehjehjej

For sure, really hope the admins comment and they update the docs but this is working for me with the filed named MYSSID. Other thing that might have cause problems: I didn’t have the dashed UUID originally, and I also found sometimes my new network config didn’t get loaded (guessing becuase it had errors but unknown) - so I started just reflashing the whole image and then uploading new network config to guarantee new config was at least tried.

I should say this is on a Pi3

[connection]
id=MYSSID
uuid=0c5afcca-bc11-78f1-15d0-48f239e05c24
type=wifi
permissions=
secondaries=

[wifi]
mac-address-blacklist=
mac-address-randomization=0
mode=ap
seen-bssids=
ssid=MYSSID

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

[ipv4]
address1=10.42.1.1/24
dns-search=
method=shared

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=ignore

FWIW in ubuntu 18 all the partitions on the sd card (after image flashed) just mount right up into my FS and I can edit directly without any custom mounting.


#6

@r4space Hi, I have some suggestions regarding your AP use-case.

  1. Since you would like to have a unique SSID per device, then I would suggest to create the AP dynamically from your container. This way you may use characters of RESIN_DEVICE_UUID as a SSID suffix for example.
  2. Quite often an access point will need DHCP and DNS enabled so that connected station devices can obtain IP address. DNS can be hijacked as WiFi Connect does so that all requests are directed to the IP of the access point: https://github.com/resin-io/resin-wifi-connect/blob/master/src/dnsmasq.rs
  3. Please check the source code of WiFi Connect sub-library to see how the AP is created there: https://github.com/resin-io-modules/network-manager/blob/master/src/dbus_nm.rs#L274

What is the main programming language that you use in your application. Asking because I could give you recommendation for a library that you can use for accessing the NetworkManager’s D-Bus API.

Please let me know if you have any questions or difficulties with setting up the hotspot.