@ Alex Bilityuk - That exception seems to imply you have the module connected in the Gadgeteer designer. If that is the case, you don’t need to construct it yourself.
@ Alex Bilityuk - It works the same as any other of our network modules. I believe you can call, if you connect it in the designer only, wifirs21.UseStaticIp(). Then take a look at the System.Http assembly.
@ Alex Bilityuk - CodeShare is a great thing as for example @ .Peter. has a working sample project in there that uses the wifi module with a Raptor https://www.ghielectronics.com/community/codeshare/entry/962 all the code you need is in there.
Thank you for reply guys! But i can’t set up the Access Point connection on this module. I need your help. There is no documentation for this wifi module acess point set up.
I am trying this code:
void ProgramStarted()
{
NetworkChange.NetworkAvailabilityChanged += (a, b) => Debug.Print(DateTime.Now + " Network availability = " + b.IsAvailable.ToString());
NetworkChange.NetworkAddressChanged += (a, b) => Debug.Print(DateTime.Now + " Network address change ");
WiFiRS9110.NetworkParameters ACCESSPOINT_PARAMS = new WiFiRS9110.NetworkParameters();
ACCESSPOINT_PARAMS.Channel=2;
ACCESSPOINT_PARAMS.Key = "MySecret";
ACCESSPOINT_PARAMS.Ssid = "RaptorBOT";
ACCESSPOINT_PARAMS.NetworkType = WiFiRS9110.NetworkType.AccessPoint;
ACCESSPOINT_PARAMS.SecurityMode = WiFiRS9110.SecurityMode.Wpa2;
wifiRS21.NetworkInterface.Open();
wifiRS21.UseThisNetworkInterface();
wifiRS21.NetworkInterface.EnableDhcp();
wifiRS21.NetworkInterface.EnableDynamicDns();
//Work As AP
wifiRS21.NetworkInterface.EnableStaticIP("192.168.0.65", "255.255.255.0", "192.168.0.65");
wifiRS21.NetworkInterface.StartAdHocNetwork(ACCESSPOINT_PARAMS);
// Waiting for an address
while (wifiRS21.NetworkInterface.IPAddress == "0.0.0.0")
{
Debug.Print(DateTime.Now + " Waiting for network address ...");
Thread.Sleep(250);
}
but on this line it throws exception: You must specify an Ad-hoc network type to create an Ad-hoc host
@ andre.m -
I want to set up the module in Access Point mode, not in Ad-Hoc mode. Because my android smartphone doesn’t use ad-hoc connection. After i would like to run http server on Raptor and handle robo commands from my smartphone.
I don’t need to connect to existing wlan…
Just help me please to set up this method:
WiFiRS9110.NetworkParameters ACCESSPOINT_PARAMS = new WiFiRS9110.NetworkParameters();
ACCESSPOINT_PARAMS.NetworkType = WiFiRS9110.NetworkType.AccessPoint;
GHI guys can confirm please does the RS 21 module support Acces Point mode or not? How to use it? There is no code working code samples…
wifiRS21.NetworkInterface.EnableDhcp();
wifiRS21.NetworkInterface.EnableDynamicDns();
//Work As AP
wifiRS21.NetworkInterface.EnableStaticIP("192.168.0.65", "255.255.255.0", "192.168.0.65");
wifiRS21.NetworkInterface.StartAdHocNetwork(ACCESSPOINT_PARAMS);
So for a start, simplify your code. In an Access Point scenario, you don’t enable DHCP or Dynamic DNS.
@ Brett -
Already tried to initialize it without dhcp and dynamic dns enabled. The same exception on this line it throws: You must specify an Ad-hoc network type to create an Ad-hoc host
@ John-
Hi, John! Can you reproduce my issue and share a working code sample of setting up the WIFI RS21 Module in Access Point mode. I really can’t find a solution, not in codeshare, not in google search.
It sounds very very bad for me! I’ve bought a lot of modules and Raptor for my project… This module is pretty expensive, and i learn that i am not able to use it in my project. Why do i need this module so? I have no idea… I am very upset.
@ Mike -
Thank you for advice, but it is not comfortable to place it on my chassis, it will take too much space i think and will need an additional power supply.
Is there any other embed wifi modules already tested on raptor and with an Access Point option and multiple socket connections?
I am using multiple ESP8266 modules in AP, client and AP+client modes. There are a bunch of them out there from getmolecule.net (Justin), from munderhill, and from Adafuit. They only require, at minimum, two UART lines, a GPIO for reset, 3v3 power and Gnd and they are cheap as dirt.
They use a serial AT protocol and I have published a library to nuget and github. They support up to five connections (client or server). No SSL though.
You may not recognise the subtle difference, but just because the hardware can support it doesn’t mean the vendor who sells it will support all features.
You say you are upset - what led you to believe that you could use the module in the way you intended ? Perhaps it’s your expectation that’s the challenge here.
further, the quoted specification only says it can become an AP to configure or upgrade firmware. it does no say it supports establishing a wifi network.
@ Alex Bilityuk - The other posters in the thread are correct. The module can be used to connect to another Access Point (AP) or it can create its own Ad Hoc network. NetworkType.AccessPoint and NetworkType.AdHoc are both returned when you call Scan and are used to signal which type of network was found. NetworkType.AdHoc can also be used when calling StartAdHocNetwork. We do not support the module acting as a true access point.