Uploaded May 2018 | Updated September 2026, 2 weeks ago
If you like this video and want to support me, go this page for my donation crypto addresses:
youtube.com/c/mobilefish/about
This is part 25 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.
The main objective of this video is to explain what WebRTC is and demonstrate a proof-of-concept WebRTC MAM signaling implementation.
WebRTC (Web Real-Time Communication) was announced in 2011 and is a HTML5 specification supported by Google, Mozilla and Opera, amongst others.
WebRTC provides browsers and devices with direct data, voice and video peer-to-peer communication without the need to install plugins or download native apps.
WebRTC is supported by most modern browsers such as Chrome, Firefox, Safari and Microsoft Edge.
WebRTC uses the following main component JavaScript APIs:
- RTCPeerConnection
To setup and create a peer-to-peer connection.
- RTCDataChannel
To bidirectional transfer arbitrary data peer-to-peer.
Every data channel is associated with an RTCPeerConnection, and each peer connection can have one or more data channels.
- MediaStream (more commonly known by its JavaScript function getUserMedia)
It gives access to a stream object that represent video (camera) and audio (microphone) streams.
If two peers needs to communicate directly with each other they need to know each other public ip address and port.
Often a direct connection is not possible because the peers uses a router with a built-in firewall that uses Network Address Translation (NAT).
The Interactive Connectivity Establishment framework (ICE) deals with the process of connecting peers through NATs.
A STUN (Session Transversal Utilities for NAT) server allows the peers to discover their public IP address, port and the type of NAT they are behind.
This information is used to establish a peer-to-peer connection.
A media stream will flow directly between the peers.
In most cases (~70%) a STUN server suffice to setup a peer-to-peer connection.
If a STUN server cannot establish the connection, ICE uses a TURN (Traversal Using Relay NAT) server.
When a TURN server is used, this server relays the media stream between the peers.
The use of a STUN server is preferred above a TURN server because a TURN server uses a lot of processing power.
In a WebRTC application the STUN and TURN server locations can be specified.
There are public STUN servers available but use them for prototyping or non-mission critical applications.
To create a peer-to-peer connection, the peers must also exchange several types of information first, for example:
- Their external IP addresses and ports.
- Their codecs and media types that they support.
- When to initialise, close, and modify the communications sessions.
This exchange of information between peers is called signaling and usually an external server is used called a "signaling server" which can store this information, for example in a database.
Signaling methods and protocols are not specified by the WebRTC standards.
When Alice initiates a peer-to-peer communication with Bob, Alice is called the local user (aka caller) and Bob is the called the remote user (aka callee).
The information send from Alice's browser to a signaling server is called the "offer", and Bob's browser information send to a signaling server is called the "answer".
The offer and answer are written in a so called Session Description Protocol (SDP) format.
To demonstrate the WebRTC signaling process use the following application:
mobilefish.com/download/webrtc/webrtc_noserver.html
I have created a proof-of-concept to test if Masked Authenticated Messaging (MAM) can be used as a signaling implementation for WebRTC.
See: mobilefish.com/services/cryptocurrency/mam_webrtc.html
You can use Masked Authenticated Messaging (MAM) as a signaling implementation for WebRTC.
However it takes too long to establish a peer-to-peer connection because publishing the offer and answer to the Tangle takes too much time.
In a production like environment this is not acceptable, but for prototyping or just for demo applications its perfect.
When using MAM it is recommended to compress your data, which will decrease the time to publish this data to the Tangle.
For example you can use the lz-string compression javascript library.
See: pieroxy.net/blog/pages/lz-string/index.html
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
If you like this video and want to support me, go this page for my donation crypto addresses:
youtube.com/c/mobilefish/about
This is part 25 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.
The main objective of this video is to explain what WebRTC is and demonstrate a proof-of-concept WebRTC MAM signaling implementation.
WebRTC (Web Real-Time Communication) was announced in 2011 and is a HTML5 specification supported by Google, Mozilla and Opera, amongst others.
WebRTC provides browsers and devices with direct data, voice and video peer-to-peer communication without the need to install plugins or download native apps.
WebRTC is supported by most modern browsers such as Chrome, Firefox, Safari and Microsoft Edge.
WebRTC uses the following main component JavaScript APIs:
- RTCPeerConnection
To setup and create a peer-to-peer connection.
- RTCDataChannel
To bidirectional transfer arbitrary data peer-to-peer.
Every data channel is associated with an RTCPeerConnection, and each peer connection can have one or more data channels.
- MediaStream (more commonly known by its JavaScript function getUserMedia)
It gives access to a stream object that represent video (camera) and audio (microphone) streams.
If two peers needs to communicate directly with each other they need to know each other public ip address and port.
Often a direct connection is not possible because the peers uses a router with a built-in firewall that uses Network Address Translation (NAT).
The Interactive Connectivity Establishment framework (ICE) deals with the process of connecting peers through NATs.
A STUN (Session Transversal Utilities for NAT) server allows the peers to discover their public IP address, port and the type of NAT they are behind.
This information is used to establish a peer-to-peer connection.
A media stream will flow directly between the peers.
In most cases (~70%) a STUN server suffice to setup a peer-to-peer connection.
If a STUN server cannot establish the connection, ICE uses a TURN (Traversal Using Relay NAT) server.
When a TURN server is used, this server relays the media stream between the peers.
The use of a STUN server is preferred above a TURN server because a TURN server uses a lot of processing power.
In a WebRTC application the STUN and TURN server locations can be specified.
There are public STUN servers available but use them for prototyping or non-mission critical applications.
To create a peer-to-peer connection, the peers must also exchange several types of information first, for example:
- Their external IP addresses and ports.
- Their codecs and media types that they support.
- When to initialise, close, and modify the communications sessions.
This exchange of information between peers is called signaling and usually an external server is used called a "signaling server" which can store this information, for example in a database.
Signaling methods and protocols are not specified by the WebRTC standards.
When Alice initiates a peer-to-peer communication with Bob, Alice is called the local user (aka caller) and Bob is the called the remote user (aka callee).
The information send from Alice's browser to a signaling server is called the "offer", and Bob's browser information send to a signaling server is called the "answer".
The offer and answer are written in a so called Session Description Protocol (SDP) format.
To demonstrate the WebRTC signaling process use the following application:
mobilefish.com/download/webrtc/webrtc_noserver.html
I have created a proof-of-concept to test if Masked Authenticated Messaging (MAM) can be used as a signaling implementation for WebRTC.
See: mobilefish.com/services/cryptocurrency/mam_webrtc.html
You can use Masked Authenticated Messaging (MAM) as a signaling implementation for WebRTC.
However it takes too long to establish a peer-to-peer connection because publishing the offer and answer to the Tangle takes too much time.
In a production like environment this is not acceptable, but for prototyping or just for demo applications its perfect.
When using MAM it is recommended to compress your data, which will decrease the time to publish this data to the Tangle.
For example you can use the lz-string compression javascript library.
See: pieroxy.net/blog/pages/lz-string/index.html
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



