Jump to: navigation, search

Carwings protocol


Carwings is the telematics system installed in the Leaf. It has four endpoints, apparently:

  1. The cellular modem in your car
  2. The data center, operated by Airbiquity
  3. The web-based Carwings interface
  4. An XML-RPC-like proxy used by the iOS and Android applications

Mobile app proxy

The mobile app proxy is located at https://nissan-na-smartphone-biz.viaaq.com and allows iOS and Android apps to interact with your car's telematics.

There are at least two endpoints

User Service

Located at https://nissan-na-smartphone-biz.viaaq.com/aqPortal/smartphoneProxy/userService

This is used during initial sign-in, as well as later to retrieve vehicle status. When logging in, the application POSTs the following:

<?xml version="1.0"?>
<ns2:SmartphoneLoginWithAdditionalOperationRequest 
  xmlns:ns4="urn:com:hitachi:gdc:type:report:v1" xmlns:ns7="urn:com:airbiquity:smartphone.vehicleservice:v1"   
  xmlns:ns3="http://www.nissanusa.com/owners/schemas/api/0" xmlns:ns5="urn:com:airbiquity:smartphone.reportservice:v1"
  xmlns:ns2="urn:com:airbiquity:smartphone.userservices:v1" xmlns:ns6="urn:com:hitachi:gdc:type:vehicle:v1">
  <SmartphoneLoginInfo>
    <UserLoginInfo>
      <userId>YOUR_CARWINGS_USERNAME</userId>
      <userPassword>YOUR_CARWINGS_PASSWORD</userPassword>
    </UserLoginInfo>
    <DeviceToken>DUMMY1313820504.22296500</DeviceToken>
    <UUID>YOUR_DEVICE_UNIQUE_ID</UUID>
    <Locale>US</Locale>
    <AppVersion>1.40</AppVersion>
    <SmartphoneType>IPHONE</SmartphoneType>
  </SmartphoneLoginInfo>
  <SmartphoneOperationType>SmartphoneGetPreferencesRequest</SmartphoneOperationType>
  <SmartphoneOperationType>SmartphoneLatestBatteryStatusRequest</SmartphoneOperationType>
  <SmartphoneOperationType>SmartphoneLatestACStatusRequest</SmartphoneOperationType>
  <SmartphoneOperationType>SmartphoneGetScheduledACRemoteRequest</SmartphoneOperationType>
</ns2:SmartphoneLoginWithAdditionalOperationRequest>

