Author: acassis

Do you know what is Zahn cup?

Zahn cup is used to measure the viscosity of some liquid, such as offset press’ ink.

A quick wikipedia search revels that it follows the ASTM D 4212, ASTM D1084 and ASTM D816 standards. But there is not much information about its origins, etc

Installing e-CNPJ A1 certificates on Linux

Export the Private Key

$ openssl pkcs12 -in KEENIX_CONSULT_NEW_CERT1000406015.pfx -nocerts -out KEENIX_CONSULT_NEW_CERT1000406015.pem -nodes
Enter Import Password:

Export the Certificate

$ openssl pkcs12 -in KEENIX_CONSULT_NEW_CERT1000406015.pfx -nokeys -out KEENIX_CONSULT_NEW_CERT1000406015.crt -nodes
Enter Import Password:

Import Root Certificate

$ sudo cp KEENIX_CONSULT_NEW_CERT1000406015.crt /usr/local/share/ca-certificates/
$ sudo update-ca-certificates
Updating certificates in /etc/ssl/certs…
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d…
done.

In the browser you need to install the Lacuna Software The Web PKI

Source: https://helloitsliam.com/2016/03/30/installing-certificate-pfx-into-debian-linux/

About semaphores and mutexes on NuttX

“Semaphores/mutexes should never be used before nxsem_initialize() is called. Otherwise you would be using the semaphore subsystem before it has been initialized.. So either (1) up_nputs() must not use semaphores or (2) up_nputs() must not be used prior to calling nxsem_initialize(). There is a global variable g_nx_init_state that can also be used to check where nx_start is in the initialization sequence.”

“As a general rule, we should not use semaphores or mutexes on the IDLE thread. The IDLE thread is the thread that runs when you boot up the system. All initialization is performed on the IDLE thread, hence, it is sometimes called the initialization thread.”

These are Gregory Nutt’s comments from: https://github.com/apache/nuttx/pull/9404

Deploying a CSharp .NET application on Meadow board

You need to follow these steps:

Create a sample example dir:

$ mkdir Blink
$ cd Blink

Create a template to use as base:

$ dotnet new -i WildernessLabs.Meadow.Template
$ dotnet new Meadow

Build it:

$ dotnet build

Deploy the application in the board:

$ meadow app deploy -f obj/Debug/netstandard2.1/App.dll -s /dev/ttyACM0

Connecting to Meadow on /dev/ttyACM0

Downloading version file for Meadow OS 1.0.1.5

Meadow OS 1.0.1.5 cannot be downloaded or is not available
Meadow StdInfo: Mono is disabled
Meadow StdInfo: dev/
Meadow StdInfo: little0 [block]
Meadow StdInfo: little0p0 [block]
Meadow StdInfo: monostderr [char]
Meadow StdInfo: monostdout [char]
Meadow StdInfo: mtdblock0 [block]
Meadow StdInfo: null [char]
Meadow StdInfo: nxupd [char]
Meadow StdInfo: pwm0 [char]
Meadow StdInfo: ramlog [char]
Meadow StdInfo: random [char]
Meadow StdInfo: ttyACM0 [char]
Meadow StdInfo: ttyS0 [char]
Meadow StdInfo: ttyS1 [char]
Meadow StdInfo: ttyS2 [char]
Meadow StdInfo: tun [char]
Meadow StdInfo: upd [char]
Meadow StdInfo: urandom [char]
Meadow StdInfo: usrsock [char]
Meadow StdInfo: meadow0/
Meadow StdInfo: ./
Meadow StdInfo: ../
Meadow StdInfo: meadow.log [file]
Meadow StdInfo: dns.conf [file]
Meadow StdInfo: Meadow.OS.Runtime.bin [file]
Meadow StdInfo: var/
Meadow StdInfo: mqueue/
Meadow StdInfo: Esp32Events [char]
Meadow StdInfo: Esp32Requests [char]
Meadow StdInfo: IncomingEvents [char]
Found meadow.log (CRC: 2471262712)

Found dns.conf (CRC: 2979744109)

Found Meadow.OS.Runtime.bin (CRC: 3338498311)

Trimming assemblies to reduce size (may take several seconds)...
StandardOutput Contains: ILLink: error IL1012: IL Linker has encountered an unexpected error. Please report the issue at https://github.com/mono/linker/issues

