Taming the RAK5146 / SX1303

Its been a while - but good things come to those who wait ;).

Trying to work out a new system you're unfamiliar with can be quite a challenge. In my case I got my first LoRaWAN concentrator along with some CubeCell HTCC-AB01 and tried to get them to work. It turned out - it was quite hit and miss. On the one hand, the firmware support for the RAK5146 with USB, GPS and LBT was not really ready yet - on the other hand, the CubeCell Arduino code has a fatal flaw with the preamble size so that those cannot join a LoRa network if used in EU868 MHz Band (the perfect fix by 1rabbit is linked as well!).

In the end, as I wanted to get this working as best as possible, I bought myself the RAK2287 Pi Hat and started modifying it. I was quite sure that the I2C signals should be available somewhere on that board - as well as 5V + 3v3 along with the raw PPS signal of the GPS module within the RAK5146. I was right and could bridge the PPS signal to an used RPi GPIO pin.

PPS Pin bridged to GPIO 04

Using the I2C signal lines, Ground and 3v3 I added an I2C sensor interface (call it an ugly QWIIC connector ;)).

PPS hack and "poor mans QWIIC connector added"

I installed the latest UDP Packet Forwarder package by Xose - and everything was working perfectly since then.

I even added brocaars Packet Multiplexer and started running a local ChirpStack instance on my home server. Now my sensors are feeding their data directly to my local InfluxDBv2 and Grafana - but at the same time my Gateway is still available for TTNv3 users to receive their data. Its awesome and with that I even receive my private data during WAN outages. Nice!

As added "bonus", my gpsTime project is running on the same RPi, using the GPS time of the RAK5146 and its PPS signal to be an extremely precise GPS timeserver in my network - and an additional BME280 is running as the "room sensor", because adding another battery operated device - if you are having more than enough CPU power (in form of the RPi ;)) is really not needed. The whole device fits behind the TV.

"Not Great, Not Terrible"

All in all, the project was very successful, I am working on some new ideas regarding the sensors, but this is pending on my KiCad 6 skills and deliveries of new RAK hardware currently on the way ;).

I still keep all infos in the balena Forums, so head over if you want more details.

gpsTime

I think there is nothing more pleasing than having extremely precise measurements at your fingertips. Like time. While in the past it was quite problematic to measure time accurately (not talking about sundials, but... why not? ;)) - mankind has created one precise time source as the byproduct (read: "waste") for usage in accurate navigation: GNSS and their different kinds like GPS, Glonass, Galileo, BaiDou and others.

Taping into this time source and providing it to your local computer network via NTP has been done by countless people and is an extreme rewarding task. Is it necessary? Maybe not. Is it really cool? Yes. And now it is even easier as you don't need to configure it yourself, but can use the balenaHub and the preconfigured gpsTime project.

We do not waste time on fancy logos 😉

Basically you just need an RPi B+ (2/3/4), Micro SD Card, Powersupply and 3v3 TTL Level GPS Module with PPS Output. The rest is just done by going on the balenaHub entry shown above, creating a free account and flashing balenaOS onto your SD card, booting the RPi on the internet for the first time and let it get the needed containers. Afterwards you can use the RPi offline and still enjoy your precise time source.

A watterott CQM-M8Q Breakout and an good old RPi 2B+ are more than powerful enough

More details can be found in the Github Repo and you can work and improve that project to your hearts content. I am probably going to do an PiAndMore talk about it - and use the project myself as a block for precise timing in some support equipment.

NFS Benchmarking RPi 3B, RPi 3B+ & BPi

3-14, PiDay. Sadly the day Stephen Hawking passed away - and the day the new Raspberry Pi 3B Plus was unveiled.
Some days later, I got a small package:

With that small thing at hand, I was looking through the list of changes:

  • Broadcom BCM2837B0, Cortex-A53 (ARMv8) 64-bit SoC @ 1.4GHz
  • 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac wireless LAN, Bluetooth 4.2, BLE
  • Gigabit Ethernet over USB 2.0 (maximum throughput 300 Mbps)
  • Power-over-Ethernet (PoE) support (requires separate PoE HAT)

Ok, CPU bumped from 1.2 to 1.4 GHz, new WiFi with 802.11ac (and 5 GHz support), BLE 4.2, PoE "support" - and Gigabit over USB 2.0.
Well, not too bad.
One of the biggest downsides of the RPi - since its release - was the design choice to add Ethernet over USB 2.0 - while sharing the one and only USB 2.0 lane of the BCM with all the other USB sockets of the RPi. While this choice leads to lower production costs, it also limits the speed of Ethernet / USB especially in case where people tried to implement NAS or File sharing applications with an added USB Drive over Ethernet. To see how much the new design improved that old problem, I decided to Benchmark an "old" RPi 3B with the latest RPi 3B+ in the discipline of NFS.

Test setup:

  • Raspbian Stretch Lite (March 2018 / 2018-03-13 / Kernel 4.9)
  • WD PiDrive 314 GB as HDD via USB
  • Gigabit Ethernet Switch
  • Benchmarking system: Windows 10 with MS NFS Client, Crystal Disk Mark 4.0.3 and Gigabit Ethernet
  • NFS Exports Options: (rw,sync,no_subtree_check,all_squash,anonuid=65534,anongid=65534)

The benchmark started with the old RPi 3B and no surprises:

The RPi 3B is lacking throughput at its USB 2.0 lane.

Next up, was the new RPi 3B+:


And - yes - the new design really showed some improvement, to say the least.

However, I was wondering: What would happen if I added an SBC with a real USB 2.0 connection and real Gigabit Ethernet to the test?
Well - I did that. Welcome the now 4 years old Banana Pi 1:

We are talking here about a 1 GHz Dual Core A20 processor with 1 GB RAM which is - i need to repeat - 4 years old - releases just 2 months before the Raspberry Pi 1 B+ came out - I direct competitor of the RPi 1st Generation. But, what happens if we use the SATA port - which is also included on the BPi? With... lets say... some Samsung 850 EVO 250 GB SSD - which I had laying around? 😉

And what happens if I plug that in via USB?

Ok. Thats a bit confusing, to say the least. Could be that the SATA port is actually just coupled via USB to the BPi - however, I saw benchmarks on which the SATA port performed a lot better on the BPi. For this benchmark, I used ARMBIAN:

ARMBIAN Debian Server mainline Kernel
Armbian_5.38_Bananapi_Debian_stretch_next_4.14.14
Welcome to ARMBIAN 5.38 stable Debian GNU/Linux 9 (stretch) 4.14.18-sunxi

So, bundling an SSD with some old SBC board will not give you the needed freedom to just drop buying expensive storage for your datacenters and replacing them with small boards - sadly ;). However, we could see that the new RPi 3B+ improved a lot in one of its weak points - but still gets beaten by an very old - and still very feisty rival.