# Create WiFi Hotspot fails with error

**URL:** <https://forums.balena.io/t/create-wifi-hotspot-fails-with-error/5498>\
**Category:** balenaOS\
**Created:** [March 1, 2019, 8:38am UTC](https://forums.balena.io/t/create-wifi-hotspot-fails-with-error/5498 "2019-03-01T08:38:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![UncleSam](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/unclesam/32/965_2.png) [@UncleSam](https://forums.balena.io/u/UncleSam)\
**Post date:** [March 1, 2019, 8:38am UTC](https://forums.balena.io/t/create-wifi-hotspot-fails-with-error/5498/1 "2019-03-01T08:38:22Z")

</div>

We are implementing something similar to [WiFi-Connect](https://github.com/balena-io/wifi-connect/) but using .NET and in a multi-container application. I’ve been able to send a few DBus queries using Tmds.DBus.

Unfortunately when I try to send an “AddAndActivateConnection” (similar to what WiFi-Connect does) I get the following error:

```
org.freedesktop.NetworkManager.Device.InvalidConnection:
A 'wireless' setting is required if no AP path was given.

```

Am I missing something in the request or is there any prerequisite I haven’t figured out yet?

I know, this is probably not directly related to Balena, but I was hoping you could help as all of the Rust code related to WiFi-Connect seems to come from you.

My call to AddAndActivateConnection looks as follows:

```
var wireless = new Dictionary<string, object>();
wireless["ssid"] = Encoding.ASCII.GetBytes(ssid);
wireless["band"] = "bg";
wireless["hidden"] = false;
wireless["mode"] = "ap";

var connection = new Dictionary<string, object>();
connection["autoconnect"] = false;
connection["id"] = ssid;
connection["interface-name"] = "wlan0";
connection["type"] = "802-11-wireless";

var addressData = new Dictionary<string, object>();
addressData["address"] = "192.168.111.1";
addressData["prefix"] = 24u;

var ipv4 = new Dictionary<string, object>();
ipv4["method"] = "manual";
ipv4["address-data"] = addressData;

var settings = new Dictionary<string, IDictionary<string, object>>();
settings["802-11-wireless"] = wireless;
settings["connection"] = connection;
settings["ipv4"] = ipv4;

await this.networkManager.AddAndActivateConnectionAsync(settings, device.ObjectPath, "/");
```