StandardError Contains: Fatal error in IL Linker
Unhandled exception. Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: '/WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/prelink_bin/Meadow.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
 ---> System.IO.FileNotFoundException: Unable to find '/WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/prelink_bin/Meadow.dll.dll' or '/WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/prelink_bin/Meadow.dll.exe' file
   at Mono.Linker.DirectoryAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters) in /Users/lexas/linker/src/linker/Linker/DirectoryAssemblyResolver.cs:line 88
   at Mono.Linker.AssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters) in /Users/lexas/linker/src/linker/Linker/AssemblyResolver.cs:line 138
   at Mono.Linker.LinkContext.Resolve(IMetadataScope scope) in /Users/lexas/linker/src/linker/Linker/LinkContext.cs:line 315
   at Mono.Linker.LinkContext.Resolve(String name) in /Users/lexas/linker/src/linker/Linker/LinkContext.cs:line 308
   at Mono.Linker.Steps.ResolveFromAssemblyStep.Process() in /Users/lexas/linker/src/linker/Linker.Steps/ResolveFromAssemblyStep.cs:line 68
   at Mono.Linker.Steps.BaseStep.Process(LinkContext context) in /Users/lexas/linker/src/linker/Linker.Steps/BaseStep.cs:line 60
   at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) in /Users/lexas/linker/src/linker/Linker/Pipeline.cs:line 135
   at Mono.Linker.Pipeline.Process(LinkContext context) in /Users/lexas/linker/src/linker/Linker/Pipeline.cs:line 128
   at Mono.Linker.Driver.Run(ILogger customLogger) in /Users/lexas/linker/src/linker/Linker/Driver.cs:line 755
   at Mono.Linker.Driver.Main(String[] args) in /Users/lexas/linker/src/linker/Linker/Driver.cs:line 64

Trimming failed - ILLinker execution error!
Exit Code: 134
Meadow StdInfo: Meadow successfully deleted '/meadow0/meadow.log'
Removing file: FileData { FullPath = /meadow0/meadow.log, FileName = meadow.log, Crc = 2471262712, FileSize = 113 }

Meadow StdInfo: Meadow successfully deleted '/meadow0/dns.conf'
Removing file: FileData { FullPath = /meadow0/dns.conf, FileName = dns.conf, Crc = 2979744109, FileSize = 19 }

Meadow StdInfo: Meadow successfully deleted '/meadow0/Meadow.OS.Runtime.bin'
Removing file: FileData { FullPath = /meadow0/Meadow.OS.Runtime.bin, FileName = Meadow.OS.Runtime.bin, Crc = 3338498311, FileSize = 3145728 }


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/App.pdb

Starting File Transfer... 
 
Meadow StdInfo: File 82% downloaded
Meadow StdInfo: Download of 'App.pdb' success (checksums calculated:0x4A2DD979, expected:0x4A2DD979)

Transfer Complete, wrote 9876 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs

Starting File Transfer... 
 
Meadow StdInfo: Download of '.NETStandard,Version=v2.1.AssemblyAttributes.cs' success (checksums calculated:0xA8DAE459, expected:0xA8DAE459)

Transfer Complete, wrote 204 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.AssemblyInfoInputs.cache

Starting File Transfer... 
 
Meadow StdInfo: Download of 'Blinky.AssemblyInfoInputs.cache' success (checksums calculated:0xF92F72A4, expected:0xF92F72A4)

Transfer Complete, wrote 41 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.csproj.AssemblyReference.cache

Starting File Transfer... 
 
Meadow StdInfo: File 12% downloaded
Meadow StdInfo: File 25% downloaded
Meadow StdInfo: File 38% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 63% downloaded
Meadow StdInfo: File 76% downloaded
Meadow StdInfo: File 88% downloaded
Meadow StdInfo: Download of 'Blinky.csproj.AssemblyReference.cache' success (checksums calculated:0x8A0CF2A6, expected:0x8A0CF2A6)

Transfer Complete, wrote 64504 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.csproj.CoreCompileInputs.cache

Starting File Transfer... 
 
Meadow StdInfo: Download of 'Blinky.csproj.CoreCompileInputs.cache' success (checksums calculated:0xE08CCC78, expected:0xE08CCC78)

Transfer Complete, wrote 41 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.AssemblyInfo.cs

