# NOVA Mobility Assistive System: Developed and Remotely Controlled with IOPT-Tools
## 5 Prototypes
### Implementation  
The NOVA-WiFi-Client (NWC) prototype was implemented on an ESP8266-01 with a GPS module (MT3329) connected via serial port, as presented in Figure 12 circuit. The USB to TTL converter module and the push buttons are required to program the ESP module. Arduino IDE (Integrated Development Environment) was used to program the board, using the \"Generic ESP8266 Module\" add-on [73] for Arduino IDE. The implementation code was written in C/C++. The NWC prototype, which is a service consumer, has the following operating cycle: (1) obtains the GPS coordinates; (2) searches for NOVA-WiFi-Beacon (NWB) networks; (3) connects to the one with the strongest signal; (4) sends vehicular own data (type, position, velocity, direction,...) through an HTTP POST in JSON format; (5) receives POST reply with NWBs data; and, (6) presents received data to the vehicle user. The NWC does not connect twice to the same NWB, in a short period of time. Figure 11: IOPT debugger tool connection interface. Figure 10: IOPT-Tools main interface. NWB prototypes were created while using three different computing platforms. The first platform was an ESP8266-01, the second platform was a RPi2, and the last platform was a RPi3. The prototypes implemented in the first two platforms were only used to validate the interaction between NWCs and NWBs, whereas the prototypes that were implemented in the third platform were used to validate the proposed architecture and development approach. Given that the RPi2 does not have built-in Wi-Fi, like RPi3, in the second platform, an USB Wi-Fi adapter (SMC Networks EZ Connect N 150 Mbps Wireless USB2.0 Adapter (SMCWUSBS-N3)) was used. Any of the prototypes provide Wi-Fi networks with a specific prefix name and have the following operating cycle: (1) receive connection; (2) wait HTTP POST and store the received data; (3) reply (in JSON format) with their own and also neighbors data (stored in its database); and, (4) disconnect. The described operation cycles was named in this work as complete mode. However, a simple mode was considered to ensure that NWCs can obtain NWBs information, even when they cannot exchange messages. In the simple mode, the Wi-Fi network names contain NWBs information (their GPS location, direction, and specific data), for instance, to indicate a potential hazard. A set of NWBs prototypes were implemented in several RPi3. In each RPi3, the built-in Wi-Fi interface supports the interaction with NWCs, and an USB Wi-Fi adapter supports the interaction with other NWBs. The following USB Wi-Fi adapters were used: (1) SMC Networks EZ Connect N 150 Mbps Wireless USB2.0--this adapter supports Wi-Fi b/g/n and WPA and WPA2 encryption standards; (2) XAVi XW501B 54 Mbps USB2.0--an adapter that supports Wi-Fi b/g and WPA encryption standards; and, (3) Belkin Wireless G USB Adapter--another adapter that supports Wi-Fi b/g. The built-in Wi-Fi interface of RPi3 was configured as an access point using hostapd to configure the broadcast network--SSID, channel, Wi-Fi mode, network keyword, and so on, and the isc-dhcp-server. This is responsible for configuring the Dynamic Host Configuration Protocol (DHCP) server that is in charge of configuring the network to the endpoints--assigning IP addresses to clients, defining network masks, Domain Name System (DNS) servers. The USB Wi-Fi adapter, used to communicate with other NWBs, was configured as a mesh network, while using the B.A.T.M.A.N. (Better Approach to Mobile Ad-hoc Networking) advanced module [74] that implements the B.A.T.M.A.N. routing protocol. With this protocol, each node only has information about the best next-hop, so that the data reaches the remaining nodes. The communication modules were developed using IOPT-Tools and Python, while using standard libraries [75], such as socket, threading, json, select, and xml.etree. The control part of the  
Figure 12: NOVA-WiFi-Client (NWC) prototype circuit. communication modules was modeled through IOPT-nets, which were validated and automatically translated into C code using the IOPT-Tools.