Send captured image to socket server

@ dobova - thanks, but it’s mainly the GHI driver of the RN171 Module.

Oh i didn’t even know that you familiar with RN-XV from A-Z )) Nice to meet you guru!!!
It sounds really good… do you mean that i can do firmware upgrade for my RX-XV Wifly module just directly from cerbuino bee mainboard??? Or i misunderstood you?Can you give me a hand with firmware upgrade. Where to download the latest version of firmware?I found a lot of files on ftp://rn.microchip.com/public/ . but how to know wich one is mine? thank you.

@ Alex Bilityuk - Yes, you can update the firmware with the module on your Cerbuino Bee.
Download my CodeShare Entry, set the proper #define directives in Program.cs and WiFi_RN171_Ro_43.cs
The program parts concerning the USB-Serial modul are optional. You can comment them out if you do not have an USB-Serial-Mudule.
Set
#define CerbuinoXBeeSocket
or
#define GhiRN171_OrXBeeAdapt_Module
Depending if you use the GHI-XBee Adapter Moduel or directly the XBee socket of the Cerbuino Bee
Then first select
#define WorkJoinedToNetwork
Set your credentials for your WLAN-Router (form me it worked with WPA2-PSK).
When you deploy, it should auomatically join your network.
When this works set
#define WorkJoinedToNetworkFirmwarUpdate
When you deploy, the programm automatically gets the latest firmware over the ftp-client oft he WiFly module and installs it automatically.

1 Like

Ok, i will let you know when i am done… Thank you!

The firmware cannot be updated manually (not easy), you need RoShmi driver or manual ftp cmd from WyFly command line.
FYI, The last fw is 4.41, filename is “wifly7-441.img” or .mif, or, better, the link to the last ver “wifly_EZX.img”

1 Like

Hi RoSchmi! I am using Xbee socket on cerbuino bee for connect to wifly, i have a problem on this line of code:


 #if CerbuinoXBeeSocket
                // Use Baudrate of 9600, 38400, 115200 or 230400. Note: 460800 did not work, 230400 not sure.
            wifi_RN171 = new WiFi_RN171(Reset, Reset, 115200, System.IO.Ports.Parity.None, WiFi_RN171.DebugMode.StandardDebug);
            #endif

trying to connect with different baudrates, but with no success. Here is debug output:

Hi, I’m not at home and can only answer from the smartphone.
Try first to use the baud rate and other serial port parameters which worked for you til now.

In my utility the baud rate is set in the constructor of the WiFi_RN171 Class

I never set the baud rate and serial parameters by myself. I don’t know wich one to set.
I dig into your code and found that the default serial port for cerbuino bee is COM1.
Should i use another one? How to check wich serial port is used with exbee socket?I tried to set different baud rates in this line of code, but with no success:


 #if CerbuinoXBeeSocket
                // Use Baudrate of 9600, 38400, 115200 or 230400. Note: 460800 did not work, 230400 not sure.
            wifi_RN171 = new WiFi_RN171(Reset, Reset, 9600, System.IO.Ports.Parity.None, WiFi_RN171.DebugMode.StandardDebug);
            #endif

It must be COM1! Look in the code you used successfully before how the baudrate and other parameters are set. These parameters should work in my app too

Here is a parameters of toolbox WiFlyGSX driver and it works well when wifly join the home network:


public WiFlyGSX(string PortName = "COM1", int BaudRate = 9600, string CommandChar = "$", bool DebugMode = false);

When i am trying to use the same parameters in your application it doesn’t work:


wifi_RN171 = new WiFi_RN171(Reset, Reset, 9600, System.IO.Ports.Parity.None, WiFi_RN171.DebugMode.StandardDebug);

I so not know why. Can You show the code line of toolbox where the serial port is initialized

Yes sure:


public WiFlyGSX _wifi = new WiFlyGSX();
 void ProgramStarted()
        {
            _wifi.EnableStaticIP("192.168.0.62", "255.255.255.0", "192.168.0.1", "192.168.0.1");

            _wifi.JoinNetwork("BilityukA", 0, WiFlyGSX.AuthMode.WPA2_PSK, "New999manAlex");
        }