Starting File Transfer... 
 
Meadow StdInfo: Download of 'Blinky.AssemblyInfo.cs' success (checksums calculated:0x8E9F3F93, expected:0x8E9F3F93)

Transfer Complete, wrote 920 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.csproj.CopyComplete

Starting File Transfer... 
 
Meadow StdInfo: Download of 'Blinky.csproj.CopyComplete' success (checksums calculated:0x00000000, expected:0x00000000)

Transfer Complete, wrote 0 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.csproj.FileListAbsolute.txt

Starting File Transfer... 
 
Meadow StdInfo: Download of 'Blinky.csproj.FileListAbsolute.txt' success (checksums calculated:0xE81D6A60, expected:0xE81D6A60)

Transfer Complete, wrote 4892 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.assets.cache

Starting File Transfer... 
 
Meadow StdInfo: File 39% downloaded
Meadow StdInfo: File 79% downloaded
Meadow StdInfo: Download of 'Blinky.assets.cache' success (checksums calculated:0x235542E4, expected:0x235542E4)

Transfer Complete, wrote 20668 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/App.exe

Starting File Transfer... 
 
Meadow StdInfo: Download of 'App.exe' success (checksums calculated:0x410328B0, expected:0x410328B0)

Transfer Complete, wrote 5632 bytes to Meadow


Sending file: /WildernessLabs/MeadowNew/Blinky/obj/Debug/netstandard2.1/Blinky.GeneratedMSBuildEditorConfig.editorconfig

Starting File Transfer... 
 
Meadow StdInfo: Download of 'Blinky.GeneratedMSBuildEditorConfig.editorconfig' success (checksums calculated:0x867AA32C, expected:0x867AA32C)

Transfer Complete, wrote 145 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/netstandard.dll

Starting File Transfer... 
 
Meadow StdInfo: File 18% downloaded
Meadow StdInfo: File 27% downloaded
Meadow StdInfo: File 36% downloaded
Meadow StdInfo: File 45% downloaded
Meadow StdInfo: File 54% downloaded
Meadow StdInfo: File 63% downloaded
Meadow StdInfo: File 72% downloaded
Meadow StdInfo: File 81% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'netstandard.dll' success (checksums calculated:0x75D657A9, expected:0x75D657A9)

Transfer Complete, wrote 90624 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/mscorlib.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'mscorlib.dll' success (checksums calculated:0x0A80F2EA, expected:0x0A80F2EA)

Transfer Complete, wrote 4637696 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Core.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
	Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Core.dll' success (checksums calculated:0xD8E83541, expected:0xD8E83541)

Transfer Complete, wrote 1086976 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.dll' success (checksums calculated:0x20981078, expected:0x20981078)

Transfer Complete, wrote 2533376 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/Mono.Security.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 51% downloaded
Meadow StdInfo: File 61% downloaded
Meadow StdInfo: File 71% downloaded
Meadow StdInfo: File 81% downloaded
Meadow StdInfo: File 92% downloaded
Meadow StdInfo: Download of 'Mono.Security.dll' success (checksums calculated:0x7D6EDA80, expected:0x7D6EDA80)

Transfer Complete, wrote 240128 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Configuration.dll

Starting File Transfer... 
 
Meadow StdInfo: File 13% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 33% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 53% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 73% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 93% downloaded
Meadow StdInfo: Download of 'System.Configuration.dll' success (checksums calculated:0x5AD2D54B, expected:0x5AD2D54B)

Transfer Complete, wrote 122880 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Xml.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Xml.dll' success (checksums calculated:0x599B4D77, expected:0x599B4D77)

Transfer Complete, wrote 3174400 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Security.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 21% downloaded
Meadow StdInfo: File 31% downloaded
Meadow StdInfo: File 42% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 61% downloaded
Meadow StdInfo: File 71% downloaded
Meadow StdInfo: File 82% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Security.dll' success (checksums calculated:0xF298AF19, expected:0xF298AF19)

Transfer Complete, wrote 308224 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Numerics.dll

Starting File Transfer... 
 