![LoRa/LoRaWAN tutorial 28.1: Installing Semtech UDP Packet Forwarder for the RAK831 Pilot Gateway
If you like this video and want to support me, go this page for my donation Paypal or crypto addresses:
https://www.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 https://github.com/RAKWireless/RAK831-LoRaGateway-RPi and simplified the installation procedure.
The repository https://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:
https://www.thethingsnetwork.org/docs/lorawan/frequencies-by-country.html
Installation procedure:
git clone https://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)
https://github.com/Lora-net/lora_gateway
/opt/ttn-gateway/lora_gateway
Semtech UDP Packet Forwarder (V4.0.1)
https://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 https://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:
https://youtu.be/bea7g5isD0w?t=1779
Optionally enable WiFi, watch:
https://youtu.be/bea7g5isD0w?t=1844
More information about the RAK831 Pilot Gateway:
https://www.aliexpress.com/store/product/IoT-in-a-Box-Powered-Pilot-Gate-way-with-Semtech-SX1301/2805180_32951841630.html
Interested in the RAK831 components:
https://www.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:
https://www.youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
https://www.youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
https://www.mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan LoRa/LoRaWAN tutorial 28.1: Installing Semtech UDP Packet Forwarder for the RAK831 Pilot Gateway](https://i.ytimg.com/vi/aR9-gbZvBh0/mqdefault.jpg)






