Basics RN171 + FezCerbot

Hello, im all new to server/client communication and to gadgeteer, could someone give a simple example of how communication could be established using wifi RN171 on FezCerbot with a laptop. Either the server side on the laptop and the client on cerbot or vice versa would do. A simple example of server and client sending each other strings. Ive tried looking around forums, but cant seem to find anything simple.
Im using:
Wifi Rn171
FezCerbot 1.3
vs2013
.NET Micro Framework SDK 4.3

@ Martizs - HI, welcome to the forum,
in this Codeshare contribution you should find what you need.
https://www.ghielectronics.com/community/codeshare/entry/927
I would use the cerbot as Access Point with an http Server and the PC as http Client.
Kind Regards
RoSchmi

I’ve already tried this project and i seem to get the following errors atached as pictures. I also add my gadgeteer diagram maybe something is wrong there? Though the errors are the same if i attach the xbee adapter or not.

1 Like

Hi,

  1. the warnings that the objects are obsolete can be ignored.
  2. did you activate the right #define directives in Program.cs and WiFi_RN171_Ro_43.cs ?
  3. the warnings can be ignored
  4. The WiFiRN171 Module and the XBee-Adapter Module may not be added and connected in the designer as there is already the Driver Class in the Project
  5. If you want to use the RN171 Module on Socket 5 you have to exchange the argument für the socket parameter from 2 to 5 when calling the constructor of the WiFi_RN171_Ro_43.cs Class

@ Martizs -
I just got it working on the Cerbot Socket 5.
use this constructor:


wifi_RN171 = new WiFi_RN171(5, 38400, GTI.SerialParity.None, GTI.HardwareFlowControl.NotRequired);

The #define directives in Program.cs and the Driver must be set to:
#define GhiRN171_OrXBeeAdapt_Module

I just saw that there is a new Firmware Version 4.75 and I deployed it to the module. I hope this firmware will finally work without issues.

You will propably have an old firmware on your module which will not work with EncryptionMode.WPA2_PSK.
So you will have to make your router EncryptionMode.open for a time and update to the latest Firmware as shown in my utility.
First connect to your Network with:
#define WorkJoinedToNetwork
then use the option
#define WorkJoinedToNetworkFirmwarUpdate
to update the firmware

Alright so i did what you said the project works fine, but it seems that there’s an empty response(Link1), maybe i updated the firmware incorrectly because this is what fez config finds after i did the update(Link2), or maybe im using the http client incorectly, the error count in the error box increases, but there’s no error output in the error text box(Link3). Also when pinging the ip(192.168.1.1) on cmd i do get a response.

  1. Screenshot - a5a2e2f675382529004a15045c986d4d - Gyazo
  2. Screenshot - 17557177420b6aa5954aa8dba1584dc6 - Gyazo
  3. Screenshot - e19d3923e104921864b3f8147490b9ac - Gyazo
1 Like

I think that my explantation was not clear enough, concerning the Firmware update. I meant the firmware of the RN171 module, not the firmware of the Cerbot. This Firmware can be updated over the Internet, when you activate the right define directive in my utility:
#define WorkJoinedToNetworkFirmwarUpdate
if you activate this function the Firmware is automatically updated.


 #if WorkJoinedToNetworkFirmwarUpdate
                wifi_RN171._Command_Mode_Start();
                wifi_RN171._Command_Execute("set ftp address 198.175.253.161");
                wifi_RN171._Command_Execute("save");
                wifi_RN171._Command_Mode_Exit();
                wifi_RN171.Reboot();
                bool ActionResult = wifi_RN171.JoinWirelessNetwork("mySSID", "myPassword", 0, Gadgeteer.Modules.RoSchmi.WiFi_RN171.WirelessEncryptionMode.WPA2_PSK, "2000");
                wifi_RN171.UpdateFirmware("wifly7-441.mif");
            #endif

Exchange (“wifly7-441.mif”) against (“wifly7-474.mif”) for the latest Firmware.

In the httpClient I think as remote ip you have set the remote Ip of your router, not the IP which the RN 171 got over DHCP.
first activate the #define directive:
#define WorkJoinedToNetwork
include the credentials of your WLAN in the program and deploy the program.
You should see the assigned IP Adress in the Visual Studio Output Window.

Edit: To get it working I suspect that you have firstly set your WLAN Router to open (no encryption) and adjust the code in my Utility to open Network ( WiFi_RN171.WirelessEncryptionMode.Open ).

Edit: Exchange (“wifly7-441.mif”) against (“wifly7-475.mif”) for the latest Firmware.