Meadow StdInfo: File 13% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 34% downloaded
Meadow StdInfo: File 41% downloaded
Meadow StdInfo: File 54% downloaded
Meadow StdInfo: File 61% downloaded
Meadow StdInfo: File 75% downloaded
Meadow StdInfo: File 82% downloaded
Meadow StdInfo: File 95% downloaded
Meadow StdInfo: Download of 'System.Numerics.dll' success (checksums calculated:0xB48B96DE, expected:0xB48B96DE)

Transfer Complete, wrote 119808 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Data.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Data.dll' success (checksums calculated:0xA7C91DBD, expected:0xA7C91DBD)

Transfer Complete, wrote 2102272 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Transactions.dll

Starting File Transfer... 
 
Meadow StdInfo: File 23% downloaded
Meadow StdInfo: File 47% downloaded
Meadow StdInfo: File 71% downloaded
Meadow StdInfo: File 95% downloaded
Meadow StdInfo: Download of 'System.Transactions.dll' success (checksums calculated:0x12EC2757, expected:0x12EC2757)

Transfer Complete, wrote 34304 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.EnterpriseServices.dll

Starting File Transfer... 
 
Meadow StdInfo: File 17% downloaded
Meadow StdInfo: File 35% downloaded
Meadow StdInfo: File 52% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 87% downloaded
Meadow StdInfo: Download of 'System.EnterpriseServices.dll' success (checksums calculated:0x25C54CE7, expected:0x25C54CE7)

Transfer Complete, wrote 46592 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Data.DataSetExtensions.dll

Starting File Transfer... 
 
Meadow StdInfo: File 27% downloaded
Meadow StdInfo: File 55% downloaded
Meadow StdInfo: File 82% downloaded
Meadow StdInfo: Download of 'System.Data.DataSetExtensions.dll' success (checksums calculated:0xFAB2999C, expected:0xFAB2999C)

Transfer Complete, wrote 29696 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Drawing.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Drawing.dll' success (checksums calculated:0x79ECF7E2, expected:0x79ECF7E2)

Transfer Complete, wrote 491008 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.IO.Compression.dll

Starting File Transfer... 
 
Meadow StdInfo: File 14% downloaded
Meadow StdInfo: File 21% downloaded
Meadow StdInfo: File 35% downloaded
Meadow StdInfo: File 42% downloaded
Meadow StdInfo: File 56% downloaded
Meadow StdInfo: File 64% downloaded
Meadow StdInfo: File 71% downloaded
Meadow StdInfo: File 85% downloaded
Meadow StdInfo: File 92% downloaded
Meadow StdInfo: Download of 'System.IO.Compression.dll' success (checksums calculated:0x88ABED61, expected:0x88ABED61)

Transfer Complete, wrote 115200 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.IO.Compression.FileSystem.dll

Starting File Transfer... 
 
Meadow StdInfo: File 44% downloaded
Meadow StdInfo: File 88% downloaded
Meadow StdInfo: Download of 'System.IO.Compression.FileSystem.dll' success (checksums calculated:0xA4BE06C0, expected:0xA4BE06C0)

Transfer Complete, wrote 18432 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.ComponentModel.Composition.dll

Starting File Transfer... 
 
Meadow StdInfo: File 12% downloaded
Meadow StdInfo: File 22% downloaded
Meadow StdInfo: File 31% downloaded
Meadow StdInfo: File 41% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 72% downloaded
Meadow StdInfo: File 82% downloaded
Meadow StdInfo: File 91% downloaded
Meadow StdInfo: Download of 'System.ComponentModel.Composition.dll' success (checksums calculated:0x737BF1F9, expected:0x737BF1F9)

Transfer Complete, wrote 258560 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Net.Http.dll

Starting File Transfer... 
 
Meadow StdInfo: File 11% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 32% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 52% downloaded
Meadow StdInfo: File 61% downloaded
Meadow StdInfo: File 72% downloaded
Meadow StdInfo: File 81% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Net.Http.dll' success (checksums calculated:0xEE61F506, expected:0xEE61F506)

Transfer Complete, wrote 281600 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Runtime.Serialization.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Runtime.Serialization.dll' success (checksums calculated:0x156E74E6, expected:0x156E74E6)

Transfer Complete, wrote 938496 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.ServiceModel.Internals.dll

Starting File Transfer... 
 
Meadow StdInfo: File 11% downloaded
Meadow StdInfo: File 22% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 41% downloaded
Meadow StdInfo: File 53% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 72% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 91% downloaded
Meadow StdInfo: Download of 'System.ServiceModel.Internals.dll' success (checksums calculated:0x8B97E5D5, expected:0x8B97E5D5)

