sensors

1 downloads 0 Views 17MB Size Report
Sep 27, 2018 - wherein we transfer image sensor data over the LoRa physical layer (PHY) in a node-to-node network model. ...... ICT Express 2017, 3,. 14–21 ...
sensors Article

Overcoming Limitations of LoRa Physical Layer in Image Transmission Akram H. Jebril 1,2 , Aduwati Sali 1, *, Alyani Ismail 1 and Mohd Fadlee A. Rasid 1 1

2

*

Wireless & Photonic Networks Research Center of Excellence (WiPNet), Department of Computer and Communication System Engineering, Faculty of Engineering, UPM, Serdang 43400, Selangor, Malaysia; [email protected] (A.H.J.); [email protected] (A.I.); [email protected] (M.F.A.R.) Department of Communication Engineering, Technical College of Civil Aviation & Meteorology, Esbea, Tripoli 84116, Libya Correspondence: [email protected]; Tel.: +60-1328-63177

Received: 17 May 2018; Accepted: 10 August 2018; Published: 27 September 2018

 

Abstract: As a possible implementation of a low-power wide-area network (LPWAN), Long Range (LoRa) technology is considered to be the future wireless communication standard for the Internet of Things (IoT) as it offers competitive features, such as a long communication range, low cost, and reduced power consumption, which make it an optimum alternative to the current wireless sensor networks and conventional cellular technologies. However, the limited bandwidth available for physical layer modulation in LoRa makes it unsuitable for high bit rate data transfer from devices like image sensors. In this paper, we propose a new method for mangrove forest monitoring in Malaysia, wherein we transfer image sensor data over the LoRa physical layer (PHY) in a node-to-node network model. In implementing this method, we produce a novel scheme for overcoming the bandwidth limitation of LoRa. With this scheme the images, which requires high data rate to transfer, collected by the sensor are encrypted as hexadecimal data and then split into packets for transfer via the LoRa physical layer (PHY). To assess the quality of images transferred using this scheme, we measured the packet loss rate, peak signal-to-noise ratio (PSNR), and structural similarity (SSIM) index of each image. These measurements verify the proposed scheme for image transmission, and support the industrial and academic trend which promotes LoRa as the future solution for IoT infrastructure. Keywords: LoRa; wireless sensor network (WSN); low-power wide-area network (LPWAN); image encryption; peak signal to noise ratio (PSNR); structural similarity index measure (SSIM)

1. Introduction Wireless remote sensing (WSN) technologies vary in their ability to transfer data at low powers, high speeds, and over long ranges. Today, low-power wide-area networks (LPWANs) are the ideal WSN technology as their extended coverage, low cost, and energy saving features (which are possible without the need for communication infrastructure [1]) make them complementary to short-range wireless technologies, such as Wi-Fi and Bluetooth Low Energy, and credible alternatives to cellular technology, for urban-scale Internet of Things (IoT) applications. This ability for long-range communication to thousands of devices (star topologies) at a low cost and limited power consumption is due to improvements in duty cycling and networking protocols [2]. Long Range (LoRa), narrowband IoT (NB-IoT), IEEE 802.15.4, Sigfox and LTE-M are examples of recent LPWAN technologies used by (IoT) applications to connect wireless sensors to extend the deployment of the IoT and reduce power consumption. One of the most important features of LPWANs is the ability to enhance the signal-to-noise ratio (SNR) at the receiver by narrowing its bandwidth or by spreading the energy of the signal over a wider

Sensors 2018, 18, 3257; doi:10.3390/s18103257

www.mdpi.com/journal/sensors

Sensors 2018, 18, 3257 Sensors 2018, 18, x FOR PEER REVIEW

2 of 22 2 of 22

