A long time ago Microsoft had a product called the .NET Micro Framework (It was open sourced in 2009 ) which was built to enable.NET developers to write programs 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 the develop, download, debug, and deploy process. (As of 2021-08 generics support is just about ready)
The team have put a huge amount of work into the nanoFramework and recently it joined the.NET Foundation project which is great achievement.
When I first starting writing the library I struggled to source Seeed LoRa-E5 modules so I had to use LoRa-E5 Development Kits with a DIY cross over cable.
I used a jeweler's screwdriver lift up the locking tabs on the Grove connector for the transmit and receive wires so I could swap them around.(I mark cross over cables with a knot so it is obvious they have been modified)
I have assumed that readers are familiar with LoRaWAN, configuring LoRaWAN modules, and configuring LoRaWAN networks.
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.
The sample application sends a 10 byte message (specified as raw bytes or BCD) every 5 minutes.
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
devMobile.IoT.SeeedE5LoRaWANDeviceClient starting
12:00:01 Join start Timeout:25 Seconds
12:00:07 Join finish
12:00:07 Send Timeout:10 Seconds payload BCD:010203040506070809
12:00:13 Sleep
12:05:13 Wakeup
12:05:13 Send Timeout:10 Seconds payload BCD:010203040506070809
12:05:20 Sleep
12:10:20 Wakeup
12:10:20 Send Timeout:10 Seconds payload BCD:010203040506070809
12:10:27 Sleep
12:15:27 Wakeup
12:15:27 Send Timeout:10 Seconds payload BCD:010203040506070809
12:15:34 Sleep
...
11:52:40 Wakeup
11:52:40 Send Timeout:10 Seconds payload BCD:010203040506070809
11:52:45 Sleep
11:57:45 Wakeup
11:57:45 Send Timeout:10 Seconds payload BCD:010203040506070809
11:57:52 Sleep
12:02:52 Wakeup
12:02:52 Send Timeout:10 Seconds payload BCD:010203040506070809
12:02:59 Sleep
12:07:59 Wakeup
12:07:59 Send Timeout:10 Seconds payload BCD:010203040506070809
12:08:07 Sleep
12:13:07 Wakeup
12:13:07 Send Timeout:10 Seconds payload BCD:010203040506070809
12:13:14 Sleep
I
had some problems with reliability, which I think were due to a timing issue as the LoRa-E5 module came out of low power mode. After a pointer to the LowPower section of the Seeed LoRa-E5 manual.
I realised my code could send the next command within 5ms so I added a small delay which appears to be working.
public Result Wakeup()
{
// Wakeup the E5 Module
#if DIAGNOSTICS
Debug.WriteLine($" {DateTime.UtcNow:hh:mm:ss} AT+LOWPOWER: WAKEUP");
#endif
Result result = SendCommand("+LOWPOWER: WAKEUP", $"A", CommandTimeoutDefault);
if (result != Result.Success)
{
#if DIAGNOSTICS
Debug.WriteLine($" {DateTime.UtcNow:hh:mm:ss} AT+LOWPOWER: WAKEUP failed {result}");
#endif
return result;
}
// Thanks AndrewL for pointing out delay required in section 4.30 LOWPOWER
Thread.Sleep(5);
return Result.Success;
}
I am "soak testing" my setup and it has been running for weeks.
This project is a summary of a series of posts on my blog where I cover the construction of the Seeed LoRa-E5 LoRaWAN library in significantly more detail.
This library is intended as "plumbing" for.NET developers building LoRaWAN connected applications with the nanoFramework.
The Github repository includes a sample application which shows how to send and receive messages with the library and the different configuration options supported.
FootnoteJosé Simões and the core nanoFramework team have done an amazing job building robust and reliable tooling which integrates well with Visual Studio 2019.
If would be good if Seeedstudio could do LoRa-E5 powered versions of their Seeeduino LoRaWAN and LoRaWAN/GPS devices (2021-08).
Comments