Here is JoinNetwork method from toolbox, but i can’t see a serialport initialization. It seems like WiFlyGSX doesn’t use a serial port at all:


namespace Toolbox.NETMF.Hardware
{
    public class WiFlyGSX : IDisposable
    {
        public WiFlyGSX(string PortName = "COM1", int BaudRate = 9600, string CommandChar = "$", bool DebugMode = false);

        public bool DebugMode { get; set; }
        public string LocalIP { get; }
        public string MacAddress { get; protected set; }
        public string ModuleVersion { get; protected set; }
        public string RemoteHostname { get; protected set; }
        public ushort RemotePort { get; protected set; }
        public uint SocketBufferLength { get; }
        public bool SocketConnected { get; }

        public event Toolbox.NETMF.Tools.StringEventHandler DebugReceived;

        public void CloseSocket();
        public void Dispose();
        public string DnsLookup(string Hostname);
        public void EnableDHCP();
        public void EnableStaticIP(string IPAddress, string SubnetMask, string Gateway, string DNS);
        public void JoinNetwork(string SSID, int Channel = 0, WiFlyGSX.AuthMode Authentication = WiFlyGSX.AuthMode.Open, string Key = "", int KeyIndex = 1);
        public double NtpLookup(string IpAddress, ushort Port = 123);
        public void OpenSocket(string Hostname, ushort Port, int Timeout = 5000);
        public string SocketRead(int Length = -1, string UntilReached = "");
        public void SocketWrite(string WriteBuffer);

        public enum AuthMode
        {
            Open = 0,
            WEP_128 = 1,
            WPA1 = 2,
            MixedWPA1_WPA2 = 3,
            WPA2_PSK = 4,
        }
    }
}

Here is a code line from your project that doesn’t work for me and i don’t know why?It just iterates through all kind of baud rates and cant connect. Also it doesn’t throw any exception.


 #if CerbuinoXBeeSocket
            private void Complete_Common_Constructor(int baudrate)    // Common part of constructor
            {
                _wifly = new SerialPort("COM1", baudrate, Parity.None, 8, StopBits.One);

        #endif

Then the Code where COM1 of Cerbuino is intislized must be in your program, e.g. ProgramStarted.cs My program just tries to find the settings the RN171 actually has. When it found These settings it can communicate with RN171

In WiFlyGSX try to set debugmode to true, run it and. Then try my program

Another idea. Try to access the RN171 vla teraterm telnet client port 2000

RoSchmi, can you explain please what do you mean by “code where COM1 of Cerbuino is initialized must be in your program”. I am using your project from codeshare the code where COM1 initializing already in the ProgramStarted.cs. Here is a COM1 trying to initialize:


 #if CerbuinoXBeeSocket
                // Use Baudrate of 9600, 38400, 115200 or 230400. Note: 460800 did not work, 230400 not sure.
            wifi_RN171 = new WiFi_RN171(Reset, Reset, 9600, System.IO.Ports.Parity.None, WiFi_RN171.DebugMode.StandardDebug);
           
            #endif

Already tried. with no success.

When i open a tera term my serial port option is not active (picture attached)… how to access Wifly with tera term???

Maybe the problem in that i am using a usb cable to connect to Cerbuino bee mainboard, but for you driver i shoul use serial cable?? Correct me if i am wrong please…

think the reason why my program does not work is that the RN171 is programmed to a mode not to give answers on commands over the serial port (Command: Set sys printlvl xx). So it gets no answers and always assumes that the selected baud rate does not work. You can try to remove this part from my driver an just take 9600.
For the try with telnet join network with the toolbox program, try to ping, then try teraterm telnet but port 2000, not 23. When connected type $$$ to enter Command mode

1 Like

:smiley: I was able to set up ad-hoc connection. Does anybody can help me to upgrade firmware using ad-hoc connection please?

RoSchmi, i commented out this lines: Set sys printlvl , but still can’t update firmware.
I tried to join network with toolbox driver and tried a telnet on 2000 port but it doen’t return a “HELLO” as expected. Then i booted a WiFly in ad-hoc connection mode and i could setup a terra term. Now i am stuck with manually update a firmware using a tera term…

After you entered command mode with $$$ type get everything to see and show the actual settings

1 Like