A long time ago Microsoft had a product called the .NET Micro Framework (The source was released 2009 ) which was built to enable .NET developers to write solutions which ran on resource constrained devices.
Many years later the nanoFramework team resurrected the project, re-engineering the build system to make it easier to support new targets, updating APIs, redesigning the code, rebuilding core modules and updating the develop, download, debug, and deploy process. The nanoFramework runs on many devices which are split into reference and community target boards.
Over the last few years I have been working with many LoRa and LoRaWAN devices. The RAKwireless RAK811 module initially caught my attention because it supported AS923 the LoRaWAN standard used in New Zealand.
I have assumed that readers are familiar with LoRaWAN, configuring LoRaWAN modules, configuring LoRaWAN networks, and have a basic knowledge of electronics.
The configuration of The Things Network(TTN) Gateways, Applications and Devices has been covered in detail in several other Hackster.IO projects so I won't repeat it here.
This project is a summary of a series of posts on my blog where I cover the construction of the RAK811 LoRaWAN library in significantly more detail.
I had read a few projects on Hackster.IO about getting the RAK Wisduino working on an Arduino device. So I figured I would try to and get it to working on one of my nanoFramework boards.
This is yet another one of my projects which provides the "plumbing" for other developers to build real applications on top of...
Debugging HardwareThe first step was to try my Wisduino going on a Arduino with the RAKwireless provided library just to confirm this was possible. The very first time I put the Wisduino shield on one of my Arduino devices it didn't work...
I then tried connecting up just the minimum required pins (power, ground and the serial port) and it sprung into life. I could then connect to TTN gateway on the far end of my desk using Activation By Personalisation(ABP) and Over The Air Activation(OTAA).
The default configuration uses a software serial port on D10 & D11 which appeared to struggle with the 115K2 default baudrate.
A number of the nanoFramework devices have Arduino Uno R3 compatible connectors which have serial ports the standard pins. I had an STM32F7691 Discovery board left over from yet another abandoned project which I figured would be a reasonable choice. One of the STM32F7691 serial ports uses pins D0 & D1 on the Arduino header which I thought would make things easier.
To confirm that this was a viable approach I used jumpers to trial the same setup with my Arduino. When connected up the other pins on my Wisduino and Arduino device it stopped working which didn't inspire me with confidence..
After looking at the circuit diagram I worked out that pins D0/D1 were connected to D10/D11 which are also used by the default Serial Peripheral Interface(SPI). Then after some more debugging (trial and error really) I found that the state of the RAK811 module reset line was also causing problems.
At this point I had to "invalidate the warranty" and remove some 0 ohm resistors to get the Wisduino shield to work. For those who are interested this is covered in excruciating detail on my blog. Beware there is not a lot of space so you will need to use "small" wire cutters.
To disconnect D0/D1 from D10/D11 I removed R17/R19. To disconnect the reset line I removed R8.
You can still use Wisduino on an Arduino and the default software serial port with some jumpers.
After getting all my hardware issues sorted out I used the RAK Serial Port Tool to slow the RAK811 module serial port connection down to 9600 baud. Considering the throughput of a LoRaWAN link the default 115K2 baud rate configuration appeared unnecessary.
I then built a series of nanoFramework projects to explore the functionality required by my RAK811 library.
The first project (ShieldSerial) was to confirm that I could establish a reliable serial connection to the Wisduino by requesting the RAK811 module firmware version information.
I then build a program to explore different options available to factory reset the RAK811 device but I could never get it to work. I will revisit this in the future to see if I can figure out what I was doing wrong.
I then build a "nasty" proof of concept(PoC) which initiated an OTAA connection to TTN gateway on my desk. (There is also an ABP version as well)
Based on what I had learnt from my PoC projects I then wrote a nanoFramework library and test harness
The TTN configuration for my nanoFramework/Wisduino device
My RAK811 LoRaWAN module library supports
- OTAA and ABP Network joins
- Class A and B devices
- Confirmed and unconfirmed messages
- Region configuration
- Power Conservation with Sleep and Wakeup
- Adaptive Data Rate(ADR) enable/disable
- Sending arrays of bytes
- Sending strings of BCD encoded bytes
- Received data events
- Message delivery confirmation events
I have been looking for other arduino shield or mikrobus LoRaWAN development boards which support AS923 so I can write more nanoFramework libraries.
This library is intended as "plumbing" for.NET developers building LoRaWAN connected applications on resource constrained devices.
To keep this project to a reasonable length I have left out a lot of the "grungy" details but for those who are interested the detailed story is on my blog.
FootnoteOver the last couple of years I have been following the progress of the nanoFramework. The team have done a massive amount of work building robust and reliable tooling which integrates nicely with Visual Studio 2017/2019.
The level of support available via Discord is great and the "long suffering" core team are really helpful. The visual studio plugin and libraries have regular updates and overall "it just works".
Comments
Please log in or sign up to comment.