frequency range. For example, in NB-IoT, narrowing the bandwidth to less than 25 kHz increases thewider SNR frequency and enhances theFor performance the transceiver. similar effect istopossible Sigfox range. example, inofNB-IoT, narrowingAthe bandwidth less thanwith 25 kHz when the bandwidth is reduced approximately 100the Hz. With LoRa, narrowing bandwidth of a increases the SNR and enhancestothe performance of transceiver. A similar effectthe is possible with Sigfox enables when the reduced to approximately 100 Hz. With LoRa, narrowing receiver the bandwidth decoding ofistransmissions with signal amplitudes 19.5 dB below the noisethe floor, bandwidth of a receiver enables the decoding of ranges transmissions withtechniques. signal amplitudes 19.5 dB below consequently enabling communication at longer than other The capability for long the noise floor, consequently enabling communication at longer ranges than other techniques. The range communication with LoRa characterizes it as the future network infrastructure for advanced for since long it range communication LoRa characterizes as the and future network IoTcapability applications, can connect hundredswith of IoT end-devices to oneitgateway, does not need infrastructure for advanced IoT applications, since it can connect hundreds of IoT end-devices one special requirements to connect to other existing networks. In this paper, we demonstrateto the first gateway, and does not need special requirements to connect to other existing networks. In this paper, application of LoRa in a WSN for transferring images of mangrove forests captured by an image we demonstrate themangrove first application of LoRa a WSN transferring images of mangrove forests 1). sensor and used for monitoring ininthe Sabakfor Bernam district of Malaysia (see Figure captured by an image sensor and used for mangrove monitoring in the Sabak Bernam district of Currently GPP (2G/3G) technology by Ericsson Co. [3] used to monitor the status of the mangrove Malaysia (see Figure 1). Currently GPP (2G/3G) technology by Ericsson Co. [3] used to monitor the trees by reading data from soil moisture, smoke, sea level measurements, and temperature sensors. status of the mangrove trees by reading data from soil moisture, smoke, sea level measurements, and Subsequently, these data transferred to the community center and processed to develop strategies temperature sensors. Subsequently, these data transferred to the community center and processed to to prevent the degradation of the mangrove forest. Using LoRa as a WSN with Image sensors for develop strategies to prevent the degradation of the mangrove forest. Using LoRa as a WSN with the first time in this area beside it will help in the environment monitoring process, it will contribute Image sensors for the first time in this area beside it will help in the environment monitoring process, in itadding LPWAN capabilities of reducing power of consumption (powered by batteries for years), will contribute in adding LPWAN capabilities reducing power consumption (powered by cost of installation (no need for more expensive equipment) and increase the range of transferring data batteries for years), cost of installation (no need for more expensive equipment) and increase the (see Figure 2 for more information). range of transferring data (see Figure 2 for more information).

Figure 1. Google map illustrating the location of the target mangrove forest site in Sabak Bernam, Malaysia. Figure 1. Google map illustrating the location of the target mangrove forest site in Sabak Bernam, Malaysia.

The rest of the paper is structured as follows. First a LPWAN image transferring related works is discussed. Then, a background is provided about LoRa network and some important parameters The restitsof operation. the paper isAfter structured follows. First LPWAN image transferring related works dictating this, aascomparison is adone between LoRa and other LPWAN is discussed. a background is advantages provided about LoRa network some importantAfter parameters technologiesThen, which highlights the of this technique forand WSN applications. this, dictating itsthe operation. Aftertransfer this, a comparison is done and other LPWAN technologies details of novel image experiment and howbetween it was setLoRa up are discussed. We subsequently which highlights of experiment, this technique WSN Aftertransfer this, details novel list and discussthe theadvantages results of this to for verify theapplications. viability of image over of thethe LoRa image transfer howthat it was set are discussed. list andWSN. discuss physical layer.experiment Our results and indicate LoRa is up an ideal technologyWe for subsequently mangrove monitoring the results of this experiment, to verify the viability of image transfer over the LoRa physical layer. 2. Related Works that LoRa is an ideal technology for mangrove monitoring WSN. Our results indicate Most of the recent research on LoRa network focuses on its outdoor performance and coverage. 2. Related Works Significantly, LoRa proved it can deliver more than half of the packets from 5–10 km range in urban applications and in maritime where focuses 15–30 km observed [4]. A few Most of the recent researchapplications on LoRa network ondistances its outdoor performance and studies coverage. expressed concern regarding image transmission over the LoRa network since images demand a high Significantly, LoRa proved it can deliver more than half of the packets from 5–10 km range in urban

Sensors 2018, 18, 3257

3 of 22

applications and in maritime applications where 15–30 km distances observed [4]. A few studies expressed concern regarding image transmission over the LoRa network since images demand a high Sensors 2018, 18, x FOR PEER REVIEW 3 of 22 amount of bits and consume more energy in the transmission operation. One of these significant related works is a paper by Congduc Pham [5] who built an “off-the-shelves low-cost components” amount of bits and consume more energy in the transmission operation. One of these significant imagerelated sensor platform which results images overcomponents” LoRa, although works is a paper byshowed Congducpromising Pham [5] who builtofantransmitting “off-the-shelves low-cost only aimage 1.8 km range achieved thisshowed withoutpromising packet loss. Another paper byimages Fan et over al. [6]LoRa, givesalthough a theoretical sensor platform which results of transmitting analysis thekm new wireless visual protocol LoRa modulation butetthis wasgives not tested onlyfor a 1.8 range achieved thissensor without packet using loss. Another paper by Fan al. [6] a theoretical analysis for the new wireless visual sensor protocol using LoRa modulation but this was outdoors unlike our paper. notthe tested unlike our paper. To bestoutdoors of our knowledge, there is no other study testing LoRa physical layer (PHY) capabilities To the best of our aknowledge, no other study testing LoRa physical layer (PHY) in images transmission for mangrove there forestisarea thus far. This is because its long range capability capabilities in images transmission for a mangrove forest area thus far. This is because its long range affects the bandwidth which is considered a big barrier in transmitting images and multimedia data [7]. capability affects the bandwidth which is considered a big barrier in transmitting images and Although, most of the current implemented networks are short range networks, they have a wide multimedia data [7]. Although, most of the current implemented networks are short range networks, bandwidth and high data rate (e.g., Zibgee, LTE, etc.), and they have a serious problem with a limited they have a wide bandwidth and high data rate (e.g., Zibgee, LTE, etc.), and they have a serious link budget Moreover, and other cheaper in installation do not require problem[8]. with a limitedLoRa link budget [8]. LPWANs Moreover,are LoRa and other LPWANs and are cheaper in repeaters for distance beside LPWAN are cheaper to install and do not require repeaters installation and do not require repeaters for distance beside LPWAN are cheaper to install for anddistance. do Also,not LPWANs consumption (see Figure 2).power consumption (see Figure 2). require require repeatersless for power distance. Also, LPWANs require less

Figure 2. LPWAN is currently state-of-the-art technology technology inintransmitting images given global Figure 2. LPWAN is currently thethestate-of-the-art transmitting images given global concern for low power consumption and limited bandwidth [9]. (a) LPWANs are the highest in concern for low power consumption and limited bandwidth [9]. (a) LPWANs are the highest in energy energy efficiency and lowest in costs. (b) LPWANs are the longest in coverage range and the lowest efficiency and lowest in costs. (b) LPWANs are the longest in coverage range and the lowest in data rate. in data rate.

In following the following section, detailsabout about LoRa LoRa networks networks and with other LPWAN In the section, details andcomparisons comparisons with other LPWAN networks are discussed. networks are discussed. 3. Background 3. Background 3.1. LoRa Network 3.1. LoRa Network LoRa, which stands for the initial letters of the words ‘Long Range’, is a combination of LoRa, which stands for the initial letters of the words ‘Long Range’, is a combination of communication technologies and protocols, developed by Semtech (Camarillo, CA, USA), that communication technologies and protocols, developed by Semtech (Camarillo, CA, USA), that provides provides significantly longer range than other LPWAN technologies. Modulation with LoRa is based significantly longer range than other LPWAN technologies. Modulation with LoRa is based on on spread-spectrum techniques, and a variation of a chirp spread spectrum (CSS) modulation spread-spectrum techniques, and correction a variation of a [10]. chirpLoRa’s spread spectrum (CSS) modulation integrated integrated with forward error (FEC) CSS is the key factor for long distance with forward error with correction (FEC) [10]. CSS the is the keypower factor isfor signal transfer signal transfer a high-quality link,LoRa’s even when signal uplong to 20distance dB lower than the with anoise high-quality link, even when thefrequency signal power is up to(FSK) 20 dB than the signals noise floor [11,12]. floor [11,12]. LoRa uses unique shift keying forlower demodulating 19.5 dB below the noise floor. In contrast, other network technologies are typically only capable LoRa uses unique frequency shift keying (FSK) for demodulating signals 19.5 dB below theofnoise signals with powers of 8–10 dB above the noise [10]. of demodulating signals with floor.demodulating In contrast, other network technologies are typically onlyfloor capable The novelty of LoRa is in offering a continuous phase between different chirp symbols in the powers of 8–10 dB above the noise floor [10]. preamble part of the physical layer packet, which enables simpler and more accurate timing and The novelty of LoRa is in offering a continuous phase between different chirp symbols in the frequency synchronization, without requiring costly components for generating a settled local clock preamble part of the physical layer packet, which enables simpler and more accurate timing and in the LoRa node [13]. A single LoRa gateway can cover hundreds of square kilometers [14].

Sensors 2018, 18, 3257

4 of 22

frequency synchronization, without requiring costly components for generating a settled local clock in the LoRa node [13]. A single LoRa gateway can cover hundreds of square kilometers [14]. The LoRa MAC layer or LoRaWAN is the communication protocol and system architecture layer of a LoRa network. It has the greatest influence on network capacity, quality of service, battery lifetime of individual nodes, and security. To isolate the testing of the LoRa physical layer and its ability to transfer images at a limited bandwidth, LoRaWAN was not used in this paper. 3.2. The LoRa Physical Layer LoRa can commonly refer to two distinct layers: a physical layer using the CSS and a link layer. The LoRa physical layer consists of many parameters which can be configured into 6720 different settings [15] to offer a wide range of choices for ensuring a good quality link or consuming less energy. The most important parameters of the LoRa physical layer are the carrier frequency (CF), spreading factor (SF), bandwidth (BW), transmission power (TP), and coding rate (CR). These are discussed further in the proceeding paragraphs, and Table 1 below. Table 1. LoRa parameter settings and their effects on communication performance [2]. Setting

Values

Effects

Bandwidth

125, . . . , 500 kHz

A higher bandwidth is required for transmitting data at high rates (1 kHz = 1 kcps). However, increasing this parameter decreases the communication range and sensitivity.

Spreading Factor

26 , . . . , 212

chips symbol

Coding Rate

4/5, . . . , 4/8

Transmission Power

−4, . . . , 20 dBm

A higher spreading factor (SF) increases the communication range, radio sensitivity, and the signal-to-noise ratio (SNR). However, energy consumption consequently increases. Bigger coding rates increase the protection against decoding errors and interference bursts at the expense of longer packets and higher power consumption. The signal-to-noise ratio is increased by increasing the transmission power at the cost of energy expenditure.

The following are definitions for these parameters:

• •







Carrier Frequency: CF represents the central transmission frequency used in a band. This can be programmed between 137 MHz to 1020 MHz, in steps of 61 Hz. Spreading factor: SF is the ratio between the symbol rate and the chip rate. It can be set between 6 and 12 in LoRa [16]. For each SF, there are 2SF chips per symbol. SF has a more significant influence on energy consumption than increasing the transmission power, which increases the communication range. Hence, modifying the SF is more effective in reducing the energy consumption while maintaining the communication range. A larger SF increases the communication sensitivity and data bit rate and reduces the time on air (TOA). Bandwidth: BW is the range of frequencies available for transmission. A larger BW allows transmission at higher data rates but with a shorter TOA and lower sensitivity. In contrast, a lower BW enables a higher sensitivity but a lower data bit rate. Coding rate: FEC offers protection against interference and can be configured by setting the CR to 4/5, 4/6, 4/7, or 4/8. In LoRa, more robust protection from interference requires a higher CR, which increases the TOA. Transmission power: In LoRa, the power required to transmit a specific data packet can be adjusted as appropriate. The relationship between SF and the data bit rate in LoRa is defined as follows 1 Rb = SF × SF bits/s (1) [2 /BW ]

Sensors 2018, 18, 3257

5 of 22

where BW is the modulation bandwidth in Hz. From Equation (1), we note that spreading factor is directly proportional to the data rate [17]. 3.3. Comparison of LoRa and Other LPWAN Technologies In the following sections, we compare LoRa to a number of prominent LPWAN technologies, to demonstrate that it is the best choice for the WSN monitoring mangrove forests in Malaysia. 3.3.1. LoRa versus NB-IoT NB-IoT is a network technology based on the long-term evolution (LTE) standard that offers connectivity in the 200 kHz spectrum. Most current IoT applications adopt this technology because of its good coverage and low cost of deployment. NB-IoT has been specified under 3GPP release 13 for inclusion within the LTE system. The advantages of the NB-IoT standard include the ability to deploy the technology using existing LTE networks, a large coverage area, and a high quality of customer service. Similarly, features of the LoRaWAN standard are a long communication range, and thus, coverage area, long time service of user terminals, low cost of network deployment and user terminals, and a high penetrating power. However, the data rates achievable with LoRaWAN are relatively low [18]. Despite the large coverage area and high-quality link offered by NB-IoT even when implemented using existing LTE networks, the cost of the deployment of this technology is expensive compared to LoRa, as a greater cost is incurred in upgrading existing base stations [18]. 3.3.2. LoRa versus IEEE 802.15.4 The IEEE 802.15.4 standard offers data rates approaching 250 kbit/s. However, the transmission range greatly depends on the environment. While, for a clear line-of-sight this can reach 1000 m, the range is measured in tens of meters in most cases. Three unlicensed frequency bands are supported by the IEEE 802.15.4 standard: 868 MHz in Europe, 928 MHz in North America, and 2.4 GHz worldwide [19]. In general, LoRa is less sensitive with respect to interference than IEEE 802.15.4g. Research on channelization has proven that it is resilient enough to obtain high packet reception rates (PRR), even with strong interference from IEEE 802.15.4g signals, which are communicated in the same frequency band. The impact of these signals depends significantly on the configuration of the LoRa network (i.e., the SF and BW). At high data rates, LoRa tolerates interference from signals with amplitudes that are 6 dB higher than the power of the actual LoRa signal being received. At low data rates, this tolerance goes up to 16 dB, as defined by the acceptable PRR [20]. 3.3.3. LoRa versus Sigfox Of the wireless communication technologies that have been classified for IoT applications, the two that are commonly deployed in the ISM band (LoRaWAN and Sigfox) are long range. Sigfox is a proprietary ultra-narrowband technology, developed by an eponymous company based in Labège, France, which uses differential binary phase-shift keying (DBPSK) modulation. In contrast, modulation with LoRa is based on proprietary spread spectrum techniques and Gaussian frequency shift keying [21]. Communication in Sigfox is performed in the 868-MHz frequency band, with the spectrum divided into 400 channels of 100 Hz. Sigfox claims that up to a million end-devices can be handled by only one access point, and the coverage can reach 50 km in rural areas and 10 km in urban areas [12]. With the Sigfox network, data packages are transmitted three times at random frequencies, to maximize the probability of successfully receiving at least one packet, as it is more sensitive to interference than LoRa networks. In [21], coverage and capacity for Sigfox and LoRaWAN on area covering 150 km2 of urban areas Northern Denmark tested, and found that uplink indoor coverage

Sensors 2018, 18, 3257

6 of 22

(20 dB penetration loss), the impact from interference is even worse, as the link budget is reduced, where LoRaWAN has 78% coverage and Sigfox less than 50% coverage. 3.3.4. Summary of the Advantages of LoRa Sensors 2018, x FOR PEER REVIEW 6 of 22many From the 18, comparisons performed in the previous sections, it is evident that LoRa has advantages over other LPWN networks. The most significant advantages of LoRa with respect to its 3.3.4. Summary of the Advantages of LoRa deployment in future infrastructure networks are [16]

• •

• • • • •

From the comparisons performed in the previous sections, it is evident that LoRa has many advantages othertransmission LPWN networks. Thedifferent most significant advantages LoRa with respect to its data Orthogonalover packet using SFs (from 6 to 12)ofconcurrently, without deployment in future infrastructure networks are [16] collisions or degradation in performance, reducing TOA.

Long range communication whereusing outdoor coverage can reach several kilometres, while indoor • Orthogonal packet transmission different SFs (from 6 to 12) concurrently, without data collisions or degradation performance, reducing TOA.in multi-hop scenario approaches tens coverage reaches hundredsin of meters and coverage • kilometres, Long range communication where outdoor coverage can reach several kilometres, while indoor of reaches hundreds of meters and coverage in multi-hop scenario approaches tens of Low coverage cost of network deployment as nodes can reach the sink directly without intermediary routes, kilometres, Adaptive data rates and multichannel modem transceivers for receiving messages from a large • Low cost of network deployment as nodes can reach the sink directly without intermediary number of network nodes, routes, Very low energy for a longmodem batterytransceivers lifetime, for receiving messages from a large • Adaptive dataconsumption rates and multichannel of network nodes, Highnumber penetrating ability of radio signals; and, • Very low energy consumption for a long battery lifetime, Operation in the unlicensed range.

• High penetrating ability of radio signals; and, • Operation in theTransmission unlicensed range. 3.4. Limitations to Image over LoRa

3.4. Limitations to Image Transmission over LoRa WSNs (see Figure 3) consist of remote sensing nodes monitoring aspects of their environment, which send collected data to a sink center for processing for a specificaspects application. biggest design WSNs (see Figure 3) consist of remote sensing nodes monitoring of theirThe environment, concern forsend WSNs is energy should reduced in order offer long-range which collected data toconsumption, a sink center forwhich processing for abe specific application. Thetobiggest design connections wide is coverage. However, the transfer of data from the sensing nodes to the sink is concern and for WSNs energy consumption, which should be reduced in order to offer long-range connections widebandwidth coverage. However, transfer of data from the sensing nodes tocomputational the sink is hindered by the and narrow of thesethe networks and their limited memory for hindered by the narrow bandwidth of these networks and their limited memory for computational processes [1]. Moreover, LoRa technology constrained to 1% duty-cycle (i.e., 36 s/h) applies to the total processestime, [1]. Moreover, LoRa only technology constrained duty-cycle (i.e.,of 36transmission s/h) applies totime the [22]. transmission which means can transmit datato361% s each one hour total transmission time, which means only can transmit data 36 s each one hour of transmission time This limitation makes transferring data from devices like image sensors very complex, as a large bit [22]. This limitation makes transferring data from devices like image sensors very complex, as a large rate is required for the communication of image data. Hence, although LoRa has the ability to combine bit rate is required for the communication of image data. Hence, although LoRa has the ability to the features of LPWA networks and WSN networks, transferring multimedia data over LoRa is a combine the features of LPWA networks and WSN networks, transferring multimedia data over challenging becauseissue of the data transmission limitation. LoRa is aissue challenging because of the data transmission limitation.

Figure 3. Composition of a wireless sensing network (WSN) [1].

Figure 3. Composition of a wireless sensing network (WSN) [1].

The bandwidth of transmission is the most important factor that affects the performance of the

The of transmission is the most important thatofaffects the performance CSS bandwidth technique used for LoRa modulation. A LoRa symbolfactor consists 2SF chirps, with one chirpof the SF transmitted per second (chirp rate), equal to a bandwidth of one Hertz [12]. Moreover, with LoRa CSS technique used for LoRa modulation. A LoRa symbol consists of 2 chirps, with one chirp modulation the bit rate and symbol rate at a given SF are proportional to bandwidth. The duration of a LoRa symbol, Ts, can be calculated from the following equation, while the data bit rate can be calculated using Equation (1) [12]:

Sensors 2018, 18, 3257

7 of 22

transmitted per second (chirp rate), equal to a bandwidth of one Hertz [12]. Moreover, with LoRa modulation the bit rate and symbol rate at a given SF are proportional to bandwidth. The duration of a LoRa symbol, Ts , can be calculated from the following equation, while the data bit rate can be calculated using Equation (1) [12]: Sensors 2018, 18, x FOR PEER REVIEW

Ts =

2SF BW

7 of 22

(2)

2

(2) the = From Equations (1) and (2) we observe that decreasing the bandwidth will decrease transmission rate and consequently increase the sensitivity. Hence, to improve the performance From Equations (1) and (2) we observe that decreasing the bandwidth will decrease the of LoRa and increase theconsequently communication range, the bandwidth be limited, such that of only a transmission rate and increase the sensitivity. Hence,must to improve the performance smaller bitand rateincrease data can transferred. In this the paper, the lowest configuration (125 kHz) is used to LoRa thebe communication range, bandwidth mustBW be limited, such that only a smaller attainbit the highest sensitivity for long transmissions. rate data can be transferred. In this paper, the lowest BW configuration (125 kHz) is used to attain the highest sensitivity for long transmissions.

4. Experimental Method 4. Experimental Method

To verify the feasibility of image transferring over the LoRa physical layer, we conducted a To verify the feasibility of image over mangrove the LoRa physical layer, we conducted a practical measurement experiment in thetransferring Sabak Bernam forest, northwest of the Selangor practical measurement experiment in the Sabak Bernam mangrove forest, northwest of the Selangor state, Malaysia. For this experiment, the LoRa transmission node was fixed to the top of a Skylift crane, state, Malaysia. For this experiment, the LoRa transmission node was fixed to the top of a Skylift at a height of approximately 40 m, and the receiver node was installed to the back of a four-wheel crane, at a height of approximately 40 m, and the receiver node was installed to the back of a fourdrive vehicle, which travelled one kilometer following each measurement, to allow for the assessment wheel drive vehicle, which travelled one kilometer following each measurement, to allow for the of image qualityofatimage different distances, as distances, illustratedasinillustrated Figure 4.in Figure 4. assessment quality at different

Figure 4. LoRa measurements from different locations in Sabak Bernam (Ptx = 14 dBm).

Figure 4. LoRa measurements from different locations in Sabak Bernam (Ptx = 14 dBm).

4.1. Hardware Setup

4.1. Hardware Setup

The transmission node, as illustrated in Figure 5, consists of a LoRa Arduino shield that comprise

The node, as illustratedstacked in Figure 5, consists a LoRa Arduino shield comprise of antransmission RN2903 transceiver (microchip) on an Arduino of MEGA microprocessor. It isthat good to that transceiver Arduino is an(microchip) open source board andon contains a very simple microcontroller which be to of anknow RN2903 stacked an Arduino MEGA microprocessor. It can is good to various sensorsboard and devices. Furthermore, consumes less power than knowconnected that Arduino is antypes openofsource and contains a veryArduino simple microcontroller which can be other tiny controlling devices such as Raspberry Pi, which is more complicated and considered as connected to various types of sensors and devices. Furthermore, Arduino consumes less power than computer TTLPi, Serial JPEG cameracomplicated connected toand the Arduino board otherfully tiny functional controlling devices[23]. suchAn asAdafruit Raspberry which is more considered as fully was used for capturing images. Also, a MicroSD card adaptor is connected to save the captured functional computer [23]. An Adafruit TTL Serial JPEG camera connected to the Arduino board was photos. The transmission node circuit is powered by a 12 V battery, which is charged by a solar panel, used ensuring for capturing images. Also, a MicroSD card adaptor is connected to save the captured photos. the node could be powered at a reduced cost. All these components are enclosed in a The transmission node circuit is them powered a 12 Venvironmental battery, which is charged a solar panel,6.ensuring weatherproof box, to protect fromby adverse conditions, as by shown in Figure the node could be powered at a reduced cost. All these components are enclosed in a weatherproof box, to protect them from adverse environmental conditions, as shown in Figure 6.

Sensors 2018, 18, 3257

8 of 22

Sensors 2018, 18, x FOR PEER REVIEW Sensors 2018, 18, x FOR PEER REVIEW

8 of 22 8 of 22

Sensors 2018, 18, x FOR PEER REVIEW

8 of 22

Figure 5. Components of the LoRa transmission node: (1) Arduino Mega microprocessor. (2) TTL

Figure 5. Components of the LoRa transmission node: (1) Arduino Mega microprocessor. (2) TTL Figure 5. Components the Shield LoRa transmission Arduino Mega microprocessor. (2) TTL Serial JPEG camera. (3) of LoRa radio adapter.node: (4) SD(1) Card Module. SerialSerial JPEG camera. (3)(3) LoRa Shield (4)SD SDCard CardModule. Module. JPEG camera. LoRa Shieldradio radio adapter. adapter. (4) Figure 5. Components of the LoRa transmission node: (1) Arduino Mega microprocessor. (2) TTL Serial JPEG camera. (3) LoRa Shield radio adapter. (4) SD Card Module.

Figure 6. Completed transmission node enclosed in a weatherproof box and fixed on top of a Skylift Figure node enclosed in a weatherproof box and fixed on top of a Skylift crane at6.aCompleted height of 40transmission m. Figure 6. Completed transmission node enclosed in a weatherproof box and fixed on top of a Skylift crane at a height of 40 m. 6. Completed craneFigure at a height of 40 m.transmission node enclosed in a weatherproof box and fixed on top of a Skylift Similarly, the receiver node (see Figure 7a) consists of a LoRa RN2903 Module controlled by an crane at a height of 40 m.

Similarly, the receiver node (see Figureon 7a)top consists of a LoRa RN2903 are Module controlled by ana Arduino Uno microprocessor and stacked of it. These components also enclosed inside Arduino Uno microprocessor and stacked on topconsists of it. These components are also enclosed inside aby an Similarly, the receiver node (see Figure 7a) of a LoRa RN2903 Module controlled weatherproof box, as shown in Figure 7b. Similarly, the receiver node (see Figure 7a) consists of a LoRa RN2903 Module controlled by an weatherproof box, as shown and in Figure 7b. Arduino UnoUno microprocessor stacked it. These Thesecomponents components enclosed inside a Arduino microprocessor and stackedon on top top of of it. areare alsoalso enclosed inside a weatherproof box,box, as shown in in Figure weatherproof as shown Figure7b. 7b.

(a) (a)

(b) (b)

Figure 7. (a) Receiver node: (1) Arduino Uno (2) LoRa RN2903 Module. (b) The receiver node enclosed (a) Uno (2) LoRa RN2903 Module. (b) (b) The receiver node enclosed Figure (a) Receiver node: inside a7.weatherproof box. (1) Arduino inside a weatherproof box. Figure 7. (a) Receiver node: (1) Arduino Uno (2) LoRa RN2903 Module. (b) The receiver node enclosed Figure 7. (a)8Receiver node: (1) Arduino Uno (2) LoRa (b) The receiver node enclosed Figure shows the receiver node installed on theRN2903 back ofModule. the four-wheel drive vehicle in order inside a weatherproof box.

Figure 8 shows distances. the receiver node installed on the back of the four-wheel drive vehicle in order inside ait weatherproof box. to test at different to test it at different distances. Figure 8 shows the receiver node installed on the back of the four-wheel drive vehicle in order to test it8atshows different Figure thedistances. receiver node installed on the back of the four-wheel drive vehicle in order to

test it at different distances.

Sensors2018, 2018,18, 18,x3257 Sensors FOR PEER REVIEW Sensors 2018, 18, x FOR PEER REVIEW

22 99ofof22 9 of 22

Figure 8. Completed receiver node fixedtotothe theback back of of aa four-wheel vehicle to enable testing at at Figure 8. Completed receiver node fixed four-wheeldrive drive vehicle to enable testing different distances. Figure 8. Completed receiver node fixed to the back of a four-wheel drive vehicle to enable testing at different distances. different distances. 4.2. Experimental Setup

4.2. Experimental Setup Figure Setup 9 illustrates the operation of the complete test setup. Here, the TTL camera captures a 4.2. Experimental Figure 9 illustrates the operation of the complete test setup. the TTL saves camera a JPEG image of the mangrove trees. After this, the Arduino MEGA Here, microprocessor the captures photo Figure 9 of illustrates theand operation of the complete test setup. Here, the TTL camera captures a data in the SD covertsAfter this data into format. The hexadecimalsaves data isthe then JPEG image thememory mangrove trees. this, thea hexadecimal Arduino MEGA microprocessor photo JPEG image of memory the mangrove trees.via After this, thea Arduino MEGA microprocessor savesdata the photo transferred to the receiver node thedata LoRa physical layer. This data is split into 84-character packets data in the SD and coverts this into hexadecimal format. The hexadecimal is then data in the SD memory and coverts this data into a hexadecimal format. The hexadecimal data is then to enable transmission. Once all these packets have been received, they are sent by the Arduino Uno transferred to the receiver node via the LoRa physical layer. This data is split into 84-character packets transferred to the receiver node via the LoRa physical layer. This data is split into 84-character packets processor to a personal computer, where they are reassembled and displayed using MATLAB code. to enable transmission. Once all these packets have been received, they are sent by the Arduino Uno to enable transmission. all these packets been received, are sent by the Arduinocode. Uno processor to a personalOnce computer, where they have are reassembled andthey displayed using MATLAB processor to a personal computer, where they are reassembled and displayed using MATLAB code.

Figure 9. Experimental setup for transferring images of the mangrove forest between two LoRa nodes.

4.2.1. Image Encryption Scheme for LoRa Transmission Data transmission from high bit rate devices, such as image sensors, over the LoRa network is Figure 9. Experimental setup for transferring images the mangrove foresttechnology between two LoRa nodes. very Such information inappropriate forofoftransfer with this because of the Figureslow. 9. Experimental setup foristransferring images the mangrove forest between two LoRa nodes. bandwidth limitation and LoRa constrained to 1% duty-cycle (i.e., 36 s/h) which means only can 4.2.1. Image Encryption Scheme for LoRa Transmission transmit data 36 s each one hour of transmission time. The LoRa MAC layer is typically responsible 4.2.1. Image Encryption Scheme for LoRa Transmission for transferring data from nodes to gateways. However, it has a limited ability to cope with image

Data transmission from high bit rate devices, such as image sensors, over the LoRa network is Data transmission from high bit rate devices, such as image sensors, over the LoRa network is very very slow. Such information is inappropriate for transfer with this technology because of the slow. Such information is inappropriate for transfer with this technology because of the bandwidth bandwidth limitation and LoRa constrained to 1% duty-cycle (i.e., 36 s/h) which means only can limitation and LoRa constrained to 1% duty-cycle (i.e., 36 s/h) which means only can transmit data transmit data 36 s each one hour of transmission time. The LoRa MAC layer is typically responsible for transferring data from nodes to gateways. However, it has a limited ability to cope with image

Sensors 2018, 18, 3257

10 of 22

36 s each one hour of transmission time. The LoRa MAC layer is typically responsible for transferring data from nodes to gateways. However, it has a limited ability to cope with image data due to the typical image size and the encryption used in the MAC layer. Hence, to enable transmission of image data, the LoRa physical layer is used with a new encryption method instead (see Appendix A). With the new method the image is captured by the Adafruit TTL camera and then saved in SD memory in the JPEG file format. From there it is subsequently converted into a hexadecimal formatted file. The Arduino processor then splits the hexadecimal file into packets containing 84 hexadecimal characters, which is the largest file size that can be transferred over the LoRa bandwidth at one time. To begin serial data transfer, the LoRa radio transmission command ‘radio tx’ is sent to the receiver node, followed by the hexadecimal packet. Data transfer is paused until the LoRa receiver node sends an acknowledgement that the initial packet has been received successfully. Then, subsequent packets are transmitted. 4.2.2. Receiving Images over LoRa The LoRa radio adapter in the receiver node listens for transmitted signals (see Appendix A) and sends a receipt of acknowledgement when they successfully arrive. Once all hexadecimal packages have been received, they are collected into one data variable by the Arduino processor and then sent, through a serial connection, for processing in MATLAB in order to retrieve image data from the hexadecimal package. 4.2.3. MATLAB Manipulation of Received Images MATLAB is used to help control the process of sending and receiving data through the LoRa adapters and to analyse the quality of the images before and after transfer over the LoRa network, using the PSNR and MSE. Prior to transmission, the MATLAB code sends a prompt message asking the user to enter a number from 1 to 6 to trigger transmission. These numbers correspond to the settings for the SF which, in this case, vary from 7 to 12. Following this, the data transfer process described above is initiated. The MATLAB code for triggering data transfer, retrieving received data packets, and saving and displaying the reassembled image is highlighted in the Appendix A (Figure A5). 4.3. LoRa Physical Layer Settings The configuration of the LoRa radio parameters for the transmitter and receiver nodes are summarized in Table 2, where a bandwidth of 125 kHz is used as the narrowest BW value that can be configured by the LoRa RN2903 Module. The aim of using this value is to ensure the highest sensitivity rate and long communication range. The used values of SF ranges from 7 to 12. Those values can be chosen by the default settings recommended by Semtech, the LoRa developer. Table 2. Settings of the LoRa physical layer during testing. BW

SF

PT

CR

125 kHz

From 7 to 12

14

4/8

4.4. Metrics The peak signal-to-noise ratio (PSNR) is typically used to assess the quality of an image transmitted over a network. As image quality is assessed quantitatively, this based on the difference between the pixels of the image reconstructed following transmission and the original image [24]. The PSNR of a transmitted image can be calculated as PSNR = 10 log

S2 MSE

(3)

Sensors 2018, 18, 3257

11 of 22

where, for an 8-bit image, S is 255 and MSE is the mean squared error, which is the average of the squared difference in the intensity pixels in the original image and the output image [24]. This is calculated as MSE =

1 mn

m −1 n −1

∑ ∑ [ I (i, j) − K(i, j)]2

(4)

i =0 j =1

where m and n are the respective length and width of the image in pixels I(i,j) and K(i,j) are functions describing the intensity of individual pixels in the transmitted and received image, respectively. Studies comparing reconstructed images with original images using PSNR and MSE have reported that these two metrics are not sufficient for image quality assessment. It is advised that another metric called the ‘structural similarity index’ (SSIM) is used in addition to these, to measure the degree of similarity between the original and the transmitted image. Hence, in testing the ability of LoRa to transmit images using the proposed method, we used these three metrics to define the transmission quality. 5. Results In this section, we consider the results of the data transfer of captured mangrove forest images over the LoRa physical layer using different SFs and at different distances. In addition to the quality assessment metrics, we also consider packet loss and the effect of the surrounding environment on transmission. 5.1. Packet Loss in LoRa Transmission Table 3 shows a series of characteristics that define the success of image transmission over the LoRa physical layer. With this set of experiments, the SF was varied from 7 to 12, and communication ranges between 1 and 7 km were tested. In this table, we record the number of hexadecimal packets received, the packet loss ratio, and the time elapsed for data transfer (calculated using additional code in the receiver node) for each SF and distance setting. Table 3. Packet loss measurements. SF Setting

Distance (km)

Received Image

Number of Transmitted Packets

Number of Received Packets

Packet Loss Ratio

Elapsed Time (Average)

7 7 7 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12 12

1 2 3 4 5 6 4 5 6 4 5 6 4 5 6 4 5 6 4 5 6 7

Y Y Y Y N N Y N N Y N N Y N N Y Y N Y Y Y N

314 315 317 312 311 309 312 316 310 318 315 310 309 311 310 313 313 316 317 315 318 319

314 315 317 312 296 0 312 309 0 318 310 0 309 309 237 313 313 293 317 315 318 310

0 P (0%) 0 P (0%) 0 P (0%) 0 P (0%) 15 P (4.82%) 309 P (100%) 0 P (0%) 7 P (2.21%) 310 P (100%) 0 P (0%) 5 P (1.58%) 310 P (100%) 0 P (0%) 2 P (0.64%) 73 P (23.54%) 0 P (0%) 0 P (0%) 23 P (7.27%) 0 P (0%) 0 P (0%) 0 P (0%) 9 P (2.82%)

1 min + 7 s 1 min + 7 s 1 min + 7 s 1 min + 7 s 1 min + 7 s 1 min + 49 s 1 min + 49 s 1 min + 49 s 1 min + 49 s 3 min + 13 s 3 min + 13 s 3 min + 13 s 5 min + 48 s 5 min + 48 s 5 min + 48 s 8 min + 50 s 8 min + 50 s 8 min + 50 s 14 min + 27 s 14 min + 27 s 14 min + 27 s 14 min + 27 s

Sensors 2018, 18, 3257

12 of 22

Sensors 2018, 18, x FOR PEER REVIEW

12 of 22

Remarkably, we observed no packet loss between 1 and 4 km, when SF = 7 (see Table 3 above) Remarkably, we observed no packet loss between 1 and 4 km, when SF = 7 (see Table 3 above) where time elapsed during data transfer was less than 2 min. We also observed that 4.82% of the where time elapsed during data transfer was less than 2 min. We also observed that 4.82% of the packets were lost when the image was transferred over a 5 km range. All packets were lost when packets were lost when the image was transferred over a 5 km range. All packets were lost when transferring at ranges of 6ofkm and nopacket packetloss loss was observed at distances shorter transferring at ranges 6 km andabove. above.Similarly, Similarly, no was observed at distances shorter than than 4 km4 when SF = 8, 9 and 10. The communication range without packet loss increased to km when SF = 8, 9 and 10. The communication range without packet loss increased to 5 km5 km whenwhen SF =SF11= and 6 km 12.With With latter a packet of was 2.82% was observed 11 and 6 kmwhen when SF SF == 12. thethe latter SF, aSF, packet loss ofloss 2.82% observed (see Table 3 above). important notice that that an SFanofSF 7 reduces the time elapsed during transfer, (see Table above).Most Most important notice of 7 reduces the time elapsed during and transfer, SF 12 is preferable for long distance transmission. At the end 12 images out of 21 were received and SF 12 is preferable for long distance transmission. At the end 12 images out of 21 were received successfully (see Table 4) most and most remarkable results and were SF9 were successfully (see Table 4) and remarkable results that that SF7, SF7, SF8, SF8, and SF9 very very close,close, although although the measurements were in different distances and this is clearly shown in Figure the measurements were in different distances and this is clearly shown in Figure 10. 10. Table 4. Summary of the numbers of successfully and unsuccessfully received images.

Table 4. Summary of the numbers of successfully and unsuccessfully received images. Total Y N 21 12 9 Total Y N 21

12

9

100 90

Packet loss ratio (%)

80 70

SF7

60

SF8 SF9

50

SF10 40

SF11

30

SF12

20 10 0 4

5

6

Distance in (km) Figure Correlation between between SF loss ratio. Figure 10.10.Correlation SFand andpacket packet loss ratio.

Visual inspection of the images before and after transfer over the LoRa network (see Table 5)

Visual ofthe thenew images and scheme, after transfer over the network (seewere Table 5) indicateinspection the success of imagebefore encryption although some of LoRa the received images indicate the success new image encryption scheme, although of the receivedthe images affected by noise.ofBythe splitting this ‘high bit rate data’ into packets, wesome are able to overcome LoRa were bandwidth limitation. affected by noise. By splitting this ‘high bit rate data’ into packets, we are able to overcome the LoRa bandwidth limitation.

Sensors x FOR PEER REVIEW Sensors 18, x 18, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors x FOR PEER REVIEW Sensors 18, x 18, FOR PEER REVIEW Sensors 2018, 18, 3257 Sensors x FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 18, x 18, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW

22 of 22 13 of1322of 13 22 of13 13 22 of13 13 of 22 13 22of 22 13 ofof 13 of22 22of 13 13 22 of 22 13 of 22

Table 5. Visual comparison between original and transferred images forsetting each SFused setting used in testing. Table Visual comparison between original and transferred images for each SF setting used in testing. Table 5. Visual comparison between original andand transferred images for each SF setting used in testing. Table 5. Visual comparison between original transferred images for each SF in testing. Table 5.5. comparison between original and transferred images for each setting testing. Table 5. Table Visual between original transferred images for each SFSF setting in in testing. Table 5. Visual comparison between original andand transferred images for each SF setting used inused testing. 5.comparison Visual comparison between original and transferred images for each SFused setting used in testing. Table 5.Visual Visual comparison between original and transferred images for each SF setting used in testing. 5. Visual comparison between original and transferred images forsetting each SFused setting used in testing. Table 5. Table Visual comparison between original transferred images for each SF in testing. 5.comparison Visual comparison between original and transferred images for SFused setting used in testing. Table 5.Table Visual between original andand transferred images for each SF each setting in testing. Original Original Original Original Original

Original Original Original Original Original Original Original Original

Received Received Received Received Received Received Received Received Received Received Received Received Received

Original Original Original Original Original Original Original Original Original Original Original Original Original

Received Received Received Received Received Received Received Received Received Received Received Received Received

==17SF km, = 7SF = 7 D = 1Dkm, SF= =1D 7km, = 1Dkm, SF 1Dkm, SF DD= = 1Dkm, SF= SF =1D 7km, = =177SF km,= SF 7 =7 1== km, ==17SF km, 1Dkm, SF = 1=D km, = 7SF = 7 D = 1Dkm, SF 7=

==27SF km, = 7SF = 7 D = 2Dkm, SF= =2D 7km, = 2Dkm, SF = 2Dkm, SF D = 2Dkm, SF 7km, = =2 7SF km,SF = SF 7 =7 D== =2=2=D D km, = 2Dkm, SF =27SF km, = 7SF==77 D = 2Dkm, SF 72=km,

==37SF km, = 7SF = 7 D = 3Dkm, SF= =3D 7km, 3Dkm, SF 3== km, 3Dkm, SF DD= = 3Dkm, SF= SF =3D 7km, ===377SF km,= SF 7 =7 km, = 3Dkm, SF = 3=D km, = 7SF = 7 D = 3Dkm, SF 7 ==37SF

D km, = 7SF==77 D = 4Dkm, SF 7km, = 4Dkm, SF =47SF D== ==44=D 4==km, = 4Dkm, SF =4 7SF D = 4Dkm, SF 7km, km,SF = SF 7 =7 km, = 4Dkm, SF = 4=D km, = 7SF = 7 D = 4Dkm, SF 7 ==47SF

4= km, = ==488SF km, = 8SF = 8 DD= = 4Dkm, SF= SF =4D 8km, 4Dkm, SF = 4Dkm, SF D = 4Dkm, SF= =4D 8km, = =4 8SF km,= SF 8 =8 km, = 4Dkm, SF = 4=D km, = 8SF = 8 D = 4Dkm, SF 8 ==48SF

D= =4=D 4=km, SF km, = 9SF==99 D = 4Dkm, SF 9km, = 4Dkm, SF =49SF = 4Dkm, SF D = 4Dkm, SF= =4D 9km, = =4 9SF km,= SF 9 =9 km, = 4Dkm, SF = 4=D km, = 9SF = 9 D = 4Dkm, SF 9 ==49SF

Sensors 2018, 18, 3257

14 of 22

Table 5. Cont.

Sensors 2018, Sensors 18, x2018, FOR PEER x FOR REVIEW PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 18, x 18, FOR PEER REVIEW Sensors 18, x 18, FOR PEER REVIEW Sensors x FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW Sensors Sensors 18, x 18, FOR x FOR PEER PEER REVIEW REVIEW Sensors 2018, 18, x2018, FOR PEER REVIEW

Original

Received

22of14 14 of14 22of14 22of 22 22of 22 22of14 14 of14 22of14 14 of1422of14 22 of 22 22of 14

Original

= 4DSF km, SF = =4 10 km,= SF D = 4Dkm, 10 = =4D km, SF 10 = 10 = 4=D km, SF 10 = 10 km,= SF 4Dkm, SF 10 DD= = 4Dkm, SF 10===410 4==km, D = 4Dkm, SF 10==410 = SF 4=D km, SF km, = 10 SF = 10 4Dkm, SF

= 4DSF km, SF = =4 11 km,= SF D = 4Dkm, 11 = =4D km, SF 11 = 11 km, SF = SF 11==11 km,SF 11 = 4Dkm, SF =4 11 D = 4Dkm, SF 11 D== 44===D 4==km, D = 4Dkm, SF 11 D km, SF km, = 11 SF = 11 = 4Dkm, SF =411

4DSF km, SF = =4 12 km,= SF DD= = 4Dkm, 12 = =4D km, SF 12 = 12 4==km, = SF 4=D km, SF 12 = 12 km,= SF 4Dkm, SF 12 D = 4Dkm, SF 12===412 D = 4Dkm, SF 12==412 = 4=D km, SF km, = 12 SF = 12 = 4Dkm, SF

= 5DSF km, D SF =5 11 km,= SF D = 5Dkm, 11 km, SF 11 = 11 D== =5=5=D 5==km, km, SF = SF 11==11 km,SF 11 = 5Dkm, SF =5 11 D = 5Dkm, SF 11 D = 5Dkm, SF 11==511 = 5=D km, SF km, = 11 SF = 11 = 5Dkm, SF

5=km, = 5DSF km, SF = =512 12 km,= SF DD= = 5Dkm, =5D 12 = SF km, SF 12 = 12 = 5=D km, SF 12 = 12 km,= SF = 5Dkm, SF D = 5Dkm, SF 12= =5 12 D = 5Dkm, SF 12==512 = 5=D km, SF km, = 12 SF = 12 = 5Dkm, SF

D= =6=DSF 6=km, SF = 6DSF km, =6 12 km, 12 D = 6Dkm, 12 km, SF = SF 12==12 = 6=D km, SF 12 = 12 km,= SF = 6Dkm, SF D = 6Dkm, SF 12= =6 12 D = 6Dkm, SF 12==612 = 6=D km, SF km, = 12 SF = 12 = 6Dkm, SF

Received

Sensors 2018, 18, 3257

15 of 22

5.2. Quality Assessment of Received Images After reassembling the received images into the JPEG file format, we calculated the values of PSNR, MSE, and SSIM for the different transmission conditions using MATLAB, for image quality assessment. The results of these calculations are summarised in the following table. We observed from Table 6, that the values of MSE and SSIM were 0 and 1, respectively, at communication distances between 0 and 3 km when SF was set to 7. These values indicate that the original and the received images were identical in these transmission conditions. The same values were calculated for images transmitted with SFs of 10, 11, and 12 at a distance of 4 km from the transmission node. The following table (Table 7) summarizes the SF settings where the original and transmitted image are identical. Table 6. Summary of image quality metrics (MSE, PSNR, and SSIM) calculated using MATLAB. SF

Distance (km)

MSE

PSNR (dB)

SSIM

7 7 7 7 8 9 10 11 11 12 12 12

1 2 3 4 4 4 4 4 5 4 5 6

0 0 0 98.7301 9.4572 8.9987 0 0 189.3394 0 62.4792 234.5309

INF INF INF 28.1863 38.3732 38.5890 INF INF 25.3584 INF 30.1734 24.4288

1 1 1 0.9321 0.9953 0.9968 1 1 0.9437 1 0.9625 0.9528

* INF refers to infinity. We obtained this when the value of a divisor was small, such that the result of the subsequent MATLAB calculation was numerically undefined.

Table 7. LoRa physical SF setting which has identical image quality metrics. SF

Distance (km)

MSE

PSNR (dB)

SSIM

7 10 11 12

1 to 3 4 4 4

0 0 0 0

INF INF INF INF

1 1 1 1

5.3. Effects of Fresnel Zone Although the results of this experiment demonstrate that by adopting the proposed encryption scheme image data can be transferred over the LoRa physical layer, they do not indicate the full capabilities of LoRa communication based on the nine trials which ended in failure. We posit that the reason for these failures was the dense growth of coconut trees around the mangrove area, which worked as obstacles preventing signals from traveling between the transmitter and receiver nodes. These trees lie in the so-called ‘Fresnel zone’, defined in point-to-point networks by a cylindrical ellipse drawn between the transmitter and the receiver nodes, as illustrated in Figure 11. It is known that this zone should be at least 60% free of obstructions, such as buildings, mountains, or trees, failing which, signal energy loss is incurred. This, reduce the performance of the wireless link, as was the case with our experiment. Hence, it is important to have a clear ‘line of sight (LOS)’ between the transmitter and the receiver, as much as possible [25]. In our experiments, the transmitter node was fixed on a Skylift at a height of 40 m. The height of the receiver node, which was installed on the back of a four-wheel drive vehicle did not exceed 5 m. On average, coconut trees are approximately 12 m tall. This height can sometimes approach 25 m in isolated incidences [26]. Consequently, these trees fall in

Sensors 2018, 18, 3257

16 of 22

Sensors 2018, 2018, 18, 18, xx FOR FOR PEER PEER REVIEW REVIEW Sensors

16 of of 22 22 16

the first order Fresnel zone, basedzone, on the geometry of the measurement environment, as illustrated in fall in in the the first first order order Fresnel Fresnel zone, based on on the the geometry geometry of of the the measurement measurement environment, environment, as as fall based Figure 12. This has a negative effect on the transmission of the LoRa signals. illustrated in Figure 12. This has a negative effect on the transmission of the LoRa signals. illustrated in Figure 12. This has a negative effect on the transmission of the LoRa signals.

Figure 11. 11. Illustration Illustration of of line-of-sight line-of-sight point-to-point point-to-point wireless wireless communication. communication. Image Image 33 shows shows how how the the Figure

Figure 11. Illustration of line-of-sight point-to-point wireless communication. Image 3 shows how the trees act act as as obstacles obstacles that that can can affect affect signal signal performance. performance. trees trees act as obstacles that can affect signal performance.

Figure 12. Dense Dense growth of Coconuttrees treesaround around the the mangrove forest, which fall fall in the the first orderorder Figure 12. growth Coconut trees around forest, which fall in Figure 12. Dense growth of of Coconut themangrove mangrove forest, which in first the order first Fresnel zone. Fresnel zone. Fresnel zone.

To figure figure out out whether whether or or not not the the trees trees are are acting acting as as an an obstacle obstacle of of signal signal performance performance between between To To whether or notthe theFresnel trees are acting as an obstacle of signal between thefigure senderout and the receiver, receiver, the Fresnel zone radius and diameter can be beperformance calculated using using the the the sender and the zone radius and diameter can calculated the sender and the receiver, the Fresnel zone radius and diameter can be calculated using the following following formulas: formulas: following

formulas:

r = 8.656 8.656×× × r= = 8.656

D F

(5) (5)

(5)

where where where The radius radius of of the the Fresnel Fresnel zone zone rr == The

r = The radius ofdistance the Fresnel zoneRx D == The The distance between Rx and and Tx Tx (km) (km) D between D = The distance between Rx and Tx (km) Frequency used used in in the the transmission transmission process process which which is is 921.9 921.9 MHz MHz FF == Frequency F = Frequency used in the transmission process which is 921.9 MHz Fzone Diameter = r × 2 Fzone Diameter = r × 2

Fzoneusing Diameter =r×2 The Fresnel zone midpoint calculated the following

The Fresnel zone midpoint calculated using the following

(6) (6)

(6)

The Fresnel zone midpoint calculated using the following Fzone midpoint height =

40 + 5 = 22.5 m 2

(7)

Sensors 2018, 18, 3257

17 of 22

where the 40 m and the 5 m are the height of the transmission and the receiver node from the ground Sensors 2018, 18, x FOR PEER REVIEW respectively. 17 of 22 The average height of the mangrove trees (coconut trees) were calculated because it useful to find out how much it can encroach through the Fresnel zone, so in our experiment they calculated this 40 + 5 (7) = 22.5 m using the following equation Fzone midpoint height = 2 where the 40 m and the 5 m are the height of the transmission the receiver node from the ground 25and + 12 Averge Height of Coconut trees = =18.5 m (8) respectively. 2 The average height of the mangrove trees (coconut trees) were calculated because it useful to wherefind theout 12–25 the range coconutthrough trees heights howismuch it canof encroach the Fresnel zone, so in our experiment they calculated For the Fresnel zone for the first kilometre distance between the transmission and this example, using the following equation

receiver nodes can be calculated using the above Equations (5)–(8) as the following Averge Height of Coconut trees = = 18.5 m (8) s where the 12–25 is the range of coconut trees heights 1 × 103 = 9.01 m r = 8.656 × For example, the Fresnel zone for the first kilometre 921.9 × 106 distance between the transmission and receiver nodes can be calculated using the above Equations (5)–(8) as the following

Fzone Diameter = 9.01 × 2 = 18.02 m 1 × 10 8.656 × = 9.01 m = 22.5 − 9.01 = 13.49 m Fresnel zone centre height = = Fzone midpoint height − Fzone Radius 921.9 × 10 Subtracting this value from the average height of coconut trees roughly gives us the distance of Fzone Diameter = 9.01 × 2 = 18.02 m the coconut trees which crossed the Fresnel zone. Fresnel zone centre height = Fzone midpoint height − Fzone Radius = 22.5 − 9.01 = 13.49 m

18.5 −height 13.49 of = 5.01 m trees roughly gives us the distance of Subtracting this value from the average coconut the coconut trees which crossed the Fresnel zone. After this, it is easy to find out how much the Fresnel zone clearance is using the 18.5 − 13.49 = 5.01 m following calculations After this, it is easy to find out how much the Fresnel zone clearance is using the following 5.01 calculations

× 100 = 27.8% 18.02 . × 100 = 27.8% . Percentage of the Fresnel zone that is free = 100 − 27.8% = 72.2% Percentage of the zone that is non-free = Percentage of the zone that is non-free =

Percentage of the Fresnel zone that is free = 100 − 27.8% = 72.2%

Thus,Thus, at the distance (1 (1 km) andthe the receiver, Fresnel at first the first distance km)between betweenthe the transmitter transmitter and receiver, thethe Fresnel zonezone was was more more than than 60% 60% clearclear of obstruction. This treeswill willnot not affect clear of sight of obstruction. Thismeans meansthe the coconut coconut trees affect thethe clear line line of sight between the transmitter andand thethe receiver between the transmitter receiver(see (seeFigure Figure 13). 13).

Figure 13. The calculation of the Fresnel zone between the transmitter and the receiver at the first

Figure 13. The calculation of the Fresnel zone between the transmitter and the receiver at the first distance (1 km). distance (1 km).

After applying the same calculations for the rest of the distances, the following results were foundapplying (see Tablethe 8): same calculations for the rest of the distances, the following results were found After (see Table 8):

Sensors 2018, 18, 3257

18 of 22

Table 8. Fresnel zone calculations for the measured distances. Distance (km)

Fresnel Zone Radius (m)

Fresnel Zone Diameter (r × 2)

Percentage of Clear Fresnel Zone

1 2 3 4 5 6

9.01 12.75 15.61 18.03 20.16 22.08

18.02 25.50 31.22 36.06 40.32 44.16

72.2% 65.69% 62.82% 61.4% 59.3% 59.06%

It is obvious from these results (Table 8) that the clear Fresnel zone is less than 60% from the 5th km and above, where the wireless link performance will definitely be affected [27]. Therefore, the coconut trees at the place of measurement and were an obstruction in this scenario and prevent the clear line-of-site status between the transmitter and the receiver nodes. This is the reason for packet loss in the experiment. 6. Conclusions Using LoRa as the main infrastructure for mangrove monitoring offers longer range connections, reduced costs (as the technology is free to use and the longer range of communication reduces the number of gateways required), and low power consumption, in line with the environmental goals of the mangrove monitoring project. In this paper, we demonstrated the concept of point-to-point data transfer by transmitting images over the LoRa physical layer. This transfer was achieved despite the limited bandwidth of LoRa, using a novel image encryption technique. Our demonstration highlights LoRa as an ideal technology for implementing a WSN for monitoring mangrove forests, which will aid authorities, researchers, and farmers in their efforts to restore dwindling mangrove plantations. Author Contributions: Data Curation, A.H.J.; Formal Analysis, A.H.J.; Investigation, A.H.J.; Methodology, A.H.J.; Resources, A.H.J.; Software, A.H.J.; Visualization, A.H.J.; Writing–Original Draft, A.H.J.; Conceptualization, A.S.; Funding Acquisition, A.S.; Project Administration, A.S.; Supervision, A.S., A.I., M.F.A.R.; Validation, A.S., A.I., M.F.A.R.; Writing–Review & Editing, A.S., A.I., M.F.A.R. Funding: This research was funded by UPM Putra Grant, grant number IPS/2017/9557100. Acknowledgments: The authors would like to thank the technical support team comprised of Mohamad Zulkhairi Zakaria, Azizi Bin Mohd Ali, and Fathullah Hakim Md Marham, who gave a significant help in establishing the project for conducting measurements in the target area. Conflicts of Interest: The authors declare no conflict of interest.

Sensors 2018, 18, 3257 Sensors 2018, 18, x FOR PEER REVIEW Sensors 2018, 18, x FOR PEER REVIEW

Appendix A Appendix A A Appendix

Figure A1. The “MAC pause” command used to stop data encryption over over the the MAC MAC Layer. Figure A1. A1. The The “MAC “MAC pause” pause” command command used used to to stop stop data data encryption encryption Figure over the MAC Layer. Layer.

Figure A2. Arduino code for converting the captured image into hexadecimal packets. Figure image into into hexadecimal hexadecimal packets. packets. Figure A2. A2. Arduino Arduino code code for for converting converting the the captured captured image

19 of 22

19 of 22 19 of 22

Sensors Sensors 2018, 2018, 18, 18, 3257 x FOR PEER REVIEW Sensors 2018, 18, x FOR PEER REVIEW

Figure A3. LoRa LoRa command command for for transmission of of the hexadecimal hexadecimal packets. Figure Figure A3. A3. LoRa command for transmission transmission of the the hexadecimal packets. packets.

Figure A4. LoRa command preparing the receiver node to listen for incoming data. Figure A4. LoRa the receiver receiver node node to to listen listen for for incoming incoming data. data. Figure A4. LoRa command command preparing preparing the

20 of 22 20 of 22 20 of 22

Sensors 2018, 18, 3257 x FOR PEER REVIEW Sensors

21 of 22 21 of 22

Figure A5. A5. The The MATLAB MATLAB controls controls for for initiating initiating the the image image capture capture process process and and reassembling reassembling image image Figure files from transmitted hexadecimal packets. files from transmitted hexadecimal packets.

References References 1. 1. 2. 2. 3. 3. 4. 4.

5.

5. 6.

6. 7. 7. 8.

8. 9.

9. 10. 10. 11. 11. 12.

Nasri, M.; Helali, A.; Sghaier, H.; Maaref, H. Adaptive image transfer for wireless sensor networks (WSNs). Nasri, M.; Helali,ofA.; Sghaier, H.; Maaref, H. Adaptive on image transfer for wirelessof sensor networks (WSNs). In Proceedings the 5th International Conference Design & Technology Integrated Systems in In Proceedings of the 5th International Conference on Design & Technology of Integrated Systems in Nanoscale Era, Hammamet, Tunisia, 23–25 March 2010; pp. 1–7. Nanoscale Hammamet, Tunisia, March 2010; pp. 1–7.of the Reliability of LoRa Long-Range LowCattani, M.;Era, Boano, C.; Römer, K. An 23–25 Experimental Evaluation Cattani, M.; Boano, C.; Römer, K. An Experimental Evaluation of the Reliability of LoRa Long-Range Power Wireless Communication. J. Sens. Actuator Netw. 2017, 6, 7. Low-Power Wireless Communication. J. Sens. Actuator Netw. 2017, 6, 7. [CrossRef] United Nations Climate Change. Connected Mangroves | Malaysia. Available online United Nations Climate Change. Connected Mangroves | Malaysia. Available online: https://unfccc.int/ https://unfccc.int/climate-action/momentum-for-change/ict-solutions/connected-mangroves (accessed on 2 climate-action/momentum-for-change/ict-solutions/connected-mangroves (accessed on 2 August 2018). August 2018). Petajajarvi, J.; Mikhaylov, K.; Roivainen, A.; Hanninen, T.; Pettissalo, M. On the coverage of LPWANs: range Petajajarvi, J.; Mikhaylov, K.; Roivainen, A.; Hanninen, T.; Pettissalo, M. On the coverage of LPWANs: evaluation and channel attenuation model for LoRa technology. In Proceedings of the 14th International range evaluation and channel attenuation model for LoRa technology. In Proceedings of the 14th Conference on ITS Telecommunications (ITST), Copenhagen, Denmark, 2–4 December 2015; pp. 55–59. International Conference on ITS Telecommunications (ITST), Copenhagen, Denmark, 2–4 December 2015; Pham, C. Low-cost, low-power and long-range image sensor for visual surveillance. In Proceedings of the pp. 55–59. 2nd Workshop on Experiences in the Design and Implementation of Smart Objects, New York, NY, USA, Pham, C. Low-cost, low-power and long-range image sensor for visual surveillance. In Proceedings of the 3–7 October 2016; pp. 35–40. 2nd Workshop on Experiences in the Design and Implementation of Smart Objects, New York, NY, USA, Fan, C.; Ding, Q. A novel wireless visual sensor network protocol based on LoRa modulation. Int. J. Distrib. 3–7 October 2016; pp. 35–40. Sens. Netw. 2018, 14. [CrossRef] Fan, C.; Ding, Q. A novel wireless visual sensor network protocol based on LoRa modulation. Int. J. Distrib. Kirichek, R.; Pham, V.-D.; Kolechkin, A.; Al-Bahri, M.; Paramonov, A. Transfer of Multimedia Data via Sens. Netw. 2018, 14, doi:10.1177/1550147718765980. LoRa. In Internet of Things, Smart Spaces and Next Generation Networks and Systems; Galinina, O., Andreev, S., Kirichek, R.; Pham, V.-D.; Kolechkin, A.; Al-Bahri, M.; Paramonov, A. Transfer of Multimedia Data via Balandin, S., Koucheryavy, Y., Eds.; Springer: Cham, Switzerland, 2017; Volume 10531, pp. 708–720. LoRa. In Internet of Things, Smart Spaces and Next Generation Networks and Systems; Galinina, O., Andreev, Yim, D.; Chung, J.; Cho, Y.; Song, H.; Jin, D.; Kim, S.; Ko, S.; Smith, A.; Riegsecker, A. An experimental LoRa S., Balandin, S., Koucheryavy, Y., Eds.; Springer: Cham, Switzerland, 2017; Volume 10531, pp. 708–720. performance evaluation in tree farm. In Proceedings of the 2018 IEEE Sensors Applications Symposium Yim, D.; Chung, J.; Cho, Y.; Song, H.; Jin, D.; Kim, S.; Ko, S.; Smith, A.; Riegsecker, A. An experimental (SAS), Seoul, Korea, 12–14 March 2018; pp. 1–6. LoRa performance evaluation in tree farm. In Proceedings of the 2018 IEEE Sensors Applications Sanchez-Iborra, R.; Cano, M.-D. State of the Art in LP-WAN Solutions for Industrial IoT Services. Sensors Symposium (SAS), Seoul, Korea, 12–14 March 2018; pp. 1–6. 2016, 16, 708. [CrossRef] [PubMed] Sanchez-Iborra, R.; Cano, M.-D. State of the Art in LP-WAN Solutions for Industrial IoT Services. Sensors Semtech. LoRa FAQs. Available online: https://docplayer.net/9473940-Lora-faqs-www-semtech-com-1-of2016, 16, 708. 4-semtech-semtech-corporation-lora-faq.html (accessed on 2 August 2018). Semtech. LoRa FAQs. Available online: https://docplayer.net/9473940-Lora-faqs-www-semtech-com-1-ofBerni, A.; Gregg, W. On the Utility of Chirp Modulation for Digital Signaling. IEEE Trans. Commun. 1973, 21, 4-semtech-semtech-corporation-lora-faq.html (accessed on 2 August 2018). 748–751. [CrossRef] Berni, A.; Gregg, W. On the Utility of Chirp Modulation for Digital Signaling. IEEE Trans. Commun. 1973, Augustin, A.; Yi, J.; Clausen, T.; Townsley, W. A Study of LoRa: Long Range & Low Power Networks for the 21, 748–751. Internet of Things. Sensors 2016, 16, 1466. [CrossRef]

Sensors 2018, 18, 3257

13. 14. 15.

16.

17. 18.

19.

20.

21.

22.

23. 24. 25. 26.

27.

22 of 22

Atanasovski, V.; Leon-Garcia, A. Future Access Enablers for Ubiquitous and Intelligent Infrastructures; Springer: Cham, Switzerland, 2015. Elkhodr, M.; Shahrestani, S.; Cheung, H. Emerging Wireless Technologies in the Internet of Things: A Comparative Study. Int. J. Wirel. Mob. Netw. 2016, 8, 67–82. [CrossRef] Bor, M.; Roedig, U. LoRa Transmission Parameter Selection. In Proceedings of the 13th International Conference on Distributed Computing in Sensor Systems (DCOSS), Ottawa, ON, Canada, 5–7 June 2017; pp. 27–34. Ochoa, M.N.; Guizar, A.; Maman, M.; Duda, A. Evaluating LoRa energy efficiency for adaptive networks: From star to mesh topologies. In Proceedings of the IEEE 13th International Conference on Wireless and Mobile Computing, Networking and Communications (WiMob), Rome, Italy, 9–11 October 2017. Sinha, R.S.; Wei, Y.; Hwang, S.-H. A survey on LPWA technology: LoRa and NB-IoT. ICT Express 2017, 3, 14–21. [CrossRef] Knyazev, N.S.; Chechetkin, V.A.; Letavin, D.A. Comparative analysis of standards for Low-power Wide-area Network. In Proceedings of the 2017 Systems of Signal Synchronization, Generating and Processing in Telecommunications (SINKHROINFO), Kazan, Russia, 3–4 July 2017; pp. 1–4. IEEE Computer Society; LAN/MAN Standards Committee; Institute of Electrical and Electronics Engineers; IEEE-SA Standards Board. IEEE Standard for Local and Metropolitan Area Networks. Part 15.4, Amendment 3, Part 15.4, Amendment 3; Institute of Electrical and Electronics Engineers: New York, NY, USA, 2012. Orfanidis, C.; Feeney, L.M.; Jacobsson, M.; Gunningberg, P. Investigating interference between LoRa and IEEE 802.15.4g networks. In Proceedings of the IEEE 13th International Conference on Wireless and Mobile Computing, Networking and Communications (WiMob), Rome, Italy, 9–11 October 2017. Vejlgaard, B.; Lauridsen, M.; Nguyen, H.; Kovacs, I.Z.; Mogensen, P.; Sorensen, M. Interference Impact on Coverage and Capacity for Low Power Wide Area IoT Networks. In Proceedings of the 2017 IEEE Wireless Communications and Networking Conference (WCNC), San Francisco, CA, USA, 19–22 March 2017. Pham, C. Building Low-Cost Gateways and Devices for Open LoRa IoT Test-Beds. In Proceedings of the International Conference on Testbeds and Research Infrastructures, Hangzhou, China, 14–15 June 2016; pp. 70–80. Parrish, K. Arduino vs. Raspberry Pi. Available online: https://www.digitaltrends.com/computing/ arduino-vs-raspberry-pi/ (accessed on 2 August 2018). Al-Najjar, Y.A.Y.; Soong, D.C. Comparison of Image Quality Assessment: PSNR, HVS, SSIM, UIQI. Int. J. Sci. Eng. Res. 2012, 3, 8. Sherwin, T.; Easte, M.; Chen, A.; Wang, K.; Dai, W. A Single RF Emitter-Based Indoor Navigation Method for Autonomous Service Robots. Sensors 2018, 18, 585. [CrossRef] [PubMed] Lima, E.B.C.; Sousa, C.N.S.; Meneses, L.N.; Ximenes, N.C.; Júnior, S.; Vasconcelos, G.S.; Lima, N.B.C.; Patrocínio, M.C.A.; Macedo, D.; Vasconcelos, S.M.M. Cocos nucifera (L.) (Arecaceae): A phytochemical and pharmacological review. Braz. J. Med. Biol. Res. 2015, 48, 953–964. [CrossRef] [PubMed] Coleman, D.D.; Westcott, D.A. CWNA Certified Wireless Network Administrator Official Study Guide Exam PW0-104; John Wiley & Sons: New York, NY, USA, 2009. © 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).