Release 2 RPi 3B+ lep command

I’ve wrote a C# console app and run it with mono on RPi 3B+ with Release 1 and connect a listener to USB of RPi. The application works 100%, but after I’ve upgraded all MDEK1001 tags/anchors with release 2, my program don’t read any data from the listener anymore.

I test the system using Tera Term - I’ve receive the positions of the tags.
It works 100% on the Android RTLS Program

(I didn’t install the new software for Raspberry Pi, because I don’t need a gateway at this moment.)

What has changed with the new R2 and is there any other commands I must send to the listener to receive data from the listener? Maybe timing?

Here is the code to get the data in C#:
//Open the Port
mySerialPort.Open();
if (mySerialPort.IsOpen)
{
//Clear the buffers
mySerialPort.DiscardOutBuffer();
mySerialPort.DiscardInBuffer();

                Console.WriteLine(mySerialPort.PortName + " is Open");
                Console.WriteLine("Trying to open dwm> cursor...");

                char[] data = new char[] { '\r' };
                mySerialPort.Write(data, 0, data.Length);
                Thread.Sleep(100);
                mySerialPort.Write(data, 0, data.Length);
                Thread.Sleep(100);

                Console.WriteLine("Sending 'lep' command...");

                mySerialPort.Write("l");
                Thread.Sleep(10);
                mySerialPort.Write("e");
                Thread.Sleep(10);
                mySerialPort.Write("p");
                Thread.Sleep(10);
                mySerialPort.Write(data, 0, data.Length);
                Thread.Sleep(10);

                Console.WriteLine("lep" command send");

                //Print whatever is received from Port
                Console.WriteLine(mySerialPort.ReadLine().ToString());

                while (mySerialPort.IsOpen)
                {
                    char[] data_recieved = mySerialPort.ReadLine().ToArray();

                    //Run the DataReceived Fuction
                    DataRecieved(data_recieved);
                }

Please Help!

As I mentioned before, I went the same route and wrote C# application that does exactly that, with some caveats…It works well on Win10 and Win7 but does not work on Raspi with Mono. The problem is establishing serial or using correct port, I believe. The caveat on Windows is that you need to reset your system and re-plug the USB cable and then connect once to the board with TeraTerm, then dismiss TeraTerm window. Anyway, it is a bit flakey.

I absolutely must get the data on Raspi so running my C# client on Windows is not acceptable. Therefore, I went to another solution: I put together a Python scrip that works well on Raspi and then incorporated into it Paho MQTT Client so now the data I get in the script goes well into Mosquitto Broker on Raspi. I also write a rudimentary C# MQTT client on Win10 that now subscribes to the topic and gets all the data.

Anyway, my conclusion is that something is really broken with serial and also with the connection between dwm-proxy and MQTT broker…or mis-configured from the get go…

BTW, you don’t have to write to serial port byte by byte: with the right Encoding you can wright strings and “\r\n” sequences without problem.

My next step is to figure out how to get custom data from the board - not just positioning. I tried Segger Tool Chain and it reminded me why I did not get into firmware business :wink:

The best part is that now I can do real analysis on the accuracy data that I get - so the big beautiful C# client is due :wink:

HI securigy2

I’ve got t working again - his time I play around with the timing delay.

(Please note: Don’t use the DataReceived event e.g. mySerialPort.DataReceived += MySerialPort_DataReceived. I don’t work with mono).

Here is the code that work in C#:

            //Open the Port
            mySerialPort.Open();
            if (mySerialPort.IsOpen)
            {
                //Clear the buffers
                mySerialPort.DiscardOutBuffer();
                mySerialPort.DiscardInBuffer();


                Console.WriteLine(mySerialPort.PortName + " is Open");
                Console.WriteLine("Trying to open dwm> cursor...");

                char[] data = new char[] { '\r' };
                mySerialPort.Write(data, 0, data.Length);
                Thread.Sleep(100);
                mySerialPort.Write(data, 0, data.Length);
                Thread.Sleep(1000);

                Console.WriteLine("Sending 'lep' command...");

                mySerialPort.Write("l");
                Thread.Sleep(10);
                mySerialPort.Write("e");
                Thread.Sleep(10);
                mySerialPort.Write("p");
                Thread.Sleep(10);
                mySerialPort.Write(data, 0, data.Length);
                Thread.Sleep(1000);

                Console.WriteLine("lep command send");
                while (mySerialPort.IsOpen)
                {
                    char[] data_recieved = mySerialPort.ReadLine().ToArray();

                    DataRecieved(data_recieved);
                }

Hi Izak,

when sending commands to the module make sure you keep some delay between the characters (e.g. 10 ms) to ensure the on-module Shell would process all the characters.

Cheers,
TDK