Transfer Complete, wrote 215040 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Web.dll

Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'System.Web.dll' success (checksums calculated:0x55BDA450, expected:0x55BDA450)

Transfer Complete, wrote 3028992 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Runtime.Serialization.Formatters.Soap.dll

Starting File Transfer... 
 
Meadow StdInfo: File 21% downloaded
Meadow StdInfo: File 42% downloaded
Meadow StdInfo: File 63% downloaded
Meadow StdInfo: File 84% downloaded
Meadow StdInfo: Download of 'System.Runtime.Serialization.Formatters.Soap.dll' success (checksums calculated:0xEB8D326A, expected:0xEB8D326A)

Transfer Complete, wrote 38912 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.ComponentModel.DataAnnotations.dll

Starting File Transfer... 
 
Meadow StdInfo: File 19% downloaded
Meadow StdInfo: File 28% downloaded
Meadow StdInfo: File 38% downloaded
Meadow StdInfo: File 48% downloaded
Meadow StdInfo: File 57% downloaded
Meadow StdInfo: File 67% downloaded
Meadow StdInfo: File 77% downloaded
Meadow StdInfo: File 86% downloaded
Meadow StdInfo: File 96% downloaded
Meadow StdInfo: Download of 'System.ComponentModel.DataAnnotations.dll' success (checksums calculated:0xEFE5CA42, expected:0xEFE5CA42)

Transfer Complete, wrote 84992 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/Mono.Data.Sqlite.dll

Starting File Transfer... 
 
Meadow StdInfo: File 14% downloaded
Meadow StdInfo: File 24% downloaded
Meadow StdInfo: File 34% downloaded
Meadow StdInfo: File 44% downloaded
Meadow StdInfo: File 53% downloaded
Meadow StdInfo: File 63% downloaded
Meadow StdInfo: File 73% downloaded
Meadow StdInfo: File 83% downloaded
Meadow StdInfo: File 93% downloaded
Meadow StdInfo: Download of 'Mono.Data.Sqlite.dll' success (checksums calculated:0x66BFF98C, expected:0x66BFF98C)

Transfer Complete, wrote 166912 bytes to Meadow


Sending file: ~/.local/share/WildernessLabs/Firmware/1.0.1.0/meadow_assemblies/System.Xml.Linq.dll

Starting File Transfer... 
 
Meadow StdInfo: File 11% downloaded
Meadow StdInfo: File 23% downloaded
Meadow StdInfo: File 35% downloaded
Meadow StdInfo: File 41% downloaded
Meadow StdInfo: File 53% downloaded
Meadow StdInfo: File 65% downloaded
Meadow StdInfo: File 71% downloaded
Meadow StdInfo: File 83% downloaded
Meadow StdInfo: File 95% downloaded
Meadow StdInfo: Download of 'System.Xml.Linq.dll' success (checksums calculated:0x080E1BAF, expected:0x080E1BAF)

Transfer Complete, wrote 137216 bytes to Meadow


App.dll deploy complete!

Meadow StdInfo: Mono is disabled
Meadow StdInfo: Mono has been enabled - restarting Meadow

Connecting to Meadow on /dev/ttyACM0

An unknown request value of '0x4D00' was received.
Meadow StdInfo: Mono is enabled
Done!
alan@dev:/WildernessLabs/MeadowNew/Blinky$ 

Flashing Meadow on F7Micro using Meadow CLI

Finally I got everything working with my Meadow ecosystem (powered by NuttX RTOS kernel)

First I flashed the basic core OS using DFU, as I explained in another post:

$ sudo dfu-util -a 0 -D Meadow.OS.bin -s 0x08000000

Then I restarted the board and used the Meadow CLI to install the OS Runtime:

$ meadow mono update rt -f Meadow.OS.Runtime.bin -s /dev/ttyACM0

Connecting to Meadow on /dev/ttyACM0

An unknown request value of '0x4D00' was received.
Starting Mono Runtime Update
Meadow StdInfo: Mono is disabled

Connecting to Meadow on /dev/ttyACM0

Meadow StdInfo: Mono is disabled
Updating Mono Runtime
Starting File Transfer... 
 