If the user is authenticated, the system will return two cookies (a JSESSIONID, and a BIGipServernissan-na-smartphone-biz-POOL). These cookies are submitted for each subsequent request to the server.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:SmartphoneLoginWithAdditionalOperationResponse 
  xmlns:ns4="urn:com:airbiquity:smartphone.reportservice:v1"  xmlns:ns7="urn:com:airbiquity:smartphone.common:v1" 
  xmlns:ns3="urn:com:hitachi:gdc:type:report:v1" xmlns:ns5="urn:com:hitachi:gdc:type:vehicle:v1" 
  xmlns:ns2="urn:com:airbiquity:smartphone.userservices:v1" xmlns:ns6="urn:com:airbiquity:smartphone.vehicleservice:v1">
    <SmartphoneUserInfoType>
        <VehicleInfo>
            <Vin>*REDACTED*VEHICLE_VIN_VALUE</Vin>
        </VehicleInfo>
        <Nickname>leaf</Nickname>
    </SmartphoneUserInfoType>
    <ns4:SmartphoneLatestBatteryStatusResponse>
        <SmartphoneBatteryStatusResponseType>
            <ns3:BatteryStatusRecords>
                <ns3:OperationResult>START</ns3:OperationResult>
                <ns3:OperationDateAndTime>2011-08-20T04:20:59.0</ns3:OperationDateAndTime>
                <ns3:BatteryStatus>
                    <ns3:BatteryChargingStatus>NORMAL_CHARGING</ns3:BatteryChargingStatus>
                    <ns3:BatteryCapacity>12</ns3:BatteryCapacity>
                    <ns3:BatteryRemainingAmount>8</ns3:BatteryRemainingAmount>
                </ns3:BatteryStatus>
                <ns3:PluginState>CONNECTED</ns3:PluginState>
                <ns3:CruisingRangeAcOn>90624</ns3:CruisingRangeAcOn>
                <ns3:CruisingRangeAcOff>104448</ns3:CruisingRangeAcOff>
                <ns3:TimeRequiredToFull>
                    <ns3:HourRequiredToFull>6</ns3:HourRequiredToFull>
                    <ns3:MinutesRequiredToFull>0</ns3:MinutesRequiredToFull>
                </ns3:TimeRequiredToFull>
                <ns3:NotificationDateAndTime>2011-08-20T04:21:15.0</ns3:NotificationDateAndTime>
            </ns3:BatteryStatusRecords>
            <VehicleInfo>
                <Vin>*REDACTED*VEHICLE_VIN_VALUE</Vin>
            </VehicleInfo>
            <lastBatteryStatusCheckExecutionTime>2011-08-20T04:20:59.000Z</lastBatteryStatusCheckExecutionTime>
        </SmartphoneBatteryStatusResponseType>
    </ns4:SmartphoneLatestBatteryStatusResponse>
    <ns4:SmartphoneLatestACStatusResponse>
        <SmartphoneACStatusResponseType>
            <ns3:RemoteACRecords>
                <ns3:OperationResult>FINISH</ns3:OperationResult>
                <ns3:OperationDateAndTime>2011-08-18T16:45:32.0</ns3:OperationDateAndTime>
                <ns3:RemoteACOperation>START</ns3:RemoteACOperation>
                <ns3:ACStartStopDateAndTime>2011-08-18T16:45:32.0</ns3:ACStartStopDateAndTime>
                <ns3:CruisingRangeAcOn>139608</ns3:CruisingRangeAcOn>
                <ns3:CruisingRangeAcOff>166200</ns3:CruisingRangeAcOff>
                <ns3:ACStartStopURL></ns3:ACStartStopURL>
                <ns3:PluginState>NOT_CONNECTED</ns3:PluginState>
                <ns3:ACDurationBatterySec>7200</ns3:ACDurationBatterySec>
                <ns3:ACDurationPluggedSec>900</ns3:ACDurationPluggedSec>
            </ns3:RemoteACRecords>
            <VehicleInfo>
                <Vin>*REDACTED*VEHICLE_VIN_VALUE</Vin>
            </VehicleInfo>
        </SmartphoneACStatusResponseType>
    </ns4:SmartphoneLatestACStatusResponse>
    <ns2:SmartphoneGetPreferencesResponse>
        <NotificationPreferencesType>
            <vin>*REDACTED*VEHICLE_VIN_VALUE</vin>
            <chargeStatusApple>false</chargeStatusApple>
            <chargeStatusEmail>false</chargeStatusEmail>
            <chargeStatusSms>false</chargeStatusSms>
            <plugInReminderApple>false</plugInReminderApple>
            <plugInReminderEmail>false</plugInReminderEmail>
            <plugInReminderSms>false</plugInReminderSms>
            <chargeCompleteApple>false</chargeCompleteApple>
            <chargeCompleteEmail>false</chargeCompleteEmail>
            <chargeCompleteSms>false</chargeCompleteSms>
            <hvacOnApple>false</hvacOnApple>
            <hvacOnEmail>false</hvacOnEmail>
            <hvacOnSms>false</hvacOnSms>
            <vehicleChargeApple>false</vehicleChargeApple>
            <vehicleChargeEmail>false</vehicleChargeEmail>
            <vehicleChargeSms>false</vehicleChargeSms>
        </NotificationPreferencesType>
    </ns2:SmartphoneGetPreferencesResponse>
    <ns6:SmartphoneRemoteGetScheduledACResponse>
        <SmartphoneRemoteGetScheduledACResponseType>
            <ns5:GetScheduledACRemoteResponse/>
            <VehicleInfo>
                <Vin>*REDACTED*VEHICLE_VIN_VALUE</Vin>
            </VehicleInfo>
        </SmartphoneRemoteGetScheduledACResponseType>
    </ns6:SmartphoneRemoteGetScheduledACResponse>
</ns2:SmartphoneLoginWithAdditionalOperationResponse>

Some notes on the above:

  • BatteryStatus
    • BatteryChargingStatus is showing a car plugged into a trickle charger
    • BatteryRemainingAmount is the number of SOC bars
  • CruisingRangeAcOn and ..AcOff
    • This value is in meters
  • All times are in UTC

Vehicle Service

Located at https://nissan-na-smartphone-biz.viaaq.com/aqPortal/smartphoneProxy/vehicleService