Mobilefish.com
Blockchain tutorial 29: Hierarchical Deterministic wallet - BIP32 and BIP44
updated
youtube.com/c/mobilefish/about
Bekijk al mijn howto instructie video's:
youtube.com/playlist?list=PLmL13yqb6OxfjIr1Zzte7r3Sk3cslev2G
Abonneer je op mijn YouTube-kanaal:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
De presentatie die in deze video is gebruikt is te vinden op:
mobilefish.com/download/mechanische_ventilatie/mechanische_ventilatie.pdf
#mobilefish #howto #Mechanische_ventilatie
youtube.com/c/mobilefish/about
This is part 1 of the PlatformIO series.
In this video I will explain what boards, platforms, frameworks and packages are.
This presentation can be found at:
mobilefish.com/download/platformio/platformio_part1.pdf
All my PlatformIO videos and presentations can be found at:
mobilefish.com/developer/platformio/platformio.html
A toolchain is a set of tools that compiles source code into executables that can run on a device, and includes a compiler, a linker, run-time libraries, debugger or more.
To install a toolchain on PlatformIO you must first select the board, then the platform and last the framework.
A board is a printed circuit board with a microcontroller built onto it.
It usually has I/O circuits, a clock generator, RAM, flash memory and any necessary supported Integrated Circuits.
Usually each board provides support for one platform.
The Sipeed Longan Nano supports 3 platforms:
- GigaDevice GD32V
- Nuclei
- Rath RISC-V
Platform refers to the actual hardware or software development platform upon which a software is built for.
The hardware refers to a particular microcontroller or processor architecture that PlatformIO projects can be compiled to run on.
For each platform, PlatformIO defines:
- The PlatformIO Build System build scripts for the supported frameworks and SDKs
- Pre-configured presets for embedded circuit boards
- Pre-compiled toolchains and related tools for the architecture(s) to be installed
More information: docs.platformio.org/en/latest/platforms
Framework refers to a collection of libraries/classes providing a scaffold for building software.
The framework provides the APIs to call from your application to interface with hardware peripherals or device drivers.
By selecting a framework, it also means your project can only use a certain set of libraries.
A package is a tool or framework that can be used when compiling one or more platforms.
PlatformIO has a registry with pre-built packages for the most popular operating systems, see:
api.registry.platformio.org
PlatformIO supports over 1000 boards and these boards can be found when using the PlatformIO Project Wizard.
platformio.org/boards
platformio.org/platforms
platformio.org/frameworks
More information about PlatformIO Core Command Line Interface (CLI):
docs.platformio.org/en/latest/core/userguide/index.html
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
#mobilefish #platformio #sipeed
youtube.com/c/mobilefish/about
This is part 58 of the LoRa/LoRaWAN tutorial.
In this tutorial I will demonstrate a Python script using the Paho MQTT Python client library, which connects to The Things Stack MQTT Server, and receives uplink messages from my end node.
And also in this tutorial I will demonstrate another Python script using the same Paho MQTT Python client library, which again connects to The Things Stack MQTT Server, but now it sends downlink messages to my end node.
This presentation can be found at:
mobilefish.com/download/lora/lora_part58.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
This Python script
mobilefish.com/download/lora/receive_uplink_messages.py.txt
receives uplink messages from my end node via The Things Stack MQTT Server by using the Paho MQTT Python client library.
This Python script is tested using Python version: 3.7
Required library: paho-mqtt (v1.5.1)
The received uplink messages are:
- humidity and temperature data (DHT11)
- button pressed.
This Python script
mobilefish.com/download/lora/send_downlink_messages.py.txt
sends downlink messages to my end node via The Things Stack MQTT Server by using the Paho MQTT Python client library.
This Python script is tested using Python version: 3.7
Required library: paho-mqtt (v1.5.1)
By sending different hex values at fport 3, two leds (yellow and green) can be switched on or off.
The Python script converts the hex value to its corresponding base64 representation.
The end node in both demos is the same as the one used in tutorial 57.
The Python scripts used in this tutorial originates from this Github page (Please note: I made several modifications):
github.com/descartes/TheThingsStack-Integration-Starters
Information about how to work with integrations in The Things Stack:
thethingsindustries.com/docs/integrations
For example on this page you can find how to connect to an MQTT client and subscribe to uplinks or publish downlinks.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 57 of the LoRa/LoRaWAN tutorial.
In this tutorial I will demonstrate how to send uplink messages from an end device to The Things Stack Community Edition network (V3).
I will also demonstrate how to send downlink messages from The Things Stack Community Edition network (V3) to an end device.
This presentation can be found at:
mobilefish.com/download/lora/lora_part57.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
I have written a detailed tutorial how to send messages to/from The Things Stack Community Edition (V3):
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini_v3.html
In this video I will not go step-by-step thru the detailed tutorial, instead I will only show the most relevant information.
Used libraries, Arduino sketch, and payload formatter:
- Adafruit Unified Sensor library
github.com/adafruit/Adafruit_Sensor
- DHT sensor library
github.com/adafruit/DHT-sensor-library
- MCCI LoRaWAN LMIC library
github.com/mcci-catena/arduino-lmic
- The Arduino sketch
mobilefish.com/download/lora/ttsce-otaa-pro-mini-sensors.ino.txt
- Payload formatter: Javascript decodeUplink
mobilefish.com/download/lora/ttsce-otaa-pro-mini-sensors-decodeuplink.txt
The HopeRF RFM95 LoRa transceiver module does not have a built-in DevEUI or AppEUI.
In such case you should let the TTSCE console generate the required DevEUI or AppEUI.
The AppEUI, DevEUI and AppKey are used in the Arduino sketch.
In this Arduino sketch the DevEUI or AppEUI must be converted to an array of 8 bytes in LSB order.
The AppKey must converted to an array of 16 bytes in MSB order.
I have created an online tool which converts these values to an bytes array in its correct order (LSB / MSB):
mobilefish.com/download/lora/eui_key_converter.html
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 1 of the Homebrew series.
In this tutorial I will explain will explain often used Homebrew package manager terms, such as formula, bottle, cellar, keg, cask and tap.
This presentation can be found at:
mobilefish.com/download/homebrew/brew_part1.pdf
All my Homebrew videos and presentations can be found at:
mobilefish.com/developer/homebrew/homebrew.html
Homebrew is a free and open-source package management system for Unix-like operating systems.
Homebrew is popular on macOS.
To install Homebrew:
- Goto: https://brew.sh/ and copy the online installation instruction.
- Paste the instruction in your terminal.
The package will be installed in the cellar:
/usr/local/Cellar
The installed packages are symlinked into /usr/local
Which actually means symlinked into (if needed):
/usr/local/bin
/usr/local/lib
/usr/local/include
The packages are also symlinked into:
/usr/local/opt
Homebrew prefers installing within directory /usr/local
Apple has assigned this directory for non-system utilities.
This means there are no files in /usr/local by default, so there is no need to worry about messing up existing tools or system tools.
The /usr/local/bin directory must take precedence over /bin, /usr/bin, /sbin and /usr/sbin, see .bash_profile.
Formula is a Ruby script which defines the package (= software).
The formula contains information such as:
- Where the package tar ball, containing the package source, can be downloaded from.
- What package dependencies it has.
- How to install the package.
FORMULA
The formulae on the macOS can be found at:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/<package-name>.rb
The default Homebrew formulae Git location:
github.com/Homebrew/homebrew-core/tree/master/Formula
BOTTLE
Homebrew provides pre-compiled versions for many formulae.
These pre-compiled versions are referred to as bottles and are available at:
github.com/Homebrew/homebrew-core/packages
Homebrew aims to bottle everything and these pre-built binary packages are simple gzipped tarballs of compiled binaries.
The bottles were hosted at homebrew.bintray.com/bottles but as of May 1, 2021 the Bintray hosting provider was shut down.
The Homebrew's binary packages are migrated to GitHub Packages:
github.com/orgs/Homebrew/packages
Homebrew 3.1.0+ will have the new default download location.
Just like formulae and casks, bottles are installed in the cellar:
/usr/local/Cellar
CELLAR
Homebrew downloads and installs packages in the cellar directory.
The cellar location: /usr/local/Cellar
KEG
As mentioned earlier a package is installed in the cellar.
Each package is installed in its own directory followed by the version number.
The combination package name and version number is referred to as keg.
KEG-ONLY
Keg-only means the formula is only installed in the cellar and the packages are not symlinked into /usr/local (meaning /usr/local/bin, /usr/local/lib or /usr/local/include).
Homebrew automatically installs a package as keg-only if it detects the new package will cause problems with an already installed package (e.g. version incompatibilities).
For example the new package shadows a version of a library that ships with macOS, and superseding macOS libraries can cause problems.
As mentioned earlier the keg-only packages are not symlinked into /usr/local but they are symlinked into /usr/local/opt.
For example, gettext is keg-only, which means it is not symlinked into /usr/local
CASK
Cask is an extension of Homebrew.
Just like a formula they are Ruby scripts but they are used to download and install GUI applications.
The Casks on the macOS can be found at:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/<package-name>.rb
The default casks Git location:
github.com/Homebrew/homebrew-cask/tree/master/Casks
TAP
A tap refers to a Git repository and the repository name starts with "homebrew-"
By default homebrew uses the following git repositories:
github.com/Homebrew/homebrew-core
github.com/Homebrew/homebrew-cask
github.com/Homebrew/homebrew-services
The command brew tap without arguments lists the currently tapped repositories:
- Core formulae for the Homebrew package manager:
homebrew/core
- Installation and management of GUI macOS applications:
homebrew/cask
- Manage background services with macOS launchctl daemon manager.
homebrew/services
<user>/<repository-name>
The actual Git location will be:
github.com/<user>/homebrew-<repository-name>
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
#mobilefish #brew #homebrew
youtube.com/c/mobilefish/about
This is part 56 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what OUI, OUI-36, EUI-64, DevEUI, AppEUI and JoinEUI exactly are.
This presentation can be found at:
mobilefish.com/download/lora/lora_part56.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
An Organizationally Unique Identifier (OUI) is a 24-bit number that uniquely identifies a vendor, manufacturer, or organization.
The IEEE Standards Association Registration Authority assigns OUI values.
standards.ieee.org/products-services/regauth/index.html
The OUI-36 is a 36-bit sequence.
An OUI-36 is created by the IEEE Registration Authority by concatenating 12 bits to a 24-bit IEEE-reserved base OUI, after octet 2.
An assignee of an OUI-36 shall not truncate the OUI-36 to use as an OUI (24-bits) because the IEEE RA will use the base OUI to assign OUI-36 values to multiple organizations.
The IEEE Registration Authority divides the addresses in 3 different size blocks:
MAC Address Block Small: MA-S
MAC Address Block Medium: MA-M
MAC Address Block Large: MA-L
Companies or Organizations can purchase a MAC address block with its own unique OUI (MA-L), OUI-36 (MA-S) or 28 bits identifier (MA-M).
A company can use the purchased OUI-36 to create their own unique EUI-64 addresses for purposes where unique 64 bits are needed.
You can search the public IEEE Registration Authority master listings (MA-L, MA-M and MA-L) for the company names and addresses and which OUI, OUI-36 or unique 28 bits identifiers they are registered to:
regauth.standards.ieee.org/standards-ra-web/pub/view.html
Alternative use the Wireshark OUI Lookup Tool
wireshark.org/tools/oui-lookup.html
The IEEE registration fees for the MAC address block Small, Medium and Large.
Source: standards.ieee.org/products-services/regauth/oui36/index.html
For more information about OUI and EUI:
standards.ieee.org/content/dam/ieee-standards/standards/web/documents/tutorials/eui.pdf
A Media Access Control address (MAC address) is a unique identifier assigned to a network card.
These addresses identifies each node on a network.
MAC addresses are primarily assigned by device manufacturers and are embedded in the hardware.
Depending on the manufacturer, these MAC addresses can be changed.
A MAC address includes a manufacturer's organizationally unique identifier (OUI) and an extension identifier which can be set freely by the device manufacturer.
The Extended Unique Identifier (EUI) is used to identify other devices and software.
Just like a MAC address, an EUI address includes a manufacturer's organizationally unique identifier (OUI or OUI-36) and an extension identifier which can be set freely by the device manufacturer.
The whole point of an EUI address (same applies to MAC) is that they are guaranteed to be unique.
If users start using random numbers to generate an EUI address it is not going to be unique anymore.
The self generated EUI may clash with someone else’s.
As mentioned earlier you can generate a local administered EUI-64 with a very low probability of collision.
Procedure to create a local administered EUI-64:
- Create a random 64 bit number: 79-AE-0B-C5-66-3B-F3-A7
- Make sure in octet 0 the X-bit = 1 and the M-bit = 0
The term “provisioning a device” means to evolve a device to a state in which it can be handed off to an end-user for their specific use in a functional manner.
In a LoRaWAN context “provisioning a device” refers to storing essential data such as DevEUI, JoinEUI, AppKey or NwkKey on a LoRaWAN 1.1 device.
An online tool to generate your own local administered EUI:
mobilefish.com/download/lora/lorawan_device.html
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 55 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain how to migrate The Things Gateway from The Things Network (V2) to The Things Stack Community Edition network (V3).
This presentation can be found at:
mobilefish.com/download/lora/lora_part55.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
More information about The Things Gateway:
thethingsnetwork.org/docs/gateways/gateway
thethingsindustries.com/docs/gateways/thethingskickstartergateway
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 54 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain the Over-The-Air-Activation (OTAA) in LoRaWAN 1.1.
This presentation can be found at:
mobilefish.com/download/lora/lora_part54.pdf
The information presented in this video were taken from these two sources:
The LoRaWAN 1.1 Specification:
lora-alliance.org/wp-content/uploads/2020/11/lorawantm_specification_-v1.1.pdf
The LoRaWAN Backend Interfaces 1.0 Specification:
lora-alliance.org/wp-content/uploads/2020/11/lorawantm-backend-interfaces-v1.0.pdf
The end device generates the DevNonce which is a 2-byte counter, starting at 0 when the device is initially powered up and incremented with every join-request.
The DevNonce value is used to prevent replay attacks.
If the end device can be power-cycled then DevNonce shall be persistent, meaning stored in a non-volatile memory.
For each end device, the network server keeps track of the last DevNonce value used by the end device, and ignores join-requests if DevNonce is not incremented.
The end device constructs a message containing the JoinEUI, DevEUI and DevNonce.
To protect the message's integrity, the Message Integrity Code (MIC) is computed using the NwkKey.
The end device can now activate itself, by sending a join-request message as plain text to the network server.
The network server receives the join-request message and checks if the DevNonce has not been used previously.
The network server authenticates the end device with the MIC value.
If accepted, the network server constructs a JoinReq message.
The network server uses the Domain Name System (DNS) to look up the IP address of the join server based on the JoinEUI in the received join-request message.
If the DNS lookup succeeds, the network server sends the JoinReq message to the join server.
The join server provides the JoinNonce value which is a device specific counter value, that never repeats itself, and is incremented each time a Join-Accept message is created.
The join server processes the JoinReq message and derives the network session keys.
The network session keys are derived with the NwkKey and the AppSKey is derived with the AppKey.
The network session keys and AppSKey are stored at the join server and are not send to the network server.
The join server creates a join-accept message.
To protect the join-accept message integrity, the Message Integrity Code (MIC) is computed using the JSIntKey.
The join-accept message is encrypted with the NwkKey.
The join server constructs a JoinAns.
The join server sends the JoinAns to the network server.
The network server receives the JoinAns message and if Result==Success the network server forward the encrypted join-accept message to the end device.
The end device decrypt the join-accept message with the NwkKey and verifies the MIC of the join-accept message.
The JoinNonce should be greater than the recorded one stored in the device.
In that case the new JoinNonce value replaces the previously stored one.
If the device is susceptible of being power cycled the JoinNonce shall be persistent (stored in a non-volatile memory).
If the join-accept message is accepted the end device generates the network session keys FNwkSIntKey, SNwkSIntKey, and NwkSEncKey using the NwkKey, and generates the AppSKey using the AppKey.
The end device has a payload containing sensor data.
The end device encrypts the payload with the AppSKey and sends the encrypted payload to the network server.
The network server receives an uplink packet from the end device.
The network server forwards the encrypted packet to the application server.
The application server sends an AppSKeyReq message to the join server.
The message requests the AppSKey identified by the DevEUI from the join server.
The AppSKey is encrypted using a shared key between the join server and the application server.
The join server sends the encrypted AppSKey to the application server in an AppSKeyAns message.
The application server decrypts the encrypted AppSKey with the shared key.
The application server uses the AppSKey to decrypt the encrypted payload.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 53 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what fport is and a short refresher what a json object is.
I will also explain what payload formatters are and show you several Javascript payload formatters examples.
This presentation can be found at:
mobilefish.com/download/lora/lora_part53.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
The LoRa packet comprises of three elements: Preamble, header (optional) and payload.
To create the Radio Frequency (RF) waterfall, a RTL-SDR (Software Define Radio) dongle is used.
More information:
youtu.be/bSAa2aOXpCc
The RTL-SDR dongle is nameless but has the following chipsets:
The radio tuner: Rafael Micro R820T2
The demodulator: RealTek RTL2832U
FPort means Frame Port.
FPort is 1 byte in size.
Allowed values: 1-223, except fports 200-203.
This byte is always sent, even if you use it or not.
My end device uses this Arduino sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
This sketch uses the MCCI LoRaWAN LMIC library in my Arduino IDE (v1.8.10)
github.com/mcci-catena/arduino-lmic
In the sketch, change function LMIC_setTxData2 to change the fport value.
LMIC_setTxData2(fport, data, data_length, confirmed)
- There are LoRaWAN end devices where fports can not be changed.
These devices have fixed fport values.
- There are LoRaWAN end devices where fports can be changed programmatically (for example in an Arduino sketch) or with at-commands.
- There are LoRaWAN end devices where fports can only be changed by modifying, compiling and uploading the new firmware to the end device.
Payload formatters allow you to process data going to and from end devices.
When a binary payload is sent from end device to LoRaWAN network (uplink), the data can be converted using, for example, a Javascript payload formatter.
The data can be converted to human readable data.
When a message is sent from the LoRaWAN network to the end device (downlink), the message can be converted using, for example, a Javascript payload formatter.
The message can be converted from human readable data to binary data.
The payload formatters used in the V2 console can not be copy-and-pasted directly in the V3 console.
The V2 and V3 payload formatters are different.
For example, the function names and the function parameters are different.
In the V3 console several payload formatters can be used:
- Javascript payload formatters
thethingsindustries.com/docs/integrations/payload-formatters/javascript
- Cayenne Low Power Payload formatters
thethingsindustries.com/docs/integrations/payload-formatters/cayenne
- Device specific payload formatters
Device manufacturers may have payload formatters designed to work with their devices.
github.com/TheThingsNetwork/lorawan-devices
The V3 payload formatters can be applied to an entire application, or to a specific end device.
The payload formatter tester is only available on the device level and not on the application level.
The decodeUplink function has only one function parameter (input) which is a json object.
The encodeDownlink function has only one function parameter (input) which is a json object.
If you specify a downlink formatter the encodeDownlink function is required but not the decodeDownlink function.
The decodeDownlink formats the binary data “bytes” into human readable data, just like the decodeUplink function.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 52 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what the Things Stack Community Edition is.
This presentation can be found at:
mobilefish.com/download/lora/lora_part52.pdf
The Things Stack is an enterprise grade LoRaWAN network server, built on an open source core.
The open source core can be found at:
github.com/TheThingsNetwork/lorawan-stack
In 2021 the Things Industries maintains two LoRaWAN networks:
- The Things Network (TTN)
- The Things Stack (TTS) Community Edition
The LoRaWAN Network Servers in The Things Network (TTN) uses software which can be found at:
github.com/TheThingsNetwork/ttn
The LoRaWAN Network Servers in The Things Stack Community Edition uses software which can be found at:
github.com/TheThingsNetwork/lorawan-stack
The Things Stack Community Edition (V3), compared to The Things Network (V2), is more scalable and more secure.
It supports all LoRaWAN classes (A, B, C) and multicast device groups, all existing LoRaWAN versions (including v1.0.4 and v1.1) and all regional parameters as defined by the LoRa Alliance (lora-alliance.org/).
For more differences between V2 and V3, see:
thethingsindustries.com/docs/getting-started/migrating/major-changes
The Things Network (V2) will no longer be actively maintained by The Things Industries and the cluster of LoRaWAN Network Servers are going to be shut down by the end of 2021.
The console for The Things Network (V2)(Shutdown by the end of 2021):
console.thethingsnetwork.org
The console for The Things Stack Community Edition (V3):
https://console.cloud.thethings.network/
The Things Stack (TTS) Community Edition direct console links:
North America: https://nam1.cloud.thethings.network/console
Europe: https://eu1.cloud.thethings.network/console
Australia: https://au1.cloud.thethings.network/console
More information:
thethingsindustries.com/docs/getting-started/ttn/addresses
General information about migrating from V2 to V3, see:
thethingsindustries.com/docs/getting-started/migrating
Migrate few end devices with The Things Stack Community Edition Console, see:
thethingsindustries.com/docs/getting-started/migrating/migrating-from-v2/migrate-using-console
Migrating many end devices using the migration tool:
thethingsindustries.com/docs/getting-started/migrating/migration-tool
Migrate gateway, see:
thethingsindustries.com/docs/getting-started/migrating/gateway-migration
PROCEDURE MIGRATE DEVICE FROM V2 TO V3
- Select Over The Air Activation (OTAA). Note: I will not demonstrate ABP.
- Choose LoRaWAN version MAC V1.0.2 (this is the version used in V2)
- Create an End device ID (does not have to match the Device ID in V2)
- Copy end device’s AppEUI and DevEUI (these have to be the same as the ones in V2)
- Select your Frequency plan
- Select Regional Parameters version PHY V1.0.2 REV B (this is the version used in V2)
- Keep the default Advanced settings as OTAA devices commonly negotiate about these with The Things Stack Network Server
- Copy your end device’s AppKey (has to match the one in V2)
- Change the AppKey in V2 (To prevent OTAA device from re-joining V2 network).
- If applicable copy and modify your payload formatters.
The LoRaWAN version is the LoRa Alliance LoRaWAN specification your device conforms to, which defines which Media Access Control features it supports. The LoRaWAN version for your device should be provided by the manufacturer in a datasheet as LoRaWAN version or LoRaWAN specification.
The most commonly used LoRaWAN versions are v1.0.2 and v1.0.3.
The Things Network V2 uses v1.0.2 by default.
The Things Network V2 uses Physical Layer (PHY) v1.0.2 Rev B
More information about regional parameters, see:
lora-alliance.org/resource-hub
The Packet Broker is a service which allows LoRaWAN networks to exchange traffic.
It is run by an independent and neutral organisation.
More information:packetbroker.net/thethingsindustries.com/docs/reference/packet-broker
PROCEDURE MIGRATE GATEWAY FROM V2 to V3
- Change the server address on the gateway itself (eg: global_conf.json)
- In the V3 console, select Add gateway
- Create an Gateway ID (does not have to match the Gateway ID in V2)
- Enter Gateway EUI (If your gateway has a gateway eui)
- Select your Frequency plan
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
Dit is deel 9 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 8 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 7 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 6 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 5 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 4 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 3 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 2 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 1 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
Dit is deel 0 van de BTW cursus.
Deze presentatie kunt u vinden op de onderstaande link:
mobilefish.com/tutorials/btw/btw.html
De BTW cursus playlist:
youtube.com/playlist?list=PLmL13yqb6Oxer1vhPDgf1By3nhgLVzg8H
#mobilefish #btw #belastingdienst
youtube.com/c/mobilefish/about
This is part 50 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain the different types of enclosures and what IP ratings are.
This subject is not specific LoRa or LoRaWAN related but I find it interesting enough to make a tutorial.
Your electronic project can be put inside an enclosure.
These enclosures are called:
- project boxes,
- PVC boxes (PVC = Poly Vinyl Chloride),
- ABS boxes (ABS = Acrylonitrile Butadiene Styrene)
- plastic boxes,
- electronic boxes,
- etc...
These enclosures are made of plastic or a metal.
When plastic is used, it is often ABS or PVC.
ABS is always black and PVC is white or grey.
ABS and PVC can be used above or below the ground, but ABS is more likely to deform when exposed to the sun.
Both plastics are resistant to chemical and water degradation.
ABS is highly durable with high impact strength.
PVC is less durable, it is flexible and softer than usual plastics.
For metal enclosures often steel, stainless steel or aluminium is used.
LoRaWAN outdoor gateways often uses PVC or die cast aluminium enclosures.
Die casting is a metal casting process where molten metal, under high pressure, is forced into a mould cavity.
There is no international standard for these enclosures.
If you have a 3D printer you can print your own enclosure or you can just buy one.
Enclosures have:
- no mounting possibilities or
- have some slots to slide appropriately sized PCBs or
- have built-in standoffs to attach the PCB using self-tapping screws.
If there are no mounting possibilities, drill holes in the enclosure and attach the PCB to the enclosure with screws and standoffs.
IP (Ingress Protection) ratings defines level of sealing effectiveness of electrical enclosures against intrusion from solids (hand, tool, dirt, etc.) and water.
IP ratings are defined in the International Standard EN 60529.
The IP rating consists of two numbers.
The first number specifies the level of protection against solids, the second number specifies the level of protection against water, for example IP67.
IP ratings are assessed in lab conditions, which means they can’t always account for real-life situations.
Some manufacturers err on the side of caution and will not highlight a product’s IP rating or will understate the level of protection.
RakWireless outdoor gateway enclosure - 5x N-type antenna connectors
store.rakwireless.com/products/outdoor-gateway-enclosure
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 51 of the LoRa/LoRaWAN tutorial.
In this tutorial I will demonstrate how to configure the RAK7244C Developer Gateway.
This presentation can be found at:
mobilefish.com/download/lora/lora_part51.pdf
LoRa Gateway Developer kit without the aluminium enclosure.
store.rakwireless.com/collections/lora-products/products/lorawan-starter-kit
RAK7243 and RAK7243C Developer Gateway.
- No LTE functionality: RAK7243 Developer Gateway.
- With LTE functionality: RAK7243C Developer Gateway.
doc.rakwireless.com/rak7243--lorawan----developer-gateway
doc.rakwireless.com/rak7243c-lorawan----developer-gateway
Shop: store.rakwireless.com/products/rak7243c-pilot-gateway
RAK7244 and RAK7244C Developer Gateway.
- No LTE functionality: RAK7244 Developer Gateway.
- With LTE functionality: RAK7244C Developer Gateway.
doc.rakwireless.com/rak7244-lorawan----developer-gateway
doc.rakwireless.com/rak7244c-lorawan----developer-gateway
Shop: store.rakwireless.com/collections/lora-gateways-concentrators/products/rak7244-developer-lorawan-gateway
RAKWireless has their own online web store:
store.rakwireless.com
On AliExpress the store is called RAK Wireless Store:
aliexpress.com/store/2805180
RAK7244C FEATURES
Aluminium enclosure with Raspberry Pi4
Full LoRaWAN Stack support version 1.0.2
Supports for 8 channels and spreading factors (SF7-SF12)
Band support: 433MHz, 470MHz, 865MHz, 868MHz,
915MHz, 920MHz, 923MHz
Tx Power max: 27 dBm
Rx Sensitivity: -139 dBm
Ublox MAX-7Q GPS module
Quectel EG95 LTE module
Datasheet
doc.rakwireless.com/datasheet/rakproducts/rak7244c-lorawan-developer-gateway-datasheet
The RAK7244C Quick Start Guide:
doc.rakwireless.com/rak7244c-lorawan----developer-gateway/quick-start-guide
Software download:
downloads.rakwireless.com/en
RAK7244C firmware:
downloads.rakwireless.com/en/LoRa/Developer-LoRaWAN-Gateway-RAK7244C/Firmware
The firmware RAK7244C(RAK7244_LTE)_based_on_Raspbian_V4.1.0_20191202 has the following software pre-installed.
Raspbian Buster Literaspberrypi.org/downloads/raspbian
Semtech LoRa library (V5.0.1)
github.com/Lora-net/lora_gateway /opt/ttn-gateway/lora_gateway
Semtech UDP Packet Forwarder (V4.0.1)
github.com/Lora-net/packet_forwarder /opt/ttn-gateway/packet_forwarder
RakWireless Github:
github.com/RAKWireless
The firmware source code:
github.com/RAKWireless/rak_common_for_gateway
Quectel EG95 is a series of LTE category 4 module optimised specially for M2M and IoT applications.
More information: quectel.com/product/eg95.htm
Quectel EG95 has 4 variants: EG95-E, EG95-NA, EG95-EX, and EG95-NAX.
RAK7244C LoRaWAN gateway supports EG95-E or EG95-NA.
RAK7244C cellular antenna parameters:
doc.rakwireless.com/datasheet/rakproducts/antenna-specifications---rak7244
The RakWireless shop offers different antennas with better gains, see:
store.rakwireless.com/collections/antennas
More information about the Quectel EG9x AT commands:
quectel.com/UploadImage/Downlad/Quectel_EG9x_AT_Commands_Manual_V1.1.pdf
When an end device transmits sensor data, the LoRaWAN gateway does not only transmit this data to the cellular network it also adds meta data to the sensor data.
Besides the sensor data the LoRaWAN gateway also:
- transmits at regular time interval (stat_interval) the gateway status to the LoRaWAN network server (See tutorial 29).
- transmits at regular time interval (keepalive_interval) a keep alive message to the LoRaWAN network server (See tutorial 29).
Both intervals are set in the global_conf.json or local_conf.json file.
In both cases acknowledge messages are send back from the LoRaWAN network server to the LoRaWAN gateway.
The LoRaWAN network server can also send downlink (DL) responses back to LoRaWAN gateway.
The cellular data usage not only depends on the actual sensor data size and response data size but it also depends on the stat_interval, keepalive_interval settings and of course how often sensor data and responses are transmitted.
The RAK7243C and RAK7244C LoRaWAN gateway can not whitelist end nodes.
This means when using the cellular backhaul, you will also pay for cellular data packages from other end nodes not owned by you.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 49 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a Moxon antenna is and how to build one.
The Moxon antenna is a simple and mechanically robust two-element parasitic array antenna created by amateur radio operator Les Moxon.
This directional antenna is equivalent to a two element Yagi-Uda antenna.
It has a reflector and a driven element but no directors.
The two elements are mechanically connected by two insulators.
The antenna has a large beam width and a very good Front-To-Back ratio.
To find the Moxon antenna dimensions you can use the following calculators:
Online calculator:http://tippete.net/cgi-bin/moxgen.pl
Windows program:ac6la.com/moxgen1.html
I have used the 4NEC2 antenna modelling software to verify the design.
4NEC2 card deck:mobilefish.com/download/lora/moxon_868mhz_4nec2.nec.txt
How well does my self build Moxon antenna performs?
To answer this question, two performance tests will be conducted.
Performance test A:
The Moxon antenna is attached to an end node, which is located inside a building, and transmit messages which will be received by nearby gateways in my area.
In this test I am only interested which gateways were able to receive the transmitted sensor data.
The test will be repeated using a sleeve dipole antenna.
Performance test B:
The Moxon antenna is attached to an end node and transmit messages which will be received by a dedicated gateway 6 meters away.
Both devices are indoors.
The average RSSI is calculated.
The test will be repeated using a ½λ dipole antenna.
Performance test A and B are simple tests and will give me a ROUGH INDICATION how well my antenna performs compared to the dipole antenna.
Both tests are conducted indoors which means the walls reflects the transmitted signals thus influencing the measurements.
Therefore take the results with a grain of salt!
A much better method to tell how your antenna actually performs in the real world, see this procedure:
github.com/LoRaTracker/AntennaTesting
The Moxon antenna performance is compared with a sleeve dipole antenna.
More information about sleeve dipole antennas, see tutorial 43.
For this test I am using the end node and antenna C as demonstrated in tutorial 33.
More information about this end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
Performance test A
I have NOT modified the end node transmission power when using the Moxon antenna.
The Moxon antenna is attached to the end node at location A and transmits data.
I have done the same with the sleeve dipole antenna.
In both cases two messages per minute were transmitted.
Both logged data can be found at:
mobilefish.com/download/lora/moxon_test_results.txt
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
Performance test B
Make sure you keep everything in your setup the same when switching from the Moxon antenna to the ½λ dipole antenna.
A slight change can impact your measurements.
- Do not change the height of the end node and the height of the gateway.
- Do not change the distance between end node and the gateway.
- Use the exact same end node and gateway.
- Use the same coax cables and connectors.
- During the measurements I did not stay in the same room.
- The distance between transmitter and receiver should be greater than 4λ (Far field region)
The ½λ dipole antenna used in this setup, see tutorial 41.
The logged data can be found at:
mobilefish.com/download/lora/moxon_antenna_gain.txt
In both cases one message per minute were transmitted.
The average RSSI when using the ½λ dipole antenna: -26.5 dBm
The average RSSI when using the Moxon antenna: -22.2 dBm
Conclusion
Based on the average RSSI test results and the results from performance test A, the Moxon antenna performs better compared to the sleeve dipole antenna.
but the Moxon antenna is a directional antenna, you need to point it to the correct direction.
The sleeve dipole antenna is an omnidirectional antenna.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 48 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a Yagi-Uda antenna is and how to build one.
The Yagi-Uda antenna, also known as Yagi antenna, is a directional high gain antenna.
A basic Yagi-Uda antenna consists of three elements.
A reflector, a driven element and a director.
The driven element is a half wave dipole and parallel to the driven element on either side of it, are straight wires, the reflector and the director.
The reflector is slightly longer than 1/2 wavelength, the driven element is 1/2 wavelength long and the director is slightly shorter than 1/2 wavelength.
I used an online Yagi-Uda antenna calculator to calculate the antenna dimensions:
rfwireless-world.com/calculators/3-element-Yagi-Antenna-Calculator.html
I have used the 4NEC2 antenna modelling software to verify the design.
mobilefish.com/download/lora/yagi_868mhz_4nec2_before_optimisation.nec.txt
Next I used the 4NEC2 optimising functionality to improve the design.
mobilefish.com/download/lora/yagi_868mhz_4nec2_after_optimisation.nec.txt
Performance test A:
The Yagi-Uda antenna is attached to an end node, which is located inside a building, and transmit messages which will be received by nearby gateways in my area.
In this test I am only interested which gateways were able to receive the transmitted sensor data.
The test will be repeated using a sleeve dipole antenna.
Performance test B:
The Yagi-Uda antenna is attached to an end node and transmit messages which will be received by a dedicated gateway 6 meters away.
Both devices are indoors.
The average RSSI is calculated and also the total time it took to receive 15 messages.
The test will be repeated using a ½λ dipole antenna.
Performance test A and B are simple tests and will give me a ROUGH INDICATION how well my antenna performs compared to the dipole antenna.
Both tests are conducted indoors which means the walls reflects the transmitted signals thus influencing the measurements.
Therefore take the results with a grain of salt!
A much better method to tell how your antenna actually performs in the real world, see this procedure:
github.com/LoRaTracker/AntennaTesting
Performance test A:
The Yagi-Uda antenna performance is compared with a sleeve dipole antenna.
More information about sleeve dipole antennas, see tutorial 43.
For this test I am using the end node and antenna C as demonstrated in tutorial 33.
More information about this end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
I have NOT modified the end node transmission power when using the Yagi-Uda antenna.
In my area there are several gateways and I know that these gateways, which are connected to The Things Network, can receive my transmitted data.
The Yagi-Uda antenna is attached to the end node at location A and transmits data.
I have done the same with the sleeve dipole antenna.
In both cases two messages per minute were transmitted.
The logged data can be found at:
mobilefish.com/download/lora/yagi_uda_test_results.txt
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
Performance test B:
Make sure you keep everything in your setup the same when switching from the Yagi-Uda antenna to the ½λ dipole antenna.
The logged data can be found at:
mobilefish.com/download/lora/yagi_uda_antenna_gain.txt
The average RSSI when using the ½λ dipole antenna: -28.0 dBm
The average RSSI when using the Yagi-Uda antenna: -22.1 dBm
The time it took for the gateway to receive the 15 messages from the end node:
Using the ½λ dipole antenna: 15 minutes
Using the Yagi-Uda antenna: 15 minutes
The Arduino sketch is configured to transmit 1 message per minute.
Conclusion:
Based on the average RSSI test results and the results from performance test A, the Yagi-Uda antenna performs better compared to the sleeve dipole antenna.
but the Yagi-Uda antenna is a directional antenna, you need to point it to the correct direction.
The sleeve dipole antenna is an omnidirectional antenna.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 47 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain the pros and cons of using PCB antennas and ceramic antennas.
In an RF system the antenna is a key component and can have a major impact on the device performance.
Selecting which antenna to use depends on: size of the device, costs and performance.
In general PCB antennas (aka trace antennas) and ceramic antennas (aka chip antennas) have an average antenna performance compared to an external antenna.
External antenna
An external antenna is mounted outside the device or it can be mounted on a remote location.
PCB or ceramic antennas are internal antennas and are built inside the device.
Pros:
- Good antenna performance compared to PCB or ceramic antennas.
Cons:
- Larger size.
- More expensive compared to PCB or ceramic antennas.
PCB antenna
A PCB antenna is a trace antenna printed on a circuit board.
A PCB antenna is feeded by a micro strip line from the radio module.
Pros
- Smaller size.
- Cheaper to manufacture.
- Costs less than an external antenna and ceramic antenna.
Cons
- Average antenna performance compared to an external antenna.
- Components in close proximity of the antenna severely detune the antenna.
An area around the antenna must be kept clear of components.
- A PCB antenna is highly susceptible to environmental interferences, for example when it is in close proximity of humans or animals.
- A PCB antenna can only be tuned by redesigning and manufacturing the PCB board again.
- Designing a PCB antenna requires a simulation tool.
To create a PCB antenna, check out this PCB UCA antenna layout created by Fabien Ferrero:
github.com/FabienFerrero/UCA_Board
Check out his presentation at the Things Conference in Amsterdam in 2018 where he discusses the UCA antenna layout:
youtu.be/AhFy4-kForA
Ceramic antenna
A ceramic antenna (aka chip antenna) is a small module made of a ceramic material.
Pros
- Smaller size compared to a PCB antenna.
- Components in close proximity of the ceramic antenna does not cause severe detuning.
- A ceramic antenna is less susceptible to environmental interferences (humans or animals).
- Less PCB area is needed compared to a PCB antenna.
- A ceramic antenna can be tuned or even replaced without redesigning the PCB board.
Cons
- Average antenna performance compared to an external antenna.
- A ceramic antenna costs more compared to a PCB antenna.
Performance tests
A PCB, ceramic and monopole antenna performance is compared with a sleeve dipole antenna.
For the PCB antenna test, the Things UNO is used.
For the ceramic antenna test, the Things UNO (Beta version) is used.
For the monopole antenna test, the monopole antenna is used as described in tutorial 42.
For the sleeve dipole antenna, antenna C is used as demonstrated in tutorial 33 and 43.
For both The Things Uno (with PCB antenna) and The Things Uno Beta (with ceramic antenna) the same sketch is used:
mobilefish.com/download/lora/SendOTAA.ino.txt
More information about this sketch and which libraries to use, see:
youtu.be/28Fh5OF8ev0
The sketch transmits 10 messages per minute.
For both the monopole antenna and sleeve dipole antenna tests the same end node is used, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
The sketch is modified to transmit 2 messages per minute.
For all four tests the transmission power is not modified and all the devices are positioned at the same location.
The logged data can be found at:
mobilefish.com/download/lora/pcb_ceramic_antenna_test_results.txt
Note: I am only interested which gateways have received the transmitted data.
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
The sleeve dipole antenna clearly has a better performance compared to the PCB, ceramic and monopole antenna.
My conclusion is: PCB, ceramic and monopole antennas are great antennas for short distances.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 46 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a collinear antenna is and how to build one.
A collinear antenna is actually an array of dipole antennas stacked one above the other so that they are all in a straight line, i.e., "co linear."
On internet you can find several designs how to build a collinear antenna:
Collinear antenna 1
thethingsnetwork.org/forum/t/diy-external-antenna-for-gateway/3011
Collinear antenna 2
github.com/IRNAS/ttn-irnas-gw
I have build both antennas and will demonstrate how these antennas performs in this tutorial.
Please note: I have made some modifications to both designs.
Collinear antenna 1 4NEC2 card deck:
mobilefish.com/download/lora/collinear_868mhz_4nec2.nec.txt
A more accurate procedure how your antenna actually performs in the real world:
github.com/LoRaTracker/AntennaTesting
More information about the end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
Google map with gateway locations:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
Collinear antenna 1 performance test A logged data:
mobilefish.com/download/lora/collinear_test_results.txt
Collinear antenna 1 performance test A tilted logged data:
mobilefish.com/download/lora/collinear_test_results2.txt
Collinear antenna 1 performance test B logged data:
mobilefish.com/download/lora/collinear_antenna_gain.txt
Collinear antenna 1 conclusion
Based on the results of performance test A and B, I conclude that the collinear antenna 1 performance is quite similar to the ½λ dipole antenna.
If I ONLY look at elevation angles (α) between -1° and 3°.
This assumption is supported by comparing the 4NEC2 radiation pattern in the vertical plane between the ½λ dipole antenna and the collinear antenna 1 at elevation angles (α) between -1° and 3°.
Collinear antenna 2 4NEC2 card deck:
mobilefish.com/download/lora/collinear2_868mhz_4nec2.nec.txt
Collinear antenna 2 performance test A logged data:
mobilefish.com/download/lora/collinear2_test_results.txt
Collinear antenna 2 performance test B logged data:
mobilefish.com/download/lora/collinear2_antenna_gain.txt
Collinear antenna 2 conclusion
Based on the results of performance test A and B, I conclude that the collinear antenna 2 performance is much better compared to the ½λ dipole antenna.
More gateways in my area were able to receive the transmitted sensor data.
This is also collaborated looking at the 4NEC2 radiation pattern in the vertical plane and the fact that all my nearby gateways operates at an elevation angle (α) between -1° and 3°.
Collinear antenna 2 has a better antenna performance compared to collinear antenna 1.
More gateways were able to receive the transmitted sensor data using collinear antenna 2 compared to collinear antenna 1.
Collinear antenna 2 has a higher gain at elevation angles between -1° and 3° compared to collinear antenna 1, according to the 4NEC2 radiation patterns in the vertical plane.
The 4NEC2 program simulates how the antenna behaves but MY collinear antennas are not accurately modelled.
Which means that the generated radiation patterns and other antenna parameters are just a rough indication of how the real collinear antennas behaves.
If you want accurate radiation patterns and other antenna parameters, these antenna measurements should be performed in an anechoic chamber.
If a collinear antenna is put inside a plastic / glass fiber tube, always measure the antenna parameters with an antenna analyser when the antenna is inside the tube.
It is possible to put the collinear antenna inside a PVC tube, but use a thin tube wall.
Gray PVC tubes may contain carbon.
Carbon absorbs or reflect RF signals.
To check if the PVC tube contains carbon, you can apply the "microwave" method.
The microwave method is explained at:
thethingsnetwork.org/forum/t/diy-external-antenna-for-gateway/3011/17
WARNING: IF YOU APPLY THE MICROWAVE METHOD, IT MAY DESTROY YOUR MICROWAVE. DO THIS AT YOUR OWN RISK!
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 45 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a normal mode helical antenna is.
In literature the coil antennas are called helical antennas and are invented by John D. Kraus.
Helical antennas can be made to operate in one of two ways: normal mode or axial mode.
Spreadsheet:
mobilefish.com/download/lora/helical.ods
In axial mode, the antenna is circular polarised and radiates in the direction of the helix.
These antennas are directional.
The diameter (D) and pitch (S) of these helical antennas are roughly comparable to the wavelength.
Axial mode helical antenna card deck:
mobilefish.com/download/lora/axial_mode_helical_2.45ghz.nec.txt
In normal mode, the antenna behaves like a monopole antenna (see tutorial 42) but are smaller in size and produces an omnidirectional radiation pattern, and is linear polarised.
The diameter (D) and pitch (S) of these helical antennas are small in comparison to the wavelength.
As mentioned earlier I created a YouTube video: "How to create a copper 868MHz coil antenna"
youtu.be/5d2GJOVMWSs
The normal mode helical antenna demonstrated in the YouTube video is based on:
http://www.professor.com.tw/upLoad/product/month_1402/201402251742447302.pdf
Based on the above mentioned design I have created an antenna model in the 4NEC2 program.
4NEC2 card deck:
mobilefish.com/download/lora/normal_mode_helical_868mhz_professor_technology_4nec2.nec.txt
I could not verify if this normal mode helical antenna is a valid design.
I decided to create my own self designed normal mode helical antenna.
The 4NEC2 card deck:
mobilefish.com/download/lora/normal_mode_helical_868mhz_4nec2.nec.txt
My self build normal mode helical antenna performance is compared with a sleeve dipole antenna.
For this test I am using the end node and antenna C as demonstrated in tutorial 33.
More information about this end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
The logged data can be found at:
mobilefish.com/download/lora/normal_mode_helical_ground_plane_test_results.txt
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
If you look at the results you may notice there is no significant difference in the average RSSI values between the normal mode helical antenna with ground plane and the sleeve dipole antenna.
If you look at the time it took to transmit 15 messages there is almost no difference.
When using the normal mode helical antenna with ground plane it took 8.5 minutes to transmit 15 messages.
When using the sleeve dipole antenna, which is my reference antenna, it also took 8.5 minutes to transmit 15 messages.
But when using the normal mode helical antenna without ground plane it took 14.5 minutes to transmit 15 messages.
Looking at the results I can conclude that my self build normal mode helical antenna with ground plane performs the same as the sleeve dipole antenna.
The normal mode helical antenna without a ground plane does not have a good antenna performance.
A normal mode helical antenna is impossible to build accurately by hand.
If you have to choose between a normal mode helical antenna or just a monopole antenna, I would choose a monopole antenna, because a monopole is easier to make.
But if a monopole does not fit inside a container, than try a normal mode helical antenna.
These antennas are smaller in length.
If your project allows you to use a sleeve dipole antenna (see tutorial 43) I would prefer using a sleeve dipole antenna above a monopole or normal mode helical antenna.
A normal mode helical antenna behaves like ¼λ monopole antenna.
Without a good ground plane the antenna will not perform well as explained in tutorial 42.
If you use a ¼λ monopole antenna or normal mode helical antenna without a good ground plane the signal can be transmitted over a distance of 100 m or even more.
But if the distance is increased the signal will be weaker with increase data package loss.
This is based on my experiments and situation.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 44 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain how to build a ¼ wave ground plane antenna.
The ¼ wave ground plane antenna (aka spider antenna) has radials.
Often four ¼ wave radials are used to sufficiently simulate a complete circular conductive ground plane which works as a reflector as already explained in tutorial 42.
The current in the reflected image has the same direction as the current in the real antenna.
If the radials are straight, meaning not bend, the impedance at the feed point will be around 37Ω.
If the radials are bend down at an angle of 40° the impedance at the feed point will be around 50Ω.
The ¼ wave ground plane antenna is an unbalanced antenna thus a 50Ω coax cable, which is an unbalanced feed line, can be directly attached to it.
The ¼ wave ground plane antenna has only one radiating element which is fed in the lower end which is near the conductive surface.
The radiating element length LRadiating = ¼ x λ and the radials are slightly longer.
The radiating element is also called the driven element, radiator or resonator.
4NEC2 card deck:
mobilefish.com/download/lora/quarter_wave_ground_plane_868mhz.nec.txt
Please be aware that the generated radiation patterns are merely a ROUGH indication how the real quarter wave ground plane antenna behaves.
The real quarter wave ground plane antenna is not 100% accurately modelled.
If you want accurate radiation patterns of real antennas than the antenna radiation patterns measurements should be performed in an anechoic chamber.
Based on the 4NEC2 antenna model results, the ½ wave dipole antenna has a slightly higher maximum gain compared to the ¼ wave ground plane antenna.
You might think by placing the antenna near the ground you will get the best antenna performance (= higher gain).
But placing the antenna near the ground is not a good idea because of the Fresnel Zone.
If you do not know what the Fresnel Zone is, watch tutorial 7.
¼ wave ground plane antenna pros:
- Provides good performance.
- Easy to build with consistent results.
- Can be used at all frequency bands including LF, MF, HF, VHF and beyond.
- Omnidirectional radiation.
- Vertically polarised signals.
- Low cost.
- Low angle of radiation which means the signal is not directed towards the sky.
- The radiation pattern is fairly uniform both vertically and horizontally.
¼ wave ground plane antenna cons:
- It requires a ground plane (radials)
- A ½ wave dipole antenna has a slightly higher maximum gain compared to a ¼ wave ground plane antenna.
The ¼ wave ground plane antenna performance is compared with a sleeve dipole antenna.
More information about sleeve dipole antennas, see tutorial 43.
For this test I am using the end node and antenna C as demonstrated in tutorial 33.
More information about this end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
I have NOT modified the end node transmission power when using the ¼ wave ground plane antenna.
In my area there are several gateways and I know that these gateways, which are connected to The Things Network, can receive my transmitted data.
The ¼ wave ground plane antenna is attached to the end node at location A and transmits data.
I have done the same with the sleeve dipole antenna.
In both cases two messages per minute were transmitted.
The logged data can be found at:
mobilefish.com/download/lora/quarter_wave_ground_plane_test_results.txt
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
If you look at the results you may notice there is no significant difference in the average RSSI values.
When using the ¼ wave ground plane antenna it took 17.5 minutes to transmit 30 messages.
When using the sleeve dipole antenna, which is my reference antenna, it took 18.5 minutes to transmit 15 messages.
The Arduino sketch is configured to transmit 2 messages per minute.
So looking at the results I can conclude that my self build ¼ wave ground plane antenna performs the same as the sleeve dipole antenna.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 43 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a sleeve dipole antenna is.
Just like a dipole antenna, a sleeve dipole antenna has two elements.
One element is attached to the coax cable centre conductor.
The other element which is a metal tube (sleeve) is around the coax cable.
The sleeve is attached to the coax cable metallic shield.
The sleeve dipole antenna is also know under several other names: vertical sleeve antenna, coaxial sleeve antenna, etc.
The sleeve dipole antenna is a balanced antenna just like an ordinary dipole antenna.
The sleeve dipole antenna is fed by a coax cable which is an unbalanced feed line.
Normally in such a case a balun is needed.
In this case however the sleeve acts as a balun which counter the effects of the current returning back along the outer braid of the coax cable (antenna current).
The sleeve dipole antenna has the same donut shape radiation pattern as the normal dipole antenna (in free space).
A sleeve dipole antenna has a gain of 2.15 dBi (= 0 dBd)
When buying an antenna: Beware many antennas do not work as advertised!
Use an antenna analyser, such as the N1201SA, to check the antenna (see tutorial 40).
The modified sleeve dipole antenna B performance is compared with sleeve dipole antenna C.
More information about this end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
I have NOT modified the end node transmission power when using both sleeve dipole antennas.
Both sleeve dipole antennas were positioned at location A and in both cases two messages per minute were transmitted.
The logged data can be found at:
mobilefish.com/download/lora/sleeve_dipole_comparison.txt
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
If you look at the results you may notice there is no significant difference in the average RSSI values.
When using the modified antenna B it took 9 minutes to receive 15 messages.
When using antenna C, which is my reference antenna, it took 11.5 minutes to receive 15 messages.
This difference is caused by the limited number of measurements.
Once more measurements were taken there was no significant difference in time.
The Arduino sketch is configured to transmit 2 messages per minute.
In a perfect situation it should take 7.5 to 8 minutes to receive these 15 messages.
Looking at the results I can conclude that both sleeve dipole antennas performs the same.
If possible connect the antenna directly to the end node without the use of a coax cable.
Each connector/cable used is additional loss.
Watch out! An antenna which looks like this does not necessarily mean it is a sleeve dipole antenna.
A nice Youtube tutorial how to build your own sleeve dipole antenna:
youtu.be/hK0KX0YcvH0
You get different results when the sleeve dipole antenna is folded or not.
Measure the antenna parameters in both states.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 42 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a monopole antenna is and why a ground plane is needed.
A ½λ dipole antenna has two elements (each element L = ¼λ), but a monopole antenna has only one element (L = ¼λ).
A monopole antenna relies on a good conducting plane for its operation.
This plane is used as a mirror to create a "second imaginary" element.
The ground (earth) is a conductor and RF energy is reflected from the ground.
The monopole antenna performance can be improved by using a plane made of a better conductive material instead of using the earth itself.
This conducting plane is called the ground plane or counterpoise.
The ground plane must have a radius greater than ½ wavelength from the base of the monopole antenna.
For a ¼λ monopole antenna the reflected radiation from the ground is in phase with the direct radiation.
The receiving antenna (RX) gets energy from the direct path AND from the reflected path which is in phase.
A ¼λ monopole antenna will have twice the gain (3 dB) of a ½λ dipole antenna (in free space).
A ½λ dipole antenna has a gain (G) of 1.64 and an impedance (Z) of 73 Ω at its centre, which is the radiation resistance.
A ¼λ monopole antenna has a gain (G) of 2.15 + 3 = 5.15 dBi (or 3 dBd) and a radiation resistance of 0.5 x 73 = 36.5 Ω when positioned over a large conductive ground plane.
½λ dipole antenna 4NEC2 card deck:
mobilefish.com/download/lora/dipole_freespace_868mhz_4nec2.nec.txt
¼λ monopole antenna 4NEC2 card deck:
mobilefish.com/download/lora/monopole_ground_plane_868mhz_4nec2.nec.txt
By default a monopole antenna will perform poorly without the use of a ground plane.
A ground plane can be a network of horizontal wires or a metal plate.
More information about the end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
One or more gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
The logged data can be found at:
mobilefish.com/download/lora/monopole_test_results.txt
mobilefish.com/download/lora/monopole_radials_test_results.txt
A ¼λ monopole without ground plane has a bad antenna performance.
A ¼λ monopole with ground plane with a radius GREATER than ½λ has a good antenna performance.
As demonstrated using a metal plate (radius greater than ½λ) or radials as the ground plane produces approximately the same result.
Using radials is often preferred:
- The radials are lighter than a metal plate.
- The radials are cheaper than a metal plate.
- The radials are more resistant to weather conditions (wind, rain).
When using a metal plate or radials as a ground plane, in both cases the impedance is around 75Ω instead of 50Ω.
When radials are used, bend it to a certain angle and the impedance will be 50Ω and the VSWR will remain below 2.
The effect of a ground near any antenna (for example: monopole, dipole, Yagi-Uda, Moxon, etc) can be significant.
The antenna performance can be positive or negative.
The effect can be simulated using an antenna modelling software (see tutorial 38).
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 41 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what a dipole antenna is.
A dipole antenna is the simplest and most widely used class of antenna.
A dipole antenna consists of two identical conductive elements such as copper wires, rods or tubes.
The two elements contribute to the radiation.
If the total length of the dipole is ½ wavelength, than each element has a length of a ¼ wavelength.
When we speak of a ½λ dipole antenna, the total length of the antenna is a ½λ.
A nice animation where you can see the radiation pattern vs current distribution when you increase the dipole length:
youtu.be/edyFGAT_87o
The equation to calculate the wavelength:
c = λ x f
c = speed of light = 299792458 m/s
λ = wavelength in m
f = frequency in Hz
If antenna f = 868 MHz:
λ = c / f = 299792458 / 868000000 = 0.34538 m = 345.38 mm
As explained earlier a ½λ dipole is a good antenna.
This means both elements of the antenna are 0.25 λ in length.
If f = 868 MHz and λ = 345.38 mm, L= 0.5 x 345.38 = 172.69 mm
Do not forget the velocity factor.
If the dipole is made of stainless steel (VF=0.9): l = 0.9 x 172.69 = 155 mm
A ½λ dipole antenna has a power gain of 1.64 (or 2.15 dBi) over an isotropic antenna (see tutorial 39).
At its feed point ½λ dipole antenna has an impedance consisting of 73 Ω resistance (R) and a reactance of 42.5 Ω (X).
4NEC2 card deck:
mobilefish.com/download/lora/dipole_vertical_868mhz_4nec2.nec.txt
Note:
Initially the length was set to 0.155 m then I used the 4NEC2 optimising functionality to improve the design.
The optimised length = 0.160 m.
The 4NEC2 model element length = 160 mm.
The real ½λ dipole antenna length = 146 mm (= 2 x 73 mm).
I used the N1201SA Vector Impedance Analyser to tune the antenna.
Why this discrepancy?
The real antenna is not 100% accurately modelled in the 4NEC2 program.
Think of the gap between the elements, terminal with screws, the type N female chassis.
All these influences the antenna behaviour.
Please be aware that the generated radiation patterns are merely a ROUGH indication how the real dipole antenna behaves.
As explained earlier the real ½λ dipole is not 100% accurately modelled.
If you want accurate radiation patterns of real antennas than the antenna radiation patterns measurements should be performed in an anechoic chamber.
The ½λ dipole antenna performance is compared with a sleeve dipole antenna.
More information about sleeve dipole antennas, see tutorial 43.
For this test I am using the end node and antenna C as demonstrated in tutorial 33.
More information about this end node, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html
The end node uses the MCCI LoRaWAN LMIC Library:
github.com/mcci-catena/arduino-lmic
The end node uses the following sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
I have NOT modified the end node transmission power when using the ½λ dipole antenna.
In my area there are several gateways and I know that these gateways, which are connected to The Things Network, can receive my transmitted data.
The ½λ dipole antenna is attached to an end node at location A and transmitted data and I have done the same with a sleeve dipole antenna.
In both cases two messages per minute were transmitted.
The logged data can be found at:mobilefish.com/download/lora/dipole_test_results.txt
Several nearby gateways were able to receive my transmitted sensor data, see:
drive.google.com/open?id=18SKbHVEIFHU6YjzYpgZL98vuHcmV4OPQ&usp=sharing
I have conducted another test whereby the ½λ dipole antenna is directly connected to the end device. No coax cable is used.
Again the same tests were conducted using the same ½λ dipole antenna and sleeve dipole antenna at location A.
Two messages per minute were transmitted and both logged data can be found at:
mobilefish.com/download/lora/dipole_test_results2.txt
Note: The tests were conducted approximately 1.5 months later.
The RF coaxial cable with type N male plug right angle to SMA male connector is probably not working correctly.
I have replaced it with another setup.
Looking at the results I can conclude that my self build ½λ dipole antenna performs the same as the purchased sleeve dipole antenna.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 40 of the LoRa/LoRaWAN tutorial.
In this tutorial I will demonstrate the use of the N1201SA Vector Impedance Analyser.
The antenna used by the gateway or end device plays an important role which should not be under estimated.
That is why I am making many videos about this subject.
The VSWR and S11 are the two most important antenna parameters which you can measure with an antenna analyser.
These parameters determines how well an antenna performs.
If you buy devices which includes antennas or you buy the antennas separately, I strongly recommend to measure the antenna parameters.
I have noticed that you can not trust the specified antenna parameters.
If you build your own antenna, you need to measure the antenna parameters.
I have build several antennas for this video series, and more often than not the self build antennas had a VSWR greater than 2.
If I did not had an antenna analyser I would not have know this.
I bought the N1201SA Vector Impedance Analyser because it had good reviews.
There could be better and cheaper antenna analysers out there.
Do your own research!
The N1201SA is presumably made by a Chinese manufacturer called "Accuracy Agility Instrument".
However I could not find any information about this manufacturer.
The N1201SA Vector Impedance Analyser measures the following antenna parameters: VSWR, S11, resistance (R), reactance (X) and impedance (Z).
The N1201SA series has several models: N1201SA, N1201SAC and N1201SA+.
The N1201SA is the basic model which will be demonstrated in this tutorial.
The working frequency of this model is between 137.5 MHz and 2700 MHz.
The analyser has a built-in high capacity lithium ion battery which can be charged using the micro USB port.
The user connects an antenna to the SMA port.
The analyser sends a signal to the antenna.
The analyser measures how much power is reflected back at various frequencies.
As explained in tutorial 33 an antenna with a VSWR smaller than 2 is considered to be a good antenna.
This corresponds to an S11 smaller than -9.5 dB, which means less than 11.1% of the power is reflected back.
The antenna and the N1201SA are sensitive to its environment:
- Avoid nearby walls and objects.
- Avoid nearby electrical equipments (eg: lamps, laptops, mobile phones).
- Place the analyser on a non conductive table.
- Do not touch the analyser, antenna or the cable during measurements.
- Measure the antenna in its final enclosure.
- Preferably measure the antenna parameters at the location where it is used.
To avoid touching the analyser or the antenna during measurement I have build a simple test rig to hold the antenna when measuring the antenna parameters.
The antenna is clamped at the type N plug to SMA connector with coaxial cable.
The clamps are made of plastic.
I use the same test rig when connecting an antenna to my end node.
I have build the test rig with random parts found in my toolbox.
The N1201SA Vector Impedance Analyser can be calibrated using an OSL calibration kit.
The OSL calibration kit need to be purchased separately.
OSL stands for Open, Short and Load.
N1201SA
If the sweep frequency range is large, the measurement value at the specified marker frequency deviates more from the actual value.
If you want a more accurate value reduce the sweep frequency range or use the single point mode.
In single point mode the measured value is always correct for the specified frequency.
In the beginning of this video I have shown you antenna A, B and C.
The same antennas were also mentioned in tutorial 33 but they had different VSWRs.
What might cause these differences?
I have opened these antennas multiple times and have been poking around which might have caused some slight changes.
But I have some ideas how to fix/improve antenna B.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 39 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will:
- again explain the difference between dBi and dBd,
- what an antenna E-plane and H-plane is,
- what the effect is of ground to an antenna,
- what the difference is between main, back and side lobes,
- what antenna gain is,
- what negative antenna gain is,
- what the relationship is between ERP, antenna gain and tx power,
- how to calculate loss using an example,
- what unity gain is,
- what an antenna beam width is,
- what a take of angle is,
- and what a front-to-back ratio is.
An isotropic antenna is a hypothetic (not physically realisable) point source antenna, that radiates its power uniformly in all directions.
An isotropic antenna is considered a lossless antenna which means it has an antenna efficiency of 0 dB (or 100%).
A special tuned ½λ dipole antenna is used as a reference antenna for test purposes.
A reference ½λ dipole antenna has an isotropic gain of 2.15 dBi.
dBi refers to the antenna gain with respect to an isotropic antenna.
If antenna A has a gain of 3 dBi it means antenna A has twice (2x) the power relative to an isotropic antenna in the peak direction.
dBd refers to the antenna gain with respect to a reference ½λ dipole antenna.
If antenna B has a gain of 3 dBd it means antenna B has twice (2x) the power relative to a reference ½λ dipole antenna in the peak direction.
If an antenna manufacturer specifies its antenna gain, it must use the reference i in dBi or d in dBd otherwise you do not know the antenna’s actual gain.
The relationship between dBd and dBi is:
dBi = dBd + 2.15
For a vertical polarised antenna the E-plane coincides with the vertical plane.
For a horizontal polarised antenna the E-plane coincides with the horizontal plane.
The E-plane and H-plane (H refers to the magnetic fields) are 90 degrees apart.
In the E-plane the radiation pattern of a ½λ dipole antenna looks like the number 8 with the maxima perpendicular on the dipole axis.
The radiation pattern is circular in the H-plane for a ½λ dipole antenna.
Please be aware an antenna normally does not operate in free space, unless its actually in deep space.
An antenna has always some ground effect, how much this effect is, depends on the antenna distance to the ground and the ground conductivity.
Main lobe is the lobe containing the highest power.
Opposite of the main lobe is the back lobe.
The other lobes are called the side lobes.
The antenna gain (G) is defined as the maximum radiated power produced by the antenna (Pantenna) main lobe compared to a reference isotropic antenna (Pisotropic) or reference dipole antenna (Pdipole) supplied with the same input power.
An antenna can have a negative gain.
For example an antenna has a gain of -3 dBd or -1.15 dBi
A negative gain means that the antenna radiates less than the reference antenna and a positive number means that the antenna radiates more than the reference antenna.
The reference antenna can be an isotropic or dipole antenna.
The relationship between EIRP and ERP is:
EIRP (dBm) = ERP (dBm) + 2.15
or
EIRP(mW) = 1.64 x ERP (mW)
The maximum ERP = 25 mW for uplink and downlink (slot 1)
The maximum ERP = 500 mW for downlink (slot 2)
Unity gain is the power radiated by the antenna with the equivalent of 1x whatever the input power is.
In other words radiated power equals the input power.
Unity gain means a power gain of 1.
The antenna beam width, also known as half power beam width, is the angle between the half power (-3 dB) points of the main lobe.
The antenna beam width is the area where most of the power is radiated.
The antenna beam width for a reference ½λ dipole antenna is approx. 78°.
The take off angle is the angle where the gain of the elevation plot peaks.
The objective of a directional antenna is to transmit most of its radiated power in the forward direction and minimise its radiated power in the rearward direction.
The Front-to-Back Ratio (FBR) is expressed in dB (e.g. dBi or dBd) and is the forward gain minus the rearward gain.
The higher the FBR, the more directionally efficient the antenna is.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 38 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain what a NEC antenna modelling software is and how to use the 4NEC2 antenna modelling software.
On Internet and YouTube you can find tutorials how to build certain antennas.
But often I wonder what is the performance of these antennas?
What if I use a slightly different wire diameter or slightly change the length of a particular wire?
Will these changes impact the antenna performance significantly of not at all?
Using an antenna modelling software can help you to answer these questions without having to build the actual antenna right away.
NEC (Numerical Electromagnetics Code) is a popular antenna modelling system for wire and surface antennas and simulates the electromagnetic response of antennas and metal structures.
The accuracy of the calculation depends on how well you model the antenna and the information you provide with regard to the ground and wire conductivity.
But be aware, in the real world using the actual antenna, the result will be slightly different compared to the simulation.
This is caused by reflections, weather conditions, where the antenna is mounted etc.
Here are a few NEC antenna modelling software:
EZNEC
Available for Windows.
It has a free and a paid version.
The free version has a 20 segments limit.
http://www.eznec.com
4NEC2
Available for Windows and its free.
This tool has many options.
qsl.net/4nec2
cocoaNEC
Available for MAC OSX and its free.
This tool has limited options.
http://www.w7ay.net/site/Applications/cocoaNEC
The previous mentioned 3 antenna modelling software uses the NEC-2 (Numerical Electromagnetics Code) engine which does all the calculations.
NEC was developed by the Lawrence Livermore National Laboratory in the 1970s and is an antenna modelling system for wire and surface antennas.
More information about NEC-2: nec2.org
The NEC2 documentation is composed of three sections:
Part I: NEC Program Description - Theory
nec2.org/other/nec2prt1.pdf
Part II: NEC Program Description - Code
http://www.radio-bip.qc.ca/NEC2/nec2prt2.pdf
Part III: NEC User's Guide
nec2.org/other/nec2prt3.pdf
NEC2 quick reference:
mobilefish.com/download/lora/nec2_quick_reference.pdf
The length of each segment must be between 5% and 10% of the wavelength.
If the ratio of segment length to wire radius is greater than 8 the NEC engine simulates the current flow in the wire as a very thin current thread.
The NEC engine uses the default "Thin Wire Kernel" (Do not use EK card)
If the ratio is between 2 and 8 the NEC engine should simulate the current to be evenly distributed on the circumference of the wire for a more accurate result.
In this situation you should use the EK card (Extended Thin Wire Kernel).
Never make the ratio go below 2.
4NEC2 software allows inline comments (single quotes) and SYmbol (SY) cards but these are 4NEC2 specific and is NOT part of the NEC2 specification.
Other software such as cocoaNEC will not run when they encounter SY cards.
This card deck can not be run in cocoaNEC because it uses SY cards and inline commands:
mobilefish.com/download/lora/collinear_868mhz_4nec2.nec.txt
You can use arithmetic operators, trigonometric functions, mathematical functions and predefined identifiers in the Symbol cards.
Do not cross wires.
Do not model elements below the ground (z=0).
cocoaNEC has several limitations which other antenna modelling software does not have.
For example: You can not model helixes in the spreadsheet, and helixes are not displayed in the 3D model.
It is important to see all your antenna elements in 3D to verify if your antenna is correctly modelled.
In cocoaNEC and 4NEC2 wire radius can be entered in American Wire Gauge format.
For example: #12
mobilefish.com/download/lora/awg2metric.pdf
More information about 4NEC2:
qsl.net/4nec2
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 37 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain:
What balanced and unbalanced feed lines are,
What balanced and unbalanced antennas are,
And what the purpose is of a balun.
Feed lines can be divided into balanced and unbalanced feed lines.
A balanced feed line consists of two conductors of the same type.
Current flows in opposite direction.
The generated electromagnetic fields cancels each other out.
A ladder line (twin lead with rectangular openings) is a balanced feed line.
Ladder lines are used for example in amateur radio systems.
An unbalanced feed line has a single conductor.
A coax cable is an unbalanced feed line.
In LoRa systems coax cables are used.
Antennas can be divided into balanced and unbalanced antennas.
In general (in most but not all cases) a balanced antenna has more than one element which are fed and are of equal length.
An unbalanced antenna has only one element which is fed.
If a coax cable is used to feed a balanced antenna, a small amount of current (lets call it stray current) can flow back along the metallic shield of the coax cable.
The metallic shield acts like an antenna generating RF interference impacting the antenna itself as well as electrical systems nearby.
A balun prevents stray current to flow back along the metallic shield of the coax cable.
A balun can also have another function.
It can be used to connect lines of different impedance.
It can fix the impedance mismatch between feed line and antenna feed point.
For example a dipole antenna feed point has an impedance of 75Ω and the coax cable has an impedance of 50Ω.
By using a 1.5:1 balun the impedance is converted from 50Ω to 75Ω (1.5 x 50Ω = 75Ω)
A dipole antenna can operate satisfactorily without the use of a balun.
It has no significant effect on the VSWR but there may be a slight increase risk of interference if one is not used.
In portable, handheld and IoT applications, tiny low power UHF baluns can be used.
UHF means Ultra High Frequency.
UHF frequency range is: 300 MHz - 3 GHz
Examples how to use a balun:
https://www.kolins.cz/dipole-antenna-with-balun/
youtu.be/HI3twUISD30
A balun is a balanced to unbalanced transformer.
It takes the unbalanced input from a coax cable and provides a balanced output for the balanced antenna.
A balun is not needed when:
- balanced feed line feeds a balanced antenna
- unbalanced feed line feeds an unbalanced antenna
A balun should be used when:
- balanced feed line feeds an unbalanced antenna
- unbalanced feed line feeds an balanced antenna
In the previous slides I have shown some of my self build antennas.
I have not used baluns.
An antenna can operate satisfactorily without the use of a balun but there may be a slight increased risk of interference if one is not used.
My self build antennas are not properly constructed and the antenna performance can be improved by using better materials, parts or another way of construction.
The antennas in this LoRa/LoRaWAN tutorial series are mainly intended for educational purpose.
My antennas are constructed in such a way so it can be easily disassembled and its parts can be re-used in other antenna projects.
This means the antenna performance will not be great.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
LET OP! DIT APPARAAT HEEFT GEEN WIFI OF INTERNET FUNCIONALITEIT.
HET AANSCHAFFEN VAN EEN WIFI DONGLE HEEFT GEEN NUT.
In Nederland worden enkele radio en TV signalen zonder versleuteling uitgezonden die gratis zijn te ontvangen.
Deze Free-To-Air (FTA) signalen zijn te ontvangen met behulp van een standaard ontvanger en bijhorende antenne.
U hoeft hiervoor dus geen abonnement af te sluiten.
Free-To-Air TV zenders zijn: NPO1, 2 en 3 en de regionale omroepen in Nederland.
Om de FTA TV en radio zenders te ontvangen heeft u een ontvanger nodig die de DVB-T2 MPEG 4 H.265 (HEVC) compressie ondersteunt.
De FTA TV zenders worden in HD-kwaliteit (1080p) doorgeven.
Digitenne zond voorheen FTA TV en radio zenders via DVB-T techniek.
Echter Digitenne werd verplicht de FTA TV en radio zenders uit te zenden via een ander techniek, de eerder genoemde DVB-T2.
In 2018 begon Digitenne met het geleidelijk overzetten van het DVB-T signaal naar DVB-T2 signaal.
In juli 2019 is de overgang afgerond.
Dit betekend wel dat alle DVB-T ontvangers niet meer bruikbaar zijn.
Om de FTA TV en radio zenders te ontvangen is een DVB-T2 (HEVC H.265) ontvanger nodig.
Als uw TV geen DVB-T2 (HEVC H.265) ontvanger heeft, dan kunt u deze ontvanger apart aanschaffen.
Er zijn vele DVB-T2 ontvangers die u kunt kopen. Op deze website
breedbeeldweetjes.wordpress.com/dvb-t2-in-nederland-welke-ontvanger-is-geschikt-voor-het-gratis-npo-pakket
kunt u meer informatie hierover vinden.
VMade official store:
vmade.nl.aliexpress.com/store/4395046
Meer informatie over de Vmade T2-8943 ontvanger:
nl.aliexpress.com/item/32955080715.html?storeId=4395046
De Vmade T2-8943 ontvanger gebruik ik alleen om de Free-To-Air TV zenders NPO1, 2 en 3 en de regionale omroepen in Nederland te ontvangen plus de radio zenders.
Als u van plan bent later een Digitenne abonnement af te sluiten, om ook de commerciële zenders te ontvangen dan kunt u de Vmade T2-8943 niet gebruiken.
U kunt de commerciële zenders alleen ontvangen met behulp van een ontvanger geleverd door Digitenne.
Bij de VMade ontvanger wordt geen antenne meegeleverd, maar u hebt er wel een nodig.
Koop een antenne die DVB-T2 signalen kan ontvangen.
U kunt een passieve of een actieve antenne gebruiken afhankelijk van de ontvangen signaal sterkte.
Een actieve antenne is nodig als het signaal zwak is.
De actieve antenne beschikt over een versterker die de ontvangen signaal versterkt naar de VMade ontvanger stuurt.
Een actieve antenne heeft stroom nodig. De Vmade ontvanger stuurt stroom naar de antenne via de coax kabel.
Een actieve antenne is duurder dan een passieve antenne.
Een passieve antenne beschikt niet over een versterker en is meestal geoptimaliseerd voor een beperkt frequentie bereik.
Het is belangrijk dat uw antenne is gericht naar de dichtstbijzijnde Digitenne TV zendmast.
De zendmast antennes zijn verticaal gepolariseerd.
Dat betekend dat uw antenne ook verticaal moet staan.
Als dit niet het geval is dat zult u geen FTA TV en radio signalen ontvangen.
In sommige gevallen is een buiten antenne nodig.
Wilt u weten waar uw dichtstbijzijnde Digitenne TV zendmast is, zie:
https://digitennes.nl/informatie/7-zendmasten
https://www.radio-tv-nederland.nl/dvbt/digitenne-kpntv.html
http://appl.agentschaptelecom.nl/dav/index.html
Check het frequentie bereik waarin de FTA TV zenders worden uitgezonden.
In mijn regio is het frequentie bereik: 614 - 622 MHz.
Deze informatie is nodig als ik demonstreer hoe u zelf een passieve antenne bouwt.
ZELF EEN PASSIEVE ANTENNE BOUWEN
Ik demonstreer hoe u zelf een passieve antenne bouwt.
Deze antenne werkt alleen al u een sterk signaal ontvangt.
Deze antenne is bedoeld voor binnenhuis gebruik.
Check het frequentie bereik waarin de FTA TV zenders worden uitgezonden.
In mijn regio is het frequentie bereik: 614 - 622 MHz
In uw situatie kan dit natuurlijk anders zijn.
Neem de gemiddelde frequentie:
f = (614 + 622) / 2 = 618 MHz
Bereken de golflente (λ):
λ = c / f = 299 792 458 / (618 x 106) = 0,4851 m = 485 mm
Lichtsnelheid c = 299 792 458 m/s
Bereken een kwart golflente:
1/4 λ = 1/4 x 485 = 121,25 mm
Over de kwart golflente moet u nog een factor (Velocity Factor) toepassen.
Dit is afhankelijk van het gebruikte antenne draad materiaal.
Ik heb een fiets spaak gebruikt dat is gemaakt van staal.
Lantenne = 1/4 λ x VF
Lantenne = 121,25 x 0,9 = 109,125 = 109 mm
Bekijk al mijn howto instructie video's
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Abonneer je op mijn YouTube-kanaal:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
De presentatie die in deze video is gebruikt is te vinden op:
mobilefish.com/download/pdf/fta_dvb_t2.pdf
#mobilefish #howto #vmadeT2-8943
youtube.com/c/mobilefish/about
This is part 36 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain what the velocity factor is.
This will be a very short video.
It is important that you know what the velocity factor is because it will be used in other tutorials.
An antenna is made of a conductive material, such as copper or aluminium.
Electric current can easily flow through copper which allows the RF signal to propagate through the antenna.
Some conductive materials slows down the signal in the antenna compared to others.
The Velocity Factor (VF) is calculated as follows:
VF = Speed of a signal through a medium / Speed of a light in vacuum
The Velocity Factor will vary from material to material.
For example copper has a VF=0.95, it means copper slows down the propagation of RF signals to 95% of the speed of light.
If the antenna is covered by an insulating material this also impacts the RF signal when propagating out the antenna.
If f = 868 MHz and λ = 345.38 mm, l = 0.25 x 345.38 = 86.345 mm
If the antenna is made of bare copper: l = 86.345 x 0.95 = 82.028 mm
If the antenna is made of insulated copper: l = 86.345 x 0.95 (VF of copper) x 0.98 (VF of insulated material) = 80.387 mm
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 35 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain:
- The different types of coaxial cables and connectors.
- What characteristic impedance is and how it is calculated.
- What the impact is of cable losses.
To transport radio frequency signals, a coaxial cable or coax cable is used.
Coax cables uses the RG ratings and RG stands for Radio Guide.
The number after RG refers to different cable specifications.
For example RG58, RG174, etc.
The higher the RG number, the thinner the central conductor core is.
The suffix U for Universal means for general utility use, for example RG 174/U.
A coax cable (or any type of transmission line) impedance is called characteristic impedance and usually written as Z0 and cannot be measured by an ohmmeter.
A transmission line characteristic impedance is measured by an instrument called the time domain reflectometer or an oscilloscope.
This impedance is a measure of resistance to the flow of electrical energy.
There are two main types of coaxial cables, ones with an impedance of 75 Ω and ones with an impedance of 50 Ω.
In general 50 Ω coax cables are used for data communications (LoRa, WiFi, etc.) or amateur radio.
In general 75 Ω coax cables are used for digital audio or video applications.
The coax cable impedance remains constant regardless of the length of the cable.
A signal travelling thru a coax cable losses power, also known as attenuation.
This signal power loss is measured in decibels per meter (dB/m).
These losses are mainly caused by:
- The conductor, in the form of ohmic losses.
Think of impurities in the conductor.
- The dielectric touching the conductor.
The dielectric absorb some of the energy transported by the conductor.
To avoid signal loss:
Always keep the coax cable as short as possible and preferably connect the antenna directly to the device.
Minimise the number of connectors.
As the gateway should be 50 Ω, always use 50 Ω coax cables otherwise this will result in impedance mismatch thus a bad VSWR.
Coaxial connectors are used to connect coax cables to other devices and maintain the cable’s shielding.
There are two coaxial connectors types: male and female.
A male connector (aka plug) has a metal pin which protrude from the center and a female connector (aka jack) has a recessed hole to receive the pin.
There are several coaxial connector types. In this tutorial only two types will be discussed: type N connectors and SMA connectors.
Type N connectors are threaded connectors and are larger, tougher and can withstand abuse compared to SMA connectors.
Type N connectors are available with 50 Ω and 75 Ω impedance.
When using a thicker coax cable, than type N connector is the best choice.
In general type N connectors are not waterproof.
SMA (SubMiniature version A) connectors are connector interfaces for coaxial cables with screw type coupling mechanism.
The connector has a 50 Ω impedance.
SMA connectors are smaller in size and are used together with smaller size coax cables.
In general SMA connectors are not waterproof.
There are two types of SMA connectors (technically they behave the same):
A standard polarity SMA male or SMA female connector: SMA male / SMA female
A Reverse Polarity SMA male or SMA female connector: RP SMA male / RP SMA female
To determine which is which is a two step process:
1. Barrel with a thread inside: SMA male
Barrel with a thread outside: SMA female
2. If SMA male has a centre sleeve (hole): RP SMA male
If SMA female has a centre pin: RP SMA female
A standard polarity SMA male connector has a center pin surrounded by barrel with inside threads, and the standard SMA female connector has a center sleeve surrounded by a barrel with outside threads.
A reversed-polarity SMA male connector has a center sleeve surrounded by barrel with inside threads, and the reversed-polarity SMA female connector has a center pin surrounded by a barrel with outside threads.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 34 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain how an antenna works.
Most antennas are based on resonance, for example the dipole antenna.
Dipole antennas are so called resonators and they resonates at a particular frequency.
When an AC current with frequency f is supplied at a dipole antenna feed point, where each element length is 1/4 λ, then this dipole antenna resonates at the same AC frequency.
The current flows thru the antenna and bounces back at the end of the antenna where the resistance is very high.
The generated current wave is in fact a standing wave.
If a current (I) flows thru an electric wire it generates an magnetic field (B).
Use the right hand rule, to find the direction of the magnetic field.
Thumb points to the same direction of the current, the fingers shows the direction of the magnetic field.
If the current flows in the opposite direction, the magnetic field also changes direction.
An oscillating electric field created in the vertical plane, creates an oscillating magnetic field (B) in the horizontal plane.
The magnetic (B) field is orthogonal, meaning 90 degree angle, to the electric (E) field.
The electric and magnetic fields creates an Electro Magnetic (EM) wave which "spreads out" (propagates) in a certain direction.
The EM wave is perpendicular to the propagation direction.
An EM wave propagates thru free space with a speed of light because light is also an EM wave.
The speed of light is c = 299,792,458 m/s
When an EM wave hits an antenna, this antenna will resonates at a specific frequency depending on the antenna length.
When the transmission frequency match the antenna frequency the antenna will resonate at an atomic level.
The electrons in the antenna gets excited and generates an alternating electrical current.
An antenna can be used to receive and sent electromagnetic waves.
Electromagnetic waves can be represented by a sine curve.
One cycle is one wave length represented by the symbol λ (lambda).
When an antenna is used to transmit a signal, electrons will flow thru this antenna.
The electrons change direction depending on the signal frequency, thus creating a fluctuating magnetic field (B).
The Electric (E) and Magnetic (B) fields are 90 degrees out of phase and the polarity of an antenna is determined by the plane of the E field.
If the antenna (E-field) is oriented vertically, it has a vertical polarisation.
If the antenna (E-field) is oriented horizontally, it has a horizontal polarisation.
For maximum signal transference the antenna polarisation on both transmit and receive side must be the same, otherwise there will be significant signal loss.
If you use the TTN EU863-870 freq. plan, the LoRaWAN frequencies ranges from 867.1 MHz to 869.525 MHz.
The average frequency is (867.1 + 869.525) / 2 = 868.3125 MHz.
This means an 868 MHz antenna can be used.
See: thethingsnetwork.org/docs/lorawan/frequency-plans.html
An antenna sends out EM waves.
The near field region is the region right next to the antenna.
In this region, the EM fields are sort of unpredictable.
If a LoRa end device is located near a gateway (near field) it may produce strange results.
Keep the distance between transmitter and receiver at least 4 wavelengths apart.
As a rule of thumb keep the distance between transmitter and receiver 3 meters apart.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 33 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
The parameters SWR and S11 are often used to judge the antenna performance.
In this tutorial I will explain what these two parameters are.
The Voltage Standing Wave Ratio (VSWR), pronounced “viswar”, often referred to as SWR is how much of the power offered to the antenna is reflected back.
It is the ratio of power offered to power reflected.
This is the same as how well the antenna impedance (Zload) is matched to the source (Zsource) it is connected to.
The reflection coefficient (Γ) is also known as S11.
The reflection coefficient values: between -1 and 1
The VSWR values, greater or equal than 1.
A VSWR = 1, no power is reflected (ideal situation), that is what we want.
Return loss is how much of the input power is reflected back and it is measured in dB.
If a return loss is 20 dB, it means -20 dB.
If RL = 0 dB: It means 0 dB, the ratio is 1, 100% of Pin is reflected back.
If RL = 3 dB: It means -3 dB, the ratio is 0.5, 50% of Pin is reflected back.
If RL = 10 dB: It means -10 dB, the ratio is 0.1, 10% of Pin is reflected back.
If RL = 20 dB: It means -20 dB, the ratio is 0.01, 1% of Pin is reflected back.
If RL = 30 dB: It means -30 dB, the ratio is 0.001, 0.1% of Pin is reflected back.
A higher return loss value results in a better antenna performance.
In an ideal situation when no power is reflected back, (ZL = ZS) the VSWR = 1.0 or as commonly expressed as a ratio of 1:1.
The higher the impedance mismatch, the higher the VSWR value.
If Zsource is smaller than Zload than power is reflected back, for example VSWR = 1.4 or 1.4:1.
The logged data can be found at:
mobilefish.com/download/lora/antenna_test_results.txt
In total there were 4 nearby gateways which were able to receive my transmitted sensor data, see:
drive.google.com/open?id=1G-3jSMVhnN85eZvHkFD_fUdorHN--H4l&usp=sharing
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 32 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain why resistance, reactance and impedance plays an important role in antennas.
The main function of resistors in a circuit is to control the flow of current to other components.
The resistor’s (R) unit is Ohm (Ω).
In an electric circuit a resistor does not store any energy, it just dissipates some of the energy in the form of heat.
In a Direct Current (DC) or Alternating Current (AC) circuit the resistor behaves the same.
In an AC circuit the resistor’s resistance is also called the ohmic resistance to differentiate between other forms of resistance.
The main function of a capacitor in a circuit is to store energy and to give this energy back to the circuit when necessary.
The energy supplied to the capacitor is stored in the form of an electric field which is created between the plates of a capacitor.
The capacitor’s (C) unit is Farad (F).
A capacitor consists of two plates and between those two plates there is an isolator called dielectric.
In a Direct Current (DC) circuit a capacitor acts as an open circuit and does not permit current to pass, it has an infinite resistance.
But in an Alternating Current (AC) circuit the capacitor has a resistance.
The capacitor’s resistance is called capacitive reactance (Xc).
The main function of an inductor in a circuit is to store energy and to give this energy back to the circuit when necessary.
The energy supplied to the inductor is stored in the form of a magnetic field which is created by the coil.
The inductor’s (L) unit is Henry (H).
In a Direct Current (DC) circuit an inductor acts as an short circuit and allows the current to pass, it has zero resistance.
But in an Alternating Current (AC) circuit the inductor has a resistance.
The inductor’s resistance is called inductive reactance (XL).
A field generator generates an Alternating Current (AC) and in an AC circuit a capacitor (C) and an inductor (L) both acts like a resistor.
The resistor opposes the flow of electrons.
The capacitor opposes the change in voltage by dropping or supplying the current.
The inductor opposes the change in current by dropping or supplying the voltage.
Impedance (Z), measured in ohms, is the combined effect of all the ohmic resistance, capacitive reactance and inductive reactance.
A nice animation where you can see the voltage distribution and how the current flows thru the dipole antenna:
en.wikipedia.org/wiki/Dipole_antenna
An antenna has resistor, capacitor and inductor characteristics.
Thus an antenna has impedance (Z).
An antenna has two types of resistance:
A radiation resistance (Rrad), which converts electrical power into EM radiation.
And an ohmic resistance, which is loss on the antenna’s structure that converts electrical power into heat radiation (Rloss).
Radiation resistance creates Electro Magnetic radiation.
Ohmic resistance creates heat.
An antenna is called resonant when the capacitive (XC) and inductive (XL) reactances cancel each other out.
In a resonant antenna:
- The reactance (X) is zero, the antenna is purely resistive (= Rrad + Rloss) which
means that the voltage and current are in phase at the antenna feed point.
- A maximum of current will flow thru the antenna.
- The VSWR is close to 1.
The source, cable and antenna must have the same impedance.
If not, this will impact the signal.
If Zantenna is greater than Zcable, the signal is reflected.
If Zantenna is smaller than Zcable, the signal strength is reduced.
If Zantenna is equal than Zcable, the signal strength is maximum.
In general 50 Ω coax cables are used for data communications (LoRa, WiFi, etc.) or amateur radio.
In the gateway documentation you may find the following line:
“The antenna port is well matched to standard 50 Ohm impedance.” or “RF interface optimised to 50 Ohm.”
In the coax cable and antenna specification you may find the line: “Impendance: 50Ω”
In an ideal situation: Zsource = Zcable = Zantenna = 50 Ω
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 31 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will demonstrate how to install and configure the open source LoRaWAN network server called LoRaServer.
The LoRa Server project provides open source components for building LoRaWAN networks.
The LoRa Server project consists of four major components: LoRa Gateway Bridge, LoRa Server, LoRa App Server and LoRa Geo Server.
All components are licensed under the MIT license and can be used for commercial purposes.
The LoRa Gateway Bridge abstracts the packet forwarder UDP protocol data into JSON and sends it to the LoRa Server over MQTT.
The LoRa Server is the LoRaWAN network server.
It de-duplicates and handles the received uplink frames from the gateway(s), handles the LoRaWAN mac layer and schedules the downlink data transmissions.
The LoRa App Server is the LoRaWAN Application Server and handles the join-requests, encryption of application payloads and offers a RESTful JSON API, gRPC API or MQTT for external services.
The LoRa App Server has a web interface to manage users, organisations, applications and devices.
It also allows you to see the received sensor data.
Many users are sending their sensor data to The Things Network.
Now you can create your own private LoRaWAN network by using the LoRa Server components.
More information about the LoRa Server project:
loraserver.io
All LoRa Server project code:
github.com/brocaar
LoRa Server forum:
forum.loraserver.io
The LoRa Server and the LoRa App Server each requires their own PostgreSQL database.
There are many configurations of these components possible, for example:
- All LoRa Server components and their dependencies can be installed on their own servers.
- All LoRa Server components and their dependencies can be installed on the gateway itself, which I will demonstrate in this video.
- All LoRa Server components and their dependencies can be installed on a single server instance.
- LoRa Gateway Bridge can be installed on the gateway itself, the other LoRa Server components and their dependencies can be installed on a single server instance.
How it works
The gateway has the Semtech packet forwarder installed.
The global_conf.json and local_conf.json files are used to configure the packet forwarder.
In the global_conf.json file the Lora Gateway Bridge server address and port 1700 are set.
The Lora Gateway Bridge abstracts the received packet forwarder UDP protocol data.
The data is converted into JSON and publishes it to a MQTT broker.
The lora-gateway-bridge.toml file is used to configure the Lora Gateway Bridge.
The Lora Server is the LoRaWAN network server and it has a PostgreSQL database to store the gateway data.
The loraserver.toml file is used to configure the Lora Server.
The Lora App Server is the LoRaWAN application server and it also has a PostgreSQL database to store the gateway data.
The lora-app-server.toml file is used to configure the Lora App Server.
I have created a manual how to install and configure the LoRa Gateway Bridge, LoRa Server, LoRa App Server and their dependencies on the RAK 831 Pilot Gateway.
mobilefish.com/developer/lorawan/lorawan_quickguide_loraserver_installation.html
The LoRa Gateway OS is an easy way to get started with LoRaWAN and the LoRa Server project.
LoRa Gateway OS are SD card images which contains out-of-the-box support for the Semtech packet forwarder, Lora Gateway Bridge, LoRa Server and LoRa App Server for certain concentrator shields.
More information: loraserver.io/lora-gateway-os/overview
There are also gateways on the market with the LoRa Server components already installed, such as the RAK WisKit.
This kit contains among other things:
- RAK2245 Pi HAT (LoRa concentrator module)
- Raspberry Pi 3B+
- WisNode (LoRa Node)
A tutorial about this can be found at:
hackster.io/fomi-T/simplest-lora-starter-kit-w-rak2245-rpi-ttn-loraserver-0ad993
An SD Card MAY wear out.
The lifetime of SD cards is limited by the number of writes.
It is recommended NOT to use cheap SD cards.
LoRa Server tries to minimise the number of database writes.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 30 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will give a simplified explanation of what the parameters mean in the global and local JSON configuration files.
The Semtech UDP Packet Forwarder is configured by the global configuration file global_conf.json.
It has two sections: the radio settings (SX1301_conf) and server settings (gateway_conf).
The radio settings (SX1301_conf) should contain the parameters for the Lora concentrator board.
The server settings (gateway_conf) should contain the gateway parameters.
If parameters are defined in both the global and local configuration file, the local definition overwrites the global definition.
Recommended is to make changes in the local configuration file (local_conf.json).
Listen-Before-Talk (LBT) is a mandatory requirement in some countries, such as South Korea.
LBT prevents end devices from transmitting at the same time on the same channel.
LBT means the end device checks (=Listen) if the intended channel is free.
If the channel is not free, the end device changes to another channel and repeats the LBT procedure.
If the channel is free it transmits (=Talk).
The SX1257/55 radios captures the LoRa uplink packets and sends the digital signal to the SX1301 digital baseband chip which demodulates the signal.
This processed signal is used by the Micro Controller Unit (MCU).
The SX1257 chip can be configured to any frequency inside the 868/900 MHz ISM band.
The SX1255 chip can be configured around the 433MHz ISM band.
In the global_conf.json file you can find the Intermediate Frequency channels (IF).
All gateways must comply to certain rules and regulations when using the ISM band frequencies.
These rules and regulations determines how the Intermediate Frequency channels came about.
In the LoRaWAN 1.0.2 Regional Parameters Revision B (2017 Feb), for the EU863-870 ISM band the following is specified:
- The EU863-870 ISM Band channel frequencies applies to any region where the ISM radio spectrum use is defined by the ETSI 300220 standard.
- For the EU863-870 ISM frequency band a maximum of 16 channels is supported.
- Three default channels must be implemented in every EU868MHz end-device.
Those channels are the minimum set that all network gateways should always be listening on.
- The remaining 13 channels can be freely attributed by the network operator.
A list of frequency plan definitions used by The Things Network, see:
thethingsnetwork.org/docs/lorawan/frequency-plans.html
These frequency plans are based on what is specified in the LoRaWAN regional parameters document.
In the most basic form a LoRaWAN gateway is just a digital radio transceiver.
How a digital radio transceiver works:
- The digital data that contains the information that needs to be transmitted.
- The Digital-to-Analog Converter (DAC) converts the digital data to an analog signal.
- The Low Pass Filter (LPF) filters out the noise, etc from the analog signal.
- A Local Oscillator (LO) generates a carrier signal and modulates the carrier signal onto the analog signal thus creating an RF signal.
- The power amplifier boost the RF signal.
- The Transmit/Receive (TR) switch sends the amplified RF signal to the transmitting antenna.
A maximum of 16 power settings can be configured.
These settings are board specific and have been selected during calibration for each concentrator.
The network server is in charge of requesting transmit powers.
The gateway extracts the proposed RF power from the txpk JSON object.
The proposed RF powers are in fact EIRP values.
The antenna_gain is subtracted from the proposed RF power to stay within the legal limits:
rf_power (dBm) = powe (dBm) - antenna_gain (dBi)
The gateway searches the LUT for rf_power.
If the rf_power is not found in the LUT than an error will be logged, the downlink packet will be rejected and de facto the packet is lost.
EIRP= rf_power + antenna_gain (+ cable losses)
It is important to specify the antenna_gain in the global_conf.json file, otherwise the EIRP does not comply with the regulations.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 28.2 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this short tutorial I will show you how to enable debug logging in the Semtech LoRa gateway and Semtech UDP packet forwarder.
In this tutorial the following Semtech LoRa gateway and Semtech UDP packet forwarder are used:
- Semtech LoRa Gateway (V5.0.1)
github.com/Lora-net/lora_gateway
/opt/ttn-gateway/lora_gateway *
- Semtech UDP Packet Forwarder (V4.0.1)
github.com/Lora-net/packet_forwarder
/opt/ttn-gateway/packet_forwarder *
*) For example in the RAK831 Pilot Gateway
Stop the ttn-gateway service:
sudo service ttn-gateway stop
The LoRa library contains a file (RAK831 Pilot Gateway):
/opt/ttn-gateway/lora_gateway/libloragw/library.cfg
where you can enable the debug logging for several modules.
To enable debug logging, change the value from 0 to 1.
DEBUG_AUX= 0
DEBUG_SPI= 0
DEBUG_REG= 0
DEBUG_HAL= 0
DEBUG_LBT= 1
DEBUG_GPS= 0
DEBUG_AUX
HAL auxiliary functions.
DEBUG_SPI
Functions to address the LoRa concentrator registers through an SPI interface.
DEBUG_REG
- Functions used to handle FPGA register access for LoRa concentrator.
- Functions used to handle LoRa concentrator radios.
- Functions used to handle a single LoRa concentrator.
DEBUG_HAL
LoRa concentrator Hardware Abstraction Layer.
DEBUG_LBT
Functions used to handle the Listen Before Talk feature.
DEBUG_GPS
Functions to manage a Global Navigation Satellite System (GNSS) module, typically GPS, for accurate time-stamping of packets and synchronisation of gateways.
After the library.cfg file is modified enter the following commands in this order:
- First, build the Semtech LoRa library:
cd /opt/ttn-gateway/lora_gatewaysudo
make clean all
- Build the Semtech UDP Packet Forwarder:
cd /opt/ttn-gateway/packet_forwardersudo
make clean all
Start the ttn-gateway service:
sudo service ttn-gateway start
After you’re done with debugging don’t forget to set the values back to 0 in the library.cfg file otherwise the /var/syslog file will increase in size very fast.
More information about the RAK831 Pilot Gateway:
aliexpress.com/store/product/IoT-in-a-Box-Powered-Pilot-Gate-way-with-Semtech-SX1301/2805180_32951841630.html
Interested in the RAK831 components:
aliexpress.com/store/product/RAK831-LoRa-LoRaWAN-Gateway-Module-base-on-SX1301-433-868-915MHz-range-of-up-to-49200ft/2805180_32821411294.html
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 29 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will briefly explain what the Semtech UDP Packet Forwarder is.
But the main focus is explaining what the Semtech UDP protocol is.
A packet forwarder is a program running on the host of a LoRa gateway and interfaces with the LoRa concentrator to pull and push packets, while interacting at the same time with the network server.
The Semtech Corporation created the first packet forwarder, which is a reference design and is called the "Semtech UDP Packet Forwarder".
When a LoRa gateway uses the Semtech UDP Packet Forwarder, it connects to a LoRaWAN network server through the Semtech UDP protocol.
See: github.com/Lora-net/packet_forwarder
However the Semtech UDP Packet Forwarder has several flaws, for example UDP is not secure, UDP is not reliable and the forwarder is hard to configure.
More information:
thethingsnetwork.org/docs/gateways/start/connection.html
More information about the Semtech UDP protocol:
- The Gateway to Server Interface Definition [6]
- github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT
- github.com/Lora-net/packet_forwarder/blob/master/lora_pkt_fwd/src/lora_pkt_fwd.c
In this tutorial the focus will be on the Semtech UDP protocol version 2.
This is the protocol version used since Semtech UDP packet forwarder version 3.0.0.
Several developers forked the Semtech UDP packet forwarder and implemented new functionalities.
All these forked packet forwarders are using the Semtech LoRa Gateway library.
A packet forwarder which uses the Semtech UDP protocol is called "legacy packet forwarder".
The Things Network has developed another protocol called "Gateway Connector Protocol" to avoid the UDP disadvantages.
Packet forwarders using this protocol are NOT legacy packet forwarders.
More information:thethingsnetwork.org/docs/gateways/start/connection.html
UPSTREAM COMMUNICATION
When a gateway receives a RF packet from an end node, the gateway creates a PUSH_DATA packet which is sent to a LoRaWAN network server.
After the server received the PUSH_DATA packet, the server sends a PUSH_ACK back to the gateway and then processes the PUSH_DATA packet.
DOWNSTREAM COMMUNICATION
At regular time intervals the gateway sends a PULL_DATA packet (aka keepalive message) to the network server.
If the gateway is behind a firewall it impossible for the network server to send packets to the gateway.
The PULL_DATA packets keeps any intervening firewall open by informing the server of the gateway UDP port number which it can use.
After the server received the PULL_DATA packet, the server sends a PULL_ACK back to the gateway to confirm that the network route is open and that the server can send PULL_RESP packets at any time to the gateway.
When the gateway receives a PULL_RESP packet, the gateway sends a TX_ACK feedback to the server to inform if the downlink request has been accepted or rejected by the gateway.
Tcpdump is a command line packet analyser that monitors and logs TCP/IP traffic and other packets passing between a network and the computer on which it is executed.
The generated raw tcpdump output:
mobilefish.com/download/lora/tcpdump_output.txt
Some notes added for more detailed explanation:
mobilefish.com/download/lora/tcpdump_output_with_notes.txt
Node-RED is a browser-based development tool for wiring together hardware devices, APIs and online services.
Import a very simple Node-Red flow to capture the rxpk (received packet), stat (status), txpk (transaction packet) and txpk_ack (transaction packet acknowledge) JSON objects which are sent to/from the gateway:
mobilefish.com/download/lora/capture_gateway_lorawan_network_server_packets.json
More information about the RAK831 Pilot Gateway:
aliexpress.com/store/product/IoT-in-a-Box-Powered-Pilot-Gate-way-with-Semtech-SX1301/2805180_32951841630.html
Interested in the RAK831 components:
aliexpress.com/store/product/RAK831-LoRa-LoRaWAN-Gateway-Module-base-on-SX1301-433-868-915MHz-range-of-up-to-49200ft/2805180_32821411294.html
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 28.1 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will show you how to install all the required software on a micro SD card.
The result is a bootable micro SD card which can be used in the RAK831 Pilot Gateway.
I have forked github.com/RAKWireless/RAK831-LoRaGateway-RPi and simplified the installation procedure.
The repository github.com/robertlie/RAK831-LoRaGateway-RPi contains just a few files.
The install.sh script:
- Creates the gateway EUI.
- Allows the user to set the gateway hostname.
- Allows the user to select the region the gateway will operate in.
Dependant on the selected region the correct global_conf.json is copied from the configuration_files folder.
- The local_conf.json is copied from the configuration_files folder and the gateway EUI is set in this file.
- Allows the user to set the gateway latitude and longitude coordinates and its altitude.
- Installs the Semtech LoRa library and the Semtech UDP Packet Forwarder and build both packages.
- Makes the packet_forwarder a service, which means when the Raspberry Pi boots the packet_forwarder is started.
- Disables the onboard Raspberry Pi bluetooth.
Before you start with the installation procedure, you must know which frequency plan to use in your country.
See the list of frequency plans by country list:
thethingsnetwork.org/docs/lorawan/frequencies-by-country.html
Installation procedure:
git clone github.com/robertlie/RAK831-LoRaGateway-RPi ~/rak831-loragateway
This repository is installed in: /home/pi/rak831-loragateway
Execute the install script:
cd ~/rak831-loragateway
sudo ./install.sh
The following is displayed. Press Enter to keep the default value or change it:
Host name [ttn-gateway]: Enter
Region AS1, AS2, AU, CN, EU, IN, KR, RU, US [EU]: EU
Latitude [0]: Enter
Longitude [0]: Enter
Altitude [0]: Enter
As mentioned earlier, the install.sh script installs the following git repositories and build these packages.
Semtech LoRa library (V5.0.1)
github.com/Lora-net/lora_gateway
/opt/ttn-gateway/lora_gateway
Semtech UDP Packet Forwarder (V4.0.1)
github.com/Lora-net/packet_forwarder
/opt/ttn-gateway/packet_forwarder
The RAK831 Pilot Gateway can be connected to any LoRa network servers.
In this tutorial the RAK831 Pilot Gateway will be connected to The Things Network server.
The Semtech Packet Forwarder is configured via a file called global_conf.json and if provided an additional file called local_conf.json.
The global_conf.json is the main configuration file and contains for example the LoRa network server address, which uplink and downlink ports to use, which frequencies to use and the TX power LookUp Table (LUT).
The local_conf.json file contains more gateway specific parameters.
The local_conf.json will override the settings in the global_conf.json.
The ~/rak831-loragateway/install.sh script creates the global_conf.json and local_conf.json files in this folder:
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd
Several other global_conf.json file examples can be found in this folder:
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/cfg
but these files are not used.
The github.com/robertlie/RAK831-LoRaGateway-RPi/blob/master/configuration_files/README.md file explains where the global configuration files originates from and what modifications were made to these files.
In Tutorial 28 is explained which parameters to set in the local_conf.json file to enable GPS and for beaconing.
In the local_conf.json these parameters are commented out.
Uncomment these parameters if needed.
The gateway is now running without errors.
Next steps:
Register the gateway to The Things Network, watch:
youtu.be/bea7g5isD0w?t=1779
Optionally enable WiFi, watch:
youtu.be/bea7g5isD0w?t=1844
More information about the RAK831 Pilot Gateway:
aliexpress.com/store/product/IoT-in-a-Box-Powered-Pilot-Gate-way-with-Semtech-SX1301/2805180_32951841630.html
Interested in the RAK831 components:
aliexpress.com/store/product/RAK831-LoRa-LoRaWAN-Gateway-Module-base-on-SX1301-433-868-915MHz-range-of-up-to-49200ft/2805180_32821411294.html
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 28 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will explain what the RAK831 Pilot Gateway is, how to configure it and how you can register this gateway with The Things Network.
Rakwireless Technology (RAK) was established in June 2014 and is based in Shenzhen, China.
RAK main focus is developing and supplying advanced IoT technology and services.
There are many different gateways, one of them is the RAK831 Pilot Gateway.
This gateway is designed for indoor usage and supports the LoRaWAN 1.0.2 protocol.
It is ideal for prototyping, Proof-of-Concept demonstration or for evaluation purposes.
The RAK831 Pilot Gateway is a fully assembled gateway with an aluminium housing and is shipped with a micro SD card with all software pre-installed.
The RAK831 Pilot Gateway consists of:
- a Raspberry Pi 3 model B+ (rev1.3),
- a converter board with a GPS (Ublox, MAX-7Q) module,
- a RAK831 LoRa Concentrator,
- an aluminium housing with the top cover serving as a heat sink housing size DxWxH = 69x92x54 mm,
- a power adapter (5V, 2A) with micro USB, and the cable length is 115 cm,
- an antenna with the correct frequency for the LoRa radio,
- a GPS antenna and the cable length is 150 cm,
- a micro SD card (16 GB, class 10) with pre-installed software.
The RAK831 concentrator uses the Semtech SX1301 chip and is able to receive up to 8 LoRa packets simultaneously, and can send with different spreading factors on different channels.
The concentrator is the radio communication module which receives and transmits radio messages.
The converter board with the GPS module routes the signals between the Raspberry Pi and the RAK831 concentrator.
The Raspberry Pi processes these radio messages as well as protocol related tasks and sends the processed data to a LoRaWAN server, for example The Things Network server.
The RAK831 Pilot Gateway is a fully assembled gateway and needs to be configured before it can be used.
To register your gateway with The Things Network you need its gateway EUI.
The gateway EUI can be any random 8 bytes number but it is recommended that the gateway EUI is based on the gateway MAC address.
A MAC address is a hardcoded identification number which is assigned to your network interface card.
WiFi is by default disabled in the RAK831 Pilot Gateway.
The gateway is shipped with a micro SD card with the following software pre-installed.
Raspbian Stretch Lite:
raspberrypi.org/downloads/raspbian
Semtech LoRa library (V5.0.1):
github.com/Lora-net/lora_gateway
Semtech UDP Packet Forwarder (V4.0.1):
github.com/Lora-net/packet_forwarder
The Semtech LoRa library contains drivers/HAL (Hardware Abstraction Layer) to be used in gateways using a concentrator board based on Semtech SX1301 multi-channel modem and SX1257/SX1255 RF transceivers.
The Semtech UDP Packet Forwarder is a program running on the host of a LoRa gateway (in my case the Raspberry Pi) that forwards RF packets received by the concentrator to a LoRaWAN server through an IP/UDP link.
The RAK831 Pilot Gateway is shipped with a converter board with an Ublox MAX-7Q GPS (Global Positioning System) module and a GPS antenna.
GPS satellites broadcasts navigational messages to Earth, which contains very accurate time stamps and their position.
The gateway GPS module receives these navigational messages.
With this information the GPS module calculates its position on Earth.
The GPS module can use these accurate time stamps to create a PPS (Pulse Per Second) signal that is used for timing/synchronisation purposes.
Every LoRaWAN gateway with a GPS module generates the same synchronised PPS signal.
The RAK831 Pilot Gateway has a GPS module but it is disabled.
This is done because class B functionality is not implemented yet in LoRaWAN servers, such as The Things Network servers.
More information about the RAK831 Pilot Gateway:
aliexpress.com/store/product/IoT-in-a-Box-Powered-Pilot-Gate-way-with-Semtech-SX1301/2805180_32951841630.html
Interested in the RAK831 components:
aliexpress.com/store/product/RAK831-LoRa-LoRaWAN-Gateway-Module-base-on-SX1301-433-868-915MHz-range-of-up-to-49200ft/2805180_32821411294.html
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 27 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will demonstrate:
- how to retrieve sensor data from The Things Network,
- how to store it in a database,
- how to retrieve this data from the database and display it in a browser,
- and how to create a downlink, using a NodeJS script, sending data from my computer to my LoRa end node.
All code used in this tutorial can be found in the following Github repository:
github.com/robertlie/ttn_app_server
The Things Network community developers created several Software Development Kits (SDK) to receive activations and messages from IoT devices via The Things Network to your server.
It also allows you to send messages back to the IoT devices from your server.
The SDK’s are available in Go, Java, Python and Node.JS
Go: github.com/TheThingsNetwork/go-app-sdk
Java: github.com/TheThingsNetwork/java-app-sdk
Python: github.com/TheThingsNetwork/python-app-sdk
Node.JS: github.com/TheThingsNetwork/node-app-sdk
In this tutorial I will use the Node.JS SDK.
This tutorial assumes you have installed the following software packages and know how these packages works.
Node.JS (JavaScript server environment) and npm (node package manager)
nodejs.org/en/download/package-manager
MySQL (Relational Database Management System)In this tutorial MySQL Community Server is used.
mysql.com/downloads
phpMyAdmin (Web based administration tool for MySQL)
phpmyadmin.net
Goto The Things Network console.
Goto the applications page and select the application which receives the sensor data.
In this demo the application ID is "youtube_demo_app2".
To retrieve sensor data from The Things Network to your server, you need:
The application ID
Example: youtube_demo_app2
Access key
Example: ttn-account-v2.uicwOOArAqESHCfa8LGdftBSM6IZWjCdv4Art14iKtc
Download the Git repository:
github.com/robertlie/ttn_app_server
Goto folder ttn_app_server
Install the node modules, type: npm install
Modify file config.js
Modify file read_table.php
Run the script retrieve.js, type: node retrieve.js
This script only retrieves sensor data from TTN and displays it in the terminal.
It is possible to create a downlink by sending data to the end node using script send.js.
Modify file send.js:
client.send("youtube_demo_device", Buffer.alloc(1, 0x00, ‘binary'));
Depending on the hex value send, the yellow and green leds can be On or Off.
Run the script, type: node send.js
The retrieved sensor data from TTN can be stored in a MySQL database.
A database and corresponding table needs to be created.
First create the database ttn_demo_db, type: node create_db.js
Next create the table sensor_data, type: node create_table.js
Use the web application phpMyAdmin, to check if the database and table are created.
http://localhost/~username/phpmyadmin/index.php
The column "payload_raw" has data type tinyblob to store binary data.
The payload_fields data is not stored because the payload_raw data can be used to recreate the payload_fields data.
The Arduino sketch transmits the humidity and temperature data as four bytes.
If the button switch is pressed a single byte is transmitted.
To retrieve sensor data from TTN and store it in a MySQL database, type: node store_records.js
Use the web application phpMyAdmin, to check if sensor data are stored.
The sensor data is stored in the table sensor_data.
To display all records from table sensor_data in a terminal, type: node read_table.js
The sensor data is stored in the table sensor_data.
To display all records from table sensor_data in a browser:
First deploy file read_table.php in a web server (for example Apache supporting PHP and MySQL).
Open a browser and open the PHP file.
To completely delete the database ttn_demo_db, type: node drop_db.js
BE CAREFUL, ONCE DELETED ALL DATA IS LOST.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 26 of the LoRa/LoRaWAN tutorial.
In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.
In this tutorial I will demonstrate how to send sensor data to The Things Network using my self build LoRa development board.
A button switch is used to detect a button press and a DHT11 sensor is used to measure the temperature and humidity.
Hardware setup
mobilefish.com/images/developer/lorawan_rfm95_arduino_leds_and_sensors.png
mobilefish.com/images/developer/lorawan_rfm95_arduino_leds_sensors_overview.png
Using the Tutorial 25 setup, two sensors were added to the breadboard:
- a button switch
- and a DHT11 sensor module
If the state of a pin is unknown, meaning nothing is connected to the pin, the pin is referred to as floating.
To prevent floating pins, the pin is pulled to Vcc (pin is high) or the pin is pulled to ground (pin is low).
The 10 kOhm resistor is to prevent a short circuit.
Key switch module aka button switch
Pin + connected to Arduino 3.3V
Pin middle not used
Pin - connected to Arduino GND
Price approximately € 0.25
Do not forget the 10 kΩ pull down resistor.
Digital Humidity & Temperature (DHT11) module aka DHT11 sensor.
This particular DHT11 sensor comes with a 10 kΩ pull up resistor from the data pin to Vcc.
Pin VCC connected to Arduino 3.3V
Pin DATA connected to Arduino pin 7
Pin GND connected to Arduino GND
Price approximately € 0.75
A DHT11 sensor is cheap, less precise and less accurate.
For better accuracy and precision use a DHT22.
DHT11 Specification
Supply voltage: 3 to 5.5V DC
Output: single-bus digital signal
Measuring range: humidity 20 to 90% RH, temperature 0 to 50°C
Accuracy: humidity ±5% RH, temperature ±2°C
Resolution: Humidity 1% RH, temperature 1°C
Long-term stability: less than ±1% RH / Year
Goto The Things Network console:
- Select the app: youtube_demo_app
- Select the registered device: youtube_demo_device
- Select reset frame counters. Do this each time your end device is powered up.
The selected device "youtube_demo_device" uses the OTAA method.
The DevEUI, Application EUI and AppKey are needed in the sketch, which will be explained later.
If you copy these values watch out for big-endian and little-endian notation.
When the sketch is uploaded, every 60 seconds the temperature and humidity data is displayed in The Things Network console.
To make the payload data more human readable, select tab | Payload Formats", select decode and copy and paste the decoder function from this link
mobilefish.com/download/lora/tutorial_26_decoder.txt
and paste it in this field.
Install the following libraries in the Arduino IDE (menu: Tools | Manage Libraries)
- MCCI LoRaWAN LMIC library (github.com/mcci-catena/arduino-lmic)
- DHT sensor library (github.com/adafruit/DHT-sensor-library)
- Adafruit Unified Sensor (github.com/adafruit/Adafruit_Sensor)
This library is needed by the DHT sensor library.
Open the Arduino IDE and copy the sketch from this link
mobilefish.com/download/lora/ttn-otaa-sensors.ino.txt
and call the sketch ttn-otaa-sensors.ino
Change the DevEUI, Application EUI and AppKey.
This sketch uses the Over-The-Air-Activation (OTAA) method.
The sketch transmits a byte value 0x01, each time the button is pressed.
It also transmits the temperature and humidity data from the DHT11 sensor, every 60 seconds.
The two leds can be switch On or Off, by sending a downlink message.
This is already demonstrated in Tutorial 25.
Connect the self build LoRa development board to your computer using the USB cable.
In the Arduino IDE, select menu Tools | Board and select: Arduino/Genuino Uno
In the Arduino IDE, select menu Tools | Port and select: your_port
Compile and upload the ttn-otaa-sensors sketch.
You should not see any errors.
In the Arduino IDE, select menu Tools | Serial Monitor
Select baud rate: 9600
Make sure a LoRa gateway is in your area and your LoRa end device can send messages to that gateway.
Go to The Things Console and see if the end device is registering.
Check if the temperature and humidity data is received every 60 seconds.
Press the switch button, in the Things Console you will see the message: "button: activated"
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
youtube.com/c/mobilefish/about
This is part 34 of the IOTA tutorial.
In this video series different topics will be explained which will help you to understand IOTA.
It is recommended to watch each video sequentially as I may refer to certain IOTA topics explained earlier.
In this tutorial I will explain in detail how the Time-based One-time Password algorithm works.
This tutorial is not specific IOTA related.
It is intended for developers who wants to understand how the Time-based One-time Password algorithm works.
The Time-based One-time Password algorithm generates single use passwords, also known as tokens, which are only valid for a certain time period.
Often this time period is 60 seconds.
These generated tokens are based on a shared secret key.
The Time-Based One-Time Password algorithm was published as RFC 6238 by the Internet Engineering Task Force (IETF).
See: tools.ietf.org/html/rfc6238
In RFC 6238 a Java reference Time-based One-time Password algorithm can be found.
See also: mobilefish.com/download/java/TOTP.java
The Time-based One-time Password algorithm is an extension of the HMAC-Based One-Time Password (HOTP) algorithm, which was published as RFC 4226 by the IETF.
The HMAC-Based One-Time Password defines an algorithm to create an one time password from a shared secret key and a counter.
See: tools.ietf.org/html/rfc4226
When 2FA is enabled on the Trinity wallet, it first generates a shared secret key.
You must write down this shared secret key and safely store it.
Usually this shared secret key with additional information is embedded in a QR code which you can scan by a 2FA app such as the Google Authenticator.
After the QR code is scanned the Google Authenticator generates a token which is a unique code, based on the shared secret key and the current time.
Lets assume you are currently in Beijing (China).
The local Beijing date and time is 4 December 2018, 20:24:20 (UTC+8).
The date and time at that moment at 0 degree longitude meridian is 4 December 2018, 12:24:20.
UTC stands for Coordinated Universal Time and is the time at the 0 degree longitude meridian (Prime Meridian).
Convert this date and time (4 December 2018, 12:24:20) to Unix Epoch Time.
Instead of Unix Epoch Time we can also say Unix Time (Tunix).
Unix Epoch Time is the number of seconds that have elapsed since, 1 January 1970 00:00:00 UTC, not counting leap seconds.
If the date and time at 0 degree longitude meridian is 4 December 2018, 12:24:20 than Tunix = 1543926260 sec
Equation: N = floor(Tunix / ts)
N = number of time steps which have been elapsed since Unix Epoch Time.
floor = function which rounds a number downward to its nearest integer.
Tunix = number of seconds that have elapsed since, 1 January 1970 00:00:00 UTC, not counting leap seconds.
ts = time step. By default the time step is 30 sec.
Convert the number of time steps (N) into a hexadecimal value.
The hexadecimal value must have 16 hexadecimal characters (=8 bytes).
If not, prepend with 0's.
Convert the hexadecimal value into a 8 bytes array and assign this value to variable m (=message).
Convert the shared secret key into a 20 bytes array and assign this value to variable K.
The shared secret key is a randomly generated 20 bytes number which is base-32 encoded.
For readability this key is divided in groups of 4 characters and all in lower case.
More information about base-32, see Blockchain tutorial 31:
youtu.be/Va8FLD-iuTg
Calculate the HMAC hash using the HMAC-SHA1 algorithm.
More information about HMAC, see Blockchain tutorial 30:
youtu.be/emBgrRIyyWQ
This HMAC hash size is 160 bits (=20 bytes).
Get the last 4 bits of this hash value and get its integer value.
In this example, the last 4 bits is 0xA which represents integer 10.
This integer is called the offset.
Starting from the offset, get the first 4 bytes from the HMAC hash.
Apply a binary operation for each byte.
Convert this binary value to an integer
Calculate the Token = integer value % 10^n
where n is the token size.
If the token size is less than n, prefix with 0's.
Every 30 seconds a new token is generated.
But a token remains valid for 60 seconds.
An online Time-based One-time Password generator can be found at:
mobilefish.com/services/cryptocurrency/totp.html
WARNING: DO NOT USE THIS TOOL TO GENERATE YOUR TOKENS. IT IS ONLY INTENDED FOR EDUCATIONAL, TEST OR DEMONSTRATION PURPOSES.
Check out all my other IOTA tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdIf6CQMHf7hUcDZBbxHyza
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/iota/iota_quickguide_tutorial.html
#mobilefish #howto #iota


