First TinyCLR 1.0 preview

SQLite is not currently available.

you’re still around?! wow

I was thinking the same about you, I guess your muzzle has been removed :rofl:

I thought I had blocked you enough for you to get hint! hahahahaha

yep, I figured out a way to unlock my account, so Gus can no longer keep me silent!!!

What do I have to do to keep you quiet? Ship you down under?

That will only make him worse :joy:

yeah, would you really want him in a different timezone, he could post when you northern hemisphere people were asleep - could work out much worse!

1 Like

He sleeps all day! Going there will put him in the “Gary time zone”

2 Likes

Thanks.
So I need keeping on using dot net micro framework on G400D.

If you still want to do graphics etc, best to stay with NETMF for now. In the same boat here. :slight_smile:

Database searching on GHI.SQLite is crucial for my projects.

I am getting the following error An unhandled exception of type ‘System.OutOfMemoryException’ occurred in GHIElectronics.TinyCLR.Devices.Uart.dll on my BrainPad upgraded to TinyCLR 1.0 preview when trying to communicate with an esp8266 module using the following code. What am I missing?

using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Pins;
using System.Diagnostics;
using System.Text;
using System.Threading;

namespace TinyCLRApplication1
{
    internal class Program
    {
      
        private static void Main()
        {

            string ssid = "MOTOROLA-3258C"; string password = "0661c66a03810b23b5b1";

          
            GHIElectronics.TinyCLR.BrainPad.Expansion.UartPortDef uart = new GHIElectronics.TinyCLR.BrainPad.Expansion.UartPortDef();

            GHIElectronics.TinyCLR.Devices.Uart.UartController uartController = GHIElectronics.TinyCLR.Devices.Uart.UartController.FromName(uart.Id);
            uartController.ReadBufferSize = uartController.WriteBufferSize = 2048;
            uartController.SetActiveSettings(115200, 8, GHIElectronics.TinyCLR.Devices.Uart.UartParity.None,
                GHIElectronics.TinyCLR.Devices.Uart.UartStopBitCount.One,
                GHIElectronics.TinyCLR.Devices.Uart.UartHandshake.None);
       
            

            GpioController gpioController = GpioController.GetDefault();
            GpioPin enablePin = gpioController.OpenPin(BrainPad.Expansion.GpioPin.Cs);
            enablePin.SetDriveMode(GpioPinDriveMode.Output);
            enablePin.Write(GpioPinValue.Low);

            Thread.Sleep(200);
            enablePin.Write(GpioPinValue.High);
            Thread.Sleep(200);


            uartController.Enable();
            uartController.DataReceived += UartController_DataReceived;

            uartController.Write(System.Text.UTF8Encoding.UTF8.GetBytes("AT"));
            uartController.Flush();
            
            Thread.Sleep(1000);
            uartController.Write(System.Text.UTF8Encoding.UTF8.GetBytes("AT+CWMODE_DEF=1"));
            uartController.Flush();
               Thread.Sleep(1000);
            uartController.Write(System.Text.UTF8Encoding.UTF8.GetBytes($"AT+CWJAP_DEF=\"{ssid}\",\"{password}\""));
            uartController.Flush();
         

         
            Thread.Sleep(Timeout.Infinite);
        }

        private static void UartController_DataReceived(GHIElectronics.TinyCLR.Devices.Uart.UartController sender, GHIElectronics.TinyCLR.Devices.Uart.DataReceivedEventArgs e)
        {
            byte[] bytes = new byte[sender.BytesToRead];
            sender.Read(bytes);
            string str = UTF8Encoding.UTF8.GetString(bytes);
            Debug.WriteLine(str);

        }
    }
}

We completely reworked uart in this release which caused a memory leak. The coming release is all about bug fixes. I think this is already in the release notes.

How about 1024? Although 2048 is not large but because memory fragment which also throw out of memory exception on small devices.

1 Like

Thanks guys, I will wait until the next release.

@Dat_Tran - Both the defaults and any other values throw the exception.