2014 International Conference on Intelligent Agriculture IPCBEE vol.63 (2014 ) (2014 ) IACSIT Press, Singapore DOI: 10.7763/IPCBEE. 2014. V63. 13 An Emergency Communication System for an Agricultural Autonomous Vehicle Ka C. Chan 1, 2, Jayantha Katupitiya 2, Joshua W. Hanrahan 1, Corey J. Jackson 1, and Dylan Rose 1 1 Department of Computer Science & Computer Engineering, La Trobe University, Bendigo, VIC 3550, Australia 2 School of Mechanical and Manufacturing Engineering, The University of New South Wales, Sydney, NSW 2052, Australia Abstract. This paper describes the design and implementation of a communication system which concurrently sends out an SMS message and makes a video or voice over IP (VoIP) call to one or more operators when the agricultural autonomous vehicle (SmartSeeder) falls into an emergency situation while in service. The emergency communication system consists of two sub-systems: an Android mobile phone for SMS messaging and a Raspberry pi Linux computer for VoIP. The Google Maps Application Programming Interface (API) is used to note the GPS location where the vehicle got into trouble, and then convert that GPS location into a web link which would be sent through with the SMS message. An Asterisk VoIP server is used to initiate and make VoIP/Video calls through the wireless network on the vehicle, or through the Android phone using tethering when the on-vehicle wireless network fails. The VoIP system provides useful real-time voice and video information about the environment to the operator so appropriate decisions can be made. Both the SMS Android app and the VoIP system continuously run in the background and wait for emergency signals to arrive from the vehicle s main control system. Keywords: SMS, VoIP, Autonomous Vehicles, Agriculture, Android. 1. Introduction The Agricultural Robotics research carried out at UNSW Australia has led to the development of the socalled SmartSeeder (Fig. 1), a system that can precisely place seeds in broad acre cropping at predetermined rows with an accuracy of within ±2 cm. The system requires the input of a crop layout pattern in the form of a path to follow, represented as a data set containing GPS coordinates (Fig. 2). A suite of sophisticated nonlinear control algorithms have been implemented [1, 2] to ensure precise navigation at speeds up to 10 km/hour. Achieving precision seed placement is the first step towards precision autonomous farming [3]. The aim is to use the same technology and equipment for all stages of agricultural operations from seeding, fertilizing, and weeding right to harvesting. The precision delivered by this system completely eliminate the need for crop sensing and localization for operations such as fertilizing and weeding, thereby substantially reducing the cost of sensing. The precision requirement of these vehicles is so high that it is virtually impossible for a human operator to drive. As such these machines are essentially autonomous and therefore require an efficient and effective means of monitoring their operational conditions while they are kilometres away operating on their own. Fig. 3 shows the mechanical features of the system. It consists of a pilot vehicle which is generally small and has no ability to provide sufficient propulsion; however, it has the ability to guide and command the seeder attached to it. The seeder itself is propelled and has its own power unit to activate its own controls however as commanded by the pilot vehicle. As such the pilot vehicle does not carry the seeder s load. 76
Fig. 1: The UNSW Smart Seeder and Sensors. Fig. 2: GPS Coordinated Path. Fig. 3: The small pilot vehicle (green) and the self-propelled seeder. Therefore, a small pilot vehicle can guide a very large seeder. The core novelty is this feature in that the large tractors are replaced by a small pilot vehicle and all the propulsion forces are provided by the seeder itself. The broader novelty is that the seeder shown is to be replaced by a general implement that has the ability to carry tools to suit the agricultural task thereby minimizing the number of large implements maintained by a particular farming scenario. This way all tools carried by an implement at different stages of farming can ensure the same accuracy right throughout and thereby making substantial savings in operational costs and the amount of substances used. The need to maintain contacts with the machine as it is operating kilometres away cannot be overemphasized. Diagnostics data needs to be transmitted to an operator so that action can be taken to ensure continued operation of the agricultural implement. We have investigated and experimented with different types of wireless technologies for various purposes. This paper aims to present the design of a communication system using 3G mobile and wifi for sending out emergency alerts. The emergency communication system consists of two sub-systems for redundancy and reliability, and providing different types of information to the operator. The first one is an Android app responsible for sending out SMS distress messages through an Android mobile phone. The second is a Linux based system responsible for initiating VoIP calls through a Raspberry Pi [4], which is a low cost, credit card sized single board computer. Because of their small sizes, light weights, and low power requirements, these systems were chosen to fit in the limited space available on the SmartSeeder. An SMS system is useful as long as there is 3G mobile network coverage. However, SMS is delivered in a store-and-forward way; therefore, they do not 77
always arrive immediately [5]. The VoIP system provides an alternative path to send out emergency alert but it depends on the availability of Internet connectivity. By using the Google Maps Application Programming Interface (API), the Android system also sends out the current GPS location of the SmartSeeder. On the other hand, the VoIP system provides additional voice and video information of the environment, which can be very useful to the operator in making decisions. The SMS and VoIP systems also serve as backup to each other in sending out emergency alerts. In this paper, we will first present the overall system architecture in Section 2, then the Android sub-system in Section 3, and the VoIP sub-system in Section 4, followed by discussions and conclusions in Section 5. 2. System Architecture The emergency communication system was designed as a standalone system consisting of two subsystems, separated from the main controller for reliability reasons. The emergency communication system and the main controller are communicated through the on-vehicle LAN. The main controller is an on-board computer driven by a real-time operating system. Software applications were developed for monitoring and controlling the various sub-systems of the vehicle in real-time, including the safety, steering, and traction (propulsion) sub-systems. The main controller decides under what circumstances and when to send out emergency signals to the two emergency sub-systems which continuously run at the background waiting for signals to arrive, and taking actions accordingly. Fig. 4 shows the system architecture of the emergency communication system which consists of three main hardware components: an Android phone and a Raspberry pi mounted on the SmartSeeder, and an Asterisk VoIP server hosted in an external data center. Asterisk is an open source VoIP software [6] which is highly customisable and enables developers to build innovative communication solutions [7, 8]. All VoIP clients or softphones are required to register to the Asterisk server before they can call each other. One Asterisk server can support multiple SmartSeeders working in one or more farms. The open source SIP VoIP client, LinPhone [9], was installed on the on-vehicle Android phone, and the operator s desktop computer or mobile device. LinPhone registers to the Asterisk server and enables users to make VoIP calls using their PCs or mobile devices. Fig. 4: System architecture of the emergency communication system. 78
To enable data communications among various systems on the SmartSeeder and to the Internet, the following networks are setup and configured: Main controller: 3G Internet connection and FastEthernet connection to the on-vehicle wired LAN. Android phone: 3G Internet connection, and configured as wifi hotspot to provide backup Internet conection to the Raspberry Pi. The Android phone can also access Internet via the on-vehicle wireless access point. Raspberry Pi: FastEthernet connection to the on-vehicle wired LAN. As backup, an USB wifi dongle enables wireless connection to the Android phone with tethering if the on-vehicle access point fails or goes out of range from the main wireless access point at the farm house. The reliable operations of these data networks are necessary for the emergency communication systems to function properly. 3. Android App for SMS Messaging An Android app Seeder SMS was developed to run in the background waiting for the emergency signal to arrive from the main controller in the SmartSeeder, and to send out an SMS distress message with GPS location information to an operator via the mobile phone in case of an emergency. The system architecture of the Android system is shown in the middle part of Fig. 5. The Android app Seeder SMS was developed on a laptop running a 64-bit Ubuntu Linux version 13.04. The software framework and environment includes the Eclipse IDE, Android SDK, Android Developer Tools (ADT), Support Library, and Android Virtual Devices (AVD) [10]. The API level and platform support all the way back to Android 4.0 Ice Cream Sandwich and up. The arrows in Fig. 5 indicate the process flow of the Android sub-system. The File Transfer Protocol (FTP) was used as the mechanism to pass triggers from the main controller to the Android phone in case of an emergency. The free app MyFTP Server was downloaded from the Google Play Store and installed on the phone. In case of an emergency, the main controller creates a file in the Android phone s seedersms/data directory through the FTP client to trigger the observer service. Immediately the Android phone grabs the current location using the inbuilt GPS service, and sends the SMS alert message containing the GPS coordinates to a pre-set mobile number. A few screen shots of the Seeder SMS app are shown in Fig. 6 below. Although the main purpose of the Android phone is to send out SMS alerts via the 3G connectivity in emergency, it is also configured as a portable Wifi Hotspot as a backup to provide Internet connectivity to the Raspberry Pi as discussed in the next section. Fig. 5: Process flow of the Android sub-system. 79
Fig. 6: Screenshots of the Android app Seeder SMS. 4. VoIP System The Asterisk server, located in an external data center, was installed and setup using the FreePBX distribution [11], which is an open source package combining a web based graphical user interface (GUI) with Asterisk. With FreePBX, it is very easy to control and manage the Asterisk server, and the settings of extensions. The same server can be used to control and manage a number of SIP clients configured on multiple SmartSeeders. The arrows in Fig. 7 indicate the process flow of the Asterisk sub-system. The Asterisk server is shown on the right hand side, the Raspberry Pi SIP client in the middle, and the main controller on the left hand side. Unlike the Android system, the Asterisk system uses HTTP as triggers in case of an emergency. The Raspberry Pi employs a simple Python HTTP web server to wait for requests coming from the main controller. When an emergency signal is received, the Raspberry Pi runs a web service to inform the Asterisk server to immediately create a call file in the its /var/spool/asterisk/outgoing directory. A call file is a simple text file containing some instructions for the Asterisk server to initiate phone calls at the time equal to the time stamp of the call file. When the call file is executed, the Asterisk server first calls the extension of the LinPhone on the vehicle, which automatically answers, then makes a call to the operator s extension. Once the operator answers the VoIP call, either a video or voice call will be established depending on the network environment and the device that the operator uses. The Raspberry Pi system then streams real-time video or voice from the SmartSeeder to the operator. It should be noted that it is possible for the Asterisk server to bridge the VoIP call from the Raspberry Pi to a PSTN or mobile phone number rather than to a softphone. The Asterisk server also allows us to ring a number of parties in sequence (call hunt) or simultaneously (ring all). As the SmartSeeder works in large and sometimes remote farmlands, Internet connectivity and wireless coverage is a challenge. Therefore, it is important to choose the appropriate VoIP codecs depending on the available bandwidth. Voice codecs such as GSM, ilbc, G.723 and G.729 require much lower bandwidth compared to the uncompressed G.711 codec. Under a good network condition with low delay and sufficient bandwidth, G.711 can offer high fidelity voice quality. However, for environment where network is slow and bandwidth is limited, G.711 may perform very poorly. Compared to G.711 s bandwidth requirement of 64 kbps bit-rate, G.723 requires 5.3 kbps, G.729 requires 8 kbps, and GSM requires 13 kbps. Due to their low bandwidth requirements, they are more suitable for large farmlands where 3G or wifi signals can be weak 80
and unstable at times. In our experiments, video support was enabled in the Asterisk server, and the codec priority for codec negotiations was set to (1) H.263 (video), (2) GSM, and (3) ilbc. When there is sufficient bandwidth, a video connection will be established. When that fails, a voice call will be established. The voice codecs GSM and ilbc were chosen because of their low bit-rate and are available without license fees. For the VoIP system, under normal network condition, the Raspberry Pi receives emergency signals from the main controller and sends out HTTP requests via the on-vehicle wired LAN connections to initiate VoIP calls. When the vehicle is out of range of the outdoor wifi coverage or the wifi connection fails, the Raspberry Pi can still receive signals from the main controller via the wired LAN, but will instead send out HTTP requests via the Android mobile phone which acts as a wifi hotspot. As an alternative approach to trigger an alert, the main controller can use a FTP client to create the call file directly in the Asterisk server s spool directory directly. However, this approach was not taken. As the Raspberry Pi has multiple routes to the Internet, it is preferable to send the emergency alerts passing through the Raspberry Pi in order to take advantage of the redundant Internet connections. 5. Discussions and Conclusions We have presented the design and implementation of an emergency communication system for the UNSW SmartSeeder. The need to maintain reliable communications with the machine as it is operating autonomously kilometres away cannot be overemphasized. Although the SmartSeeder is a highly reliable unmanned vehicle, in unlikely emergencies that require immediate responses from the remote operator, the on-vehicle main controller will trigger the emergency communication system to send out alerts to the operator via SMS messages and VoIP calls. The emergency communication system consists of an Android sub-system that sends out SMS alerts containing the GPS locations of the vehicle; and an Asterisk VoIP system that streams voice and/or video to the operator s PC or mobile device. The Android phone also acts as a backup wifi hotspot for the VoIP client in case the wifi connection between the vehicle and the farm house fails. The main challenge has been in providing reliable wireless connection to the vehicle due to the large farm areas. Our next phase of research is to investigate into the latest long range outdoor wifi and antenna technologies which claim to have kilometres of coverage; and to experiment with VoIP over the low bandwidth long distance wireless protocols such as ZigBee [12]. We are also investigating the use of 6LoWPAN to setup a long range IPv6 network in support of the SmartSeeder communications [13]. Fig. 7: Process flow of the Asterisk sub-system. 81
6. References [1] J. Taghia and J. Katupitiya. A Sliding Mode Controller with Disturbance Observer for a Farm Vehicle Operating in the Presence of Wheel Slips. In: Proc. of the IEEE/ASME International Conference on Advanced Intelligent Mechatronics. IEEE. July 2013, pp. 1534-1539. [2] J. Taghia and J. Katupitiya. Wheel Slip Identification and its Use in the Robust Control of Articulated Off-Road Vehicles. In: Proc. of Australasian Conference on Robotics and Automation. University of New South Wales, Sydney, Australia. 2-4 Dec 2013. [3] J. Katupitiya, R. Eaton and T. Yaqub. Systems Engineering Approach to Agricultural Automation: New Developments. In Proc. of the 1st Annual IEEE Systems Conference. Honolulu, Hawaii, USA. April 2007. [4] Raspberry Pi. http://www.raspberrypi.org/, (last accessed 15-Dec-2013). [5] J. Brown, B. Shipman, and R. Vetter, R. SMS: The short message service. Computer, 2007, 40(12): 106-110. [6] Asterisk. http://www.asterisk.org/, (last accessed 15-Dec-2013). [7] K. C. Chan. A wholesale web callback service. In: Proc. of the 8 th Int. Conference on Information Technology and Applications (ICITA 2013), IEEE, Sydney, Australia, 1-4 July, 2013, pp. 21-26. [8] K. C. Chan and D. Tien. A Multi-Tenant Platform for SMS Integrated Services. International Journal of Computer Networks and Communications, 2013, 5(6): 205-214. [9] Linphone, Free SIP VoIP Client. http://www.linphone.org/, (last accessed 15-Dec-2013). [10] Google. http://developer.android.com, (last accessed 15-Dec-2013). [11] FreePBX let freedom ring. http://www.freepbx.org/, (last accessed 15-Dec-2013). [12] C. Wang, K. Sohraby, R. Jana, L. Ji, and M. Daneshmand. Voice Communications over ZigBee Networks. IEEE Communications Magazine, Jan 2008, 46(1): 121-127. [13] Z. Shelby and C. Bormann. 6LoWPAN: The Wireless Embedded Internet. John Wiley & Sons, 2009. 82