Pre-configuring a WiFi network on an emonPi2

As part of the pre-provisioned heat pump monitor bundles we are offering to pre-configure the WiFi network settings so that the emonHP connects automatically when powered up (one small configuration step to remove to make life simpler at the installation point).

I’ve added a new script to the new network module that uses NetworkManager to make this a little simpler.

1. Update to version 3.1.5 of the network module (this can be done from Admin > Components or via git command line).

2. Run the register_network script:

sudo /opt/emoncms/modules/network/register_network.sh

This will then prompt for the SSID and passkey and print out the connection file to give an oppertunity to check the settings:

pi@emonpi:~ $ sudo /opt/emoncms/modules/network/register_network.sh 
Enter the SSID: BTHub6-2CF3
Enter the PSK: 
Creating connection BTHub6-2CF3
No existing connection with SSID BTHub6-2CF3 found, continuing with creation
Connection 'BTHub6-2CF3' (667298f7-ea1a-45cb-b898-2bded9653da8) successfully added.
Connection BTHub6-2CF3 created successfully
[connection]
id=BTHub6-2CF3
uuid=667298f7-ea1a-45cb-b898-2bded9653da8
type=wifi
interface-name=wlan0

[wifi]
mode=infrastructure
ssid=BTHub6-2CF3

[wifi-security]
key-mgmt=wpa-psk
psk=PASSKEY_GOES_HERE

[ipv4]
method=auto

[ipv6]
addr-gen-mode=default
method=auto

[proxy]

This might be useful for anyone pre-preparing an emonPi2 or emonBase for an installation if you have those details before arriving on site.

Alternatively configuration via the WiFi access point is also pretty straight forward now.

1 Like

You think people should give their wifi credentials to the installers?