Main Site Documentation

First TinyCLR 1.0 preview


#22

SQLite is not currently available.


#23

you’re still around?! wow


#24

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


#25

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!!!


#26

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


#27

That will only make him worse :joy:


#28

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!


#29

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


#30

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


#31

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


#32

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


#33

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);

        }
    }
}

#34

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.


#35

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


#36

Thanks guys, I will wait until the next release.

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