Meadow StdInfo: File 10% downloaded
Meadow StdInfo: File 20% downloaded
Meadow StdInfo: File 30% downloaded
Meadow StdInfo: File 40% downloaded
Meadow StdInfo: File 50% downloaded
Meadow StdInfo: File 60% downloaded
Meadow StdInfo: File 70% downloaded
Meadow StdInfo: File 80% downloaded
Meadow StdInfo: File 90% downloaded
Meadow StdInfo: Download of 'Meadow.OS.Runtime.bin' success (checksums calculated:0xC6FD7107, expected:0xC6FD7107)
Meadow StdInfo: Erasing mono flash memory
Meadow StdInfo: Mono memory erase success
Meadow StdInfo: Flashing 10% complete
Meadow StdInfo: Flashing 20% complete
Meadow StdInfo: Flashing 30% complete
Meadow StdInfo: Flashing 40% complete
Meadow StdInfo: Flashing 50% complete
Meadow StdInfo: Flashing 60% complete
Meadow StdInfo: Flashing 70% complete
Meadow StdInfo: Flashing 80% complete
Meadow StdInfo: Flashing 90% complete
Meadow StdInfo: Verifying runtime flash operation.
Meadow StdInfo: Verifying 10% complete
Meadow StdInfo: Verifying 20% complete
Meadow StdInfo: Verifying 30% complete
Meadow StdInfo: Verifying 40% complete
Meadow StdInfo: Verifying 50% complete
Meadow StdInfo: Verifying 60% complete
Meadow StdInfo: Verifying 70% complete
Meadow StdInfo: Verifying 80% complete
Meadow StdInfo: Verifying 90% complete
Meadow StdInfo: Mono runtime successfully flashed.

Transfer Complete, wrote 3145728 bytes to Meadow


Connecting to Meadow on /dev/ttyACM0

Mono Flashed Successfully
Done!

Finally I can get info from the device:

$ meadow device info
 
Connecting to Meadow on /dev/ttyACM0

Meadow by Wilderness Labs
Board Information 
    Model: F7Micro
    Hardware version: F7FeatherV2
    Device name: MeadowF7

Hardware Information 
    Processor type: STM32F777IIK6
    ID: 23-00-1C-00-07-51-38-34-35-31-XX-XX
    Serial number: 33543162XXXX
    Coprocessor type: ESP32

Firmware Versions 
    OS: 1.0.1.5
    Mono: 1.0.1.5
    Coprocessor: Not available
    Protocol: 7

Done!

How to install .NET 7.0 on Ubuntu 23.04

Just do it:

$ wget https://packages.microsoft.com/config/ubuntu/23.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

$ sudo dpkg -i packages-microsoft-prod.deb

$ sudo apt install aspnetcore-runtime-7.0=7.0.105-0ubuntu2 dotnet-apphost-pack-7.0=7.0.105-0ubuntu2 dotnet-host-7.0=7.0.105-0ubuntu2 dotnet-hostfxr-7.0=7.0.105-0ubuntu2 dotnet-runtime-7.0=7.0.105-0ubuntu2 dotnet-sdk-7.0=7.0.105-0ubuntu2 dotnet-targeting-pack-7.0=7.0.105-0ubuntu2

Como usar Ubuntu em Inglês com teclado Americano e conseguir escrever com acentuação em Português

Você instalou o Ubuntu 23.04 e quis manter o idioma em inglês porque você é desenvolvedor e precisa pesquisar pelas mensagens de erro em inglês ou simplesmente porque gosta do idioma, mas você notou que ao invés de digitar “á, é, ó, ô, ú, ç” ele digita “‘a, ‘e, ‘o, ^o, ‘u, ‘c”, correto?

Calma isso é simples de resolver, clique no canto superior direito, próximo do ícone da bateria e clique no ícone de Setting (engrenagem), vá em “Region and Language” e clique em “Manage Installed Languages” e finalmente clique em “Install / Remove Languages …” e adicione a linguagem Portuguese.

Embaixo de “Manage Installed Languages” tem uma seção “Your Account”, clique em “Formats” e mude para “Brasil”.

Agora no menu principal do Setting vá em Keyboard clique no “+” e em “English (United States)”, vai aparecer um lista com vários tipos de teclados, escolha “English (US, intl., with dead keys)”.

