Viewing 0 reply threads
  • Author
    Posts
    • #11348
      Michel Castaño
      Keymaster

      CREATING A VIRTUAL COPILOT WITH SYRUS 4

      Introduction

      The main purpose of this document is to create an instance of SyrusJS in Syrus 4G to work as a Virtual Copilot

      Documentation inted for developers only!

      Syrus 4G IoT Telematics Gateway. 

       

      Requirements:

      HARDWARE:

      – Syrus4
      – Speaker Bluetooth Bluetooth Profiles: Headset Profile (HSP)
      – iButton

      MINIMUM VERSIONS:

      – Apex OS   Version  apex-21.02.0
      – µChip        Version 1.0.11T
      – SyrusJS   Version 1.28.1

       

      STEP ONE: SETTING UP HARDWARE

      1. Connect iButton reader to white/red wire and brown wire in 14 PIN molex

       

       

      2. Preparing your System
      Go to Management Tool (http://192.168.9.2 if you’re over USB cable), select System and confirm that you’re up to date


      3. Now go to Applications Manager and Check for updates and make sure you have the latest version of SyrusJS application installed:

      4. Create an instance
      In application manager pull down the menu of SyrusJS, this will show you all versions installed of the application, select the latest one and Create a New Instance:..

      5. Name your instance and select Create  Instance button:

      Now you have your instance created:

      6. Connect and pair HSP Bluetooth speaker via Syrus 4G User Interface (make sure Bluetooth speaker is on):


      Click on the discovered BT device and then click “Connect”

      Pair and connect

      A “Play” (▶) sign must appear as shown in image above. Otherwise Audio is not being routed. (Possible causes: There is another Bluetooth speaker paired: disconnect it, unpair it and try again).

      Click the Play button. A default message must be heard through the Speaker.

      7. Optional: Preconfigure Accelerometer: If you want to integrate Driver Behavior with Virtual Copilot you will need to calibrate accelerometer. On the UI click on Accelerometer and then in acceleration test. At the end of this configuration you must go over 30kmh for a while to finish Acceleration alignment

       

      STEP 2: CREATING  SYRUS 4G CONFIGURATION FILES

      The following Steps are necessary to create the configuration for Virtual Copilot

      1. Create Geofences: It is the only part of the configuration which varies  between  customers but it can be done automatically either via Pegasus Gateway or via  Syrus 4G’s User Interface
      2. Use a configuration template which commands will be described in further detail below
      3. Configure the device via User Interface

      Create geofences: there are two Options:

      Create Geofences From User Interface (Recommended for Few Geofences or for corrections)
      From Pegasus (Recommended for massive groups of Geofences – Up to 3000)

      Configuration Template: Follow this link to download a virtual Copilot configuration template. It contains everything needed to run Virtual Copilot in your Syrus 4G

      Next we will explain briefly the contents of the configuration template:

      “Speed limits” and “Inside Geofence” Signals:

      Speed signals will change their state to true when speed is above the selected number.Note also that Geofences Signals are created with the collection’s name. This is very useful when you have thousands of Geofences grouped in only 3 or 4 collections. After this we can relate speak actions to those signals So when the driver enters to a delimited zone, a voice in the speaker advice it and also warns if the speed limit inside the geofence is violated

      `# Speed Signals

      define signal speedZone30 min_duration=1s $gnss.kph > 30

      # Geofence Signals
      define signal speed_limit_30_event $geofences.$groups.speed_limit_30.inside

      # ACTIONS TO SPEAK GEOFENCE ENTERING
      define action speakAction30 trigger=speed_limit_30_event speak lang=es ‘Entering 30 kilometers per hour zone’
      define action speakActionOver30 trigger=speed_limit_30_event,speedZone30,and speak lang=es ‘Decrease speed.. 30 kilometers per hour zone’`

      Configuring iButton

      It detects if an iButton is authorized or not and sets an output ON or OFF  with Ignition cut off purposes. Last, creates actions to speak when an iButton is detected by the iButton reader. Note double brackets {{$ibutton.authorized.last.alias}} variable: Speaker will tell Driver’s name when a recognized iButton is entered. For this example the Speaker will say: “Welcome John Smith…”
      add ibutton John_Smith 16000015B0415A01
      ##SIGNALS
      # authorized driver
      define signal auth_ibutton $ibutton.connected.whitelisted == true
      # unauthorized driver
      define signal unauth_ibutton $ibutton.connected.whitelisted == false
      ##ACTIONS
      # action to deactivate output2 if driver authorized define action auth_driver_deactivate_out trigger=auth_ibutton set out2 off

      # action to activate output2 if driver is unauthorized
      define action unauth_activate_out trigger=unauth_ibutton set out2 on
      #ACTIONS TO SPEAK IBUTTON IDENTIFICATION
      define action speakActionIbutton trigger=auth_ibutton speak lang=en ‘Welcome {{$ibutton.authorized.last.alias}} DCT wishes you a good trip’
      define action speakActionNoIbutton trigger=unauth_ibutton speak lang=en ‘You are not an authorized driver. Please contact your administrator’`

      Also if it is needed to upload or update several iButton IDs remotely, follow this guide: Creating an iButton list inside Syrus4

      Optional: Configuring Harsh Acceleration, Braking and Harsh Curves Reports

      This part of the configuration uses Syrus 4G’s fixed accelerometer signals to generate Action speaker alerts when Harsh cornering, Hard braking, or hard accelerations are detected.

      First let’s add accelerometer parameters. The following example lines were created accordig the weight and features of a Chevrolet Tahoe. Then simply define events with fixed signal names regarding acceleration

      `#######  ###### ####### ######  #######
      ############ START ACCELEROMETER ###########
      #### SAMPLE SIGNALS FOR CHEVROLET TAHOE ####
      set accelerometer CFG_FORWARD_COLLISION -2000
      set accelerometer CFG_BACKWARD_COLLISION 2000
      set accelerometer CFG_LAT_COLLISION_FROM_RIGHT -2000
      set accelerometer CFG_LAT_COLLISION_FROM_LEFT 2000
      set accelerometer CFG_HARSH_FWD_ACCELERATION 240
      set accelerometer CFG_HARD_BRAKING -300
      set accelerometer CFG_CORNERING_RIGHT -300
      set accelerometer CFG_CORNERING_LEFT 300
      #ACCELEROMETER SIGNALS & EVENTS
      define event brakingEvent group=tracking  fieldset=default ack=seq code=44 label=braking trigger=@accelerometer.hard_braking.signal
      define event cornering_left group=tracking fieldset=default ack=seq code=47 label=crnrleft trigger=@accelerometer.cornering_left.signal
      define event cornering_right group=tracking fieldset=default ack=seq code=46 label=crnrright trigger=@accelerometer.cornering_right.signal`

      Configuring Other Voice Messages for Bluetooth Speaker

      Actions to send audio messages through Bluetooth Speaker when Ignition changes its state.

      `#ACTIONS TO SPEAK IGNITION CHANGE STATE

      define action speakActionIgnOn trigger=ignon speak lang=es ‘Ignición Encendida, DCT le desea buen viaje’
      define action speakActionIgnOFF trigger=ignoff speak lang=es ‘El motor ha sido apagado. Bienvenido a su destino’`

      Configure the device:

      From the User Interface → Application Manager, click on virtual_copilot instance we created above

      Go to “Data Folder” tab and upload the following file:

      tutorial.configuration.syrus.conf

      Go to the “configuration” tab. If you followed Geofences creation walkthrough above the box “Geofence Namespace  will be filled:

      Select Configuration file as shown in image below and click “SAVE” button:

      Finally go to “Information” tab and click on “Start”

Viewing 0 reply threads
  • You must be logged in to reply to this topic.