Você vai notar que aparecem duas opções de teclado, o original “English (US)” e “English (US, intl., with dead keys)” e que próximo da bateria apareceu um ícone “En”, isso significa que o sistema está usando a configuração de teclado original, padrão em inglês.

Você pode mudar isso manualmente clicando neste ícone e escolhendo a segunda opção de teclado, ou pode simplesmente remover o teclado “English (US)” padrão e deixar apenas o que você acabou de adicionar. Para isso em “Keyboad” clique na direita do teclado “English (US)” e escolha remover, pronto, agora seu computador suporta o idioma Inglês e permite escrever em Português.

Moving WordPress from subdirectory to root directory

So you installed wordpress inside /var/www/html/wordpress and now it show up at https://www.yoursite.com/wordpress instead of https://www.yoursite.com

Don’t worry it is easy to solve!

Enter inside /var/www/html and remove the file index.html :

$ sudo -s
# cd /var/www/html/
# rm index.html

Now move the content from /var/www/html/wordpress to /var/www/html:

# cd wordpress
# mv * ../
# cd .. 

If you access your http://www.yoursite.com you will see that the wordpress is there, but the links are not working, you need to edit wp-config.php to fix it, open the file and add these two define lines:

# vim wp-config.php

define('WP_SITEURL', 'https://www.yoursite.com');
define('WP_HOME', WP_SITEURL);

That’s all!

Creating a Touchscreen GT911 driver for NuttX RTOS

Initially we need to confirm that GT911 is in the bus. It can be on address 0x14 or 0x5d.

In my case it is on 0x14:

nsh> i2c bus
 BUS   EXISTS?
Bus 0: YES
nsh> i2c dev -b 0 0x00 0x7f
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- 14 -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
nsh>

Initially I configured to use GT9XX driver from NuttX (used on PinePhone smartphone) but it failed:

nsh> tc
tc_main: nsamples: 0
gt9xx_open: 
esp32_gt9xx_set_power: on=1
tc_main: Opening /dev/touch0
gt9xx_i2c_read: reg=0x8140, buflen=4
gt9xx_i2c_read (0x3ffe0ad0):
0000  39 31 31 00                                      911.            
gt9xx_probe_device (0x3ffe0ad0):
0000  39 31 31 00                                      911.            
esp32_gt9xx_irq_enable: enable=1
tc_main: Reading...
gt9xx_read: buflen=32
gt9xx_read_touch_data: 
gt9xx_i2c_read: reg=0x814e, buflen=1
gt9xx_i2c_read (0x3ffe0b39):
0000  80                                               .               
gt9xx_set_status: status=0
gt9xx_i2c_write: reg=0x814e, val=0
gt9xx_i2c_write: I2C Write failed: -110
gt9xx_set_status: Set Status failed: -110
gt9xx_read_touch_data: Set Touch Panel Status failed: -110
tc_main: Bytes read: -1
tgt9xx_close: 
esp32_gt9xx_irq_enable: enable=0
esp32_gt9xx_set_power: on=0
c_main: read /dev/touch0 failed: 110
Terminating!
nsh>

As you can see I ran the touchscreen test (tc command) and the gt9xx driver already read some useful information from the chip. Note it read the device name correctly.

Now I need to figure out the differences between GT917 (that was used for this gt9xx driver) and the GT911 and modify the driver to work with both, or create a different driver case the differences are irreconcilable.

NB: You need to solder a 0R or just solder the R25 to get the CTP_INT connected to ESP32 IO21.

Testing RISC-V 64-bit on NuttX RTOS running on QEMU

After cloning nuttx and nuttx-apps repositories:

$ cd nuttxspace/nuttx
$ ./tools/configure.sh rv-virt:nsh64
$ make -j

/* Lets see its size */

$ ls -l nuttx
-rwxrwxr-x 1 alan alan 3019360 mai 16 12:19 nuttx

$ riscv64-unknown-elf-size nuttx
   text	   data	    bss	    dec	    hex	filename
 164688	    677	   8544	 173909	  2a755	nuttx

Time to run it!

$ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -smp 8 -bios none -kernel nuttx -nographic

NuttShell (NSH) NuttX-12.1.0
nsh> uname -a
NuttX 12.1.0 76ece3cf8d May 16 2023 12:19:28 risc-v rv-virt
nsh>