R-Car/Connected Car SDK startup guide

From eLinux.org
< R-Car
Revision as of 16:32, 17 July 2019 by YK (talk | contribs)
Jump to: navigation, search

Included contents info


References


Create a partition on a micro SD-card

Recommended environment for Creating an Image

  • Tested OS: Ubuntu 14.04LTS, 16.04LTS
  • 8GB/Class10 SD-card at least.
  • tar version: 1.28 at least

For example, if the micro SD-card is /dev/sdg:
Type the commands where you got “Command(m for help):” as below.

$ sudo fdisk /dev/sdg
 Welcome to fdisk (util-linux 2.27.1).
 Changes will remain in memory only, until you decide to write them.
 Be careful before using the write command.
 Command (m for help): o
 Created a new DOS disklabel with disk identifier 0x96e5850d.
 Command (m for help): n
 Partition type
 p primary (0 primary, 0 extended, 4 free)
 e extended (container for logical partitions)
 Select (default p):
 Using default response p.
 Partition number (1-4, default 1):
 First sector (2048-31291391, default 2048):
 Last sector, +sectors or +size{K,M,G,T,P} (2048-31291391, default 31291391):
 Created a new partition 1 of type 'Linux' and of size 14,9 GiB.
 Command (m for help): w
 The partition table has been altered.
 Calling ioctl() to

Format the micro SD-card

Initialize the ext4 partition using “mke2fs”; for example, if the micro SD-card is associated with /dev/sdg1:
Confirm whether the command is success or not. If you get “done” like following, the command is successful.

$ sudo mke2fs -t ext4 /dev/sdg1
 --snip--
 Allocating group tables: done                            
 Writing inode tables: done                             
 Creating journal (32768 blocks): done
 Writing superblocks and filesystem accounting information: done

Extract Edge controller in Connected SDK

export directory path of micro SD-card

$ SDCARD=<define your sd card directory>

mount your SD to your rootfs

$ mount /dev/sdg1 $SDCARD

remove all data in SDCARD

$ sudo rm -rf ${SDCARD:-bad_dir}/*

extract all data in SDCARD

$ sudo gunzip xxx.tar.gz
$ tar -xvf xxx.tar

Root have:

$ /v2c-edge-1.50/
  /vehicle-information-service-spec /
  /node_module/


Write IPL to Target

Please download the IPL:
File:IPL for h3ulcb.zip
File:IPL for m3ulcb.zip

See below to write IPL.
https://elinux.org/R-Car/Boards/H3SK#Flashing_firmware
https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware

Setting U-boot parameters

  1. Insert the micro SD-card to the target board. And Boot up.
  2. Stop auto boot hitting any key.
  3. set u-boot environment variable.
  • For h3ulcb
=> setenv bootargs 'console=ttySC0,115200 root=/dev/mmcblk0p1 rootwait rw rootfstype=ext4'
=> setenv bootargs 'console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw rootfstype=ext4'
=> setenv bootcmd 'run load_ker; run load_dtb; booti 0x48080000 - 0x48000000'
=> setenv load_ker 'ext4load mmc 0:1 0x48080000 /boot/Image'
=> setenv load_dtb 'ext4load mmc 0:1 0x48000000 /boot/Image-r8a7796-m3ulcb.dtb'
=> setenv ethaddr xx:xx:xx:xx:xx:xx
=> saveenv
=> run bootcmd
  • For m3ulcb
=> setenv bootargs 'console=ttySC0,115200 root=/dev/mmcblk0p1 rootwait rw rootfstype=ext4'
=> setenv bootargs 'console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw rootfstype=ext4'
=> setenv bootcmd 'run load_ker; run load_dtb; booti 0x48080000 - 0x48000000'
=> setenv load_ker 'ext4load mmc 0:1 0x48080000 /boot/Image'
=> setenv load_dtb 'ext4load mmc 0:1 0x48000000 /boot/Image-r8a7796-m3ulcb.dtb'
=> setenv ethaddr xx:xx:xx:xx:xx:xx
=> saveenv
=> run bootcmd

Vehicle information (Simulator)

  • Simulator setting

Download and install to your PC.
(Evaluation period is 1 month for trial)
Run the unity program "SDK.exe"


  • Simulator connection to R-Car Starter Kit

Target board:R-Car Starter Kit Premier/Pro (aka. h3ulcb/m3ulcb)
Peripheral interface : Ethernet


  • Vehicle format

Refer to Excel format for detailed vehicle data(json_format.xlsx). Following data is sample.

$ {
   "Ver":"001",
   "Timestamp":1515574198504,
   "geometry":{
       "coordinates":{
           "Altitude":54.6,
           "Longitude":139.76562,
           "Latitude":35.68895}
   },
   "RunningStatus":{
       "Vehicle":{"Speed":5010},
       "Engine":{"Speed":1009},
       "SteeringWheel":{"Angle":1}
   },
   "Body":{
       "Door":{
           "FrontLeft":{"IsOpen":false}}
   }
}


  • Event signal
    • SIM add Event signals to vehicle information.

As a signal of Genivi VSS, as an extension of the Private node or less, it was set as below Private.V2C.Events.Event1 ... 5 Defined in json_format.xlsx

  • Command sequence


Node installation

Download the node.js programs and extract to root folder
Refer to: https://nodejs.org/ja/download/

After extracted, command “npm install” at

   /v2c-edge-1.50/
   /vehicle-information-service-spec/


Network setting

  • Set the IP address and default gateway for (WiFi) router and R-Car.

For R-Car side, /sbin/ifconfig eth0 [IP address: ex:192.168.10.8] netmask 255.255.255.0 /sbin/ip route add default via [gateway address: ex: 192.168.10.1] dev eth0

  • Edge controller setting

Edge controller configuration is as below.

- v2c-edge-1.50/public/static/edge_config.js

 * EDGE_IP: Edge IP address (ex: 192.168.0.8)
 * USER_ID: User name (please ask to Renesas)

- v2c-edge-1.45/public/static/js/config.js

 * userId1:  User name (please ask to Renesas)
 * edgeIP: Edge IP address (ex: 192.168.0.8)
 * useYardPond: When changing from the metric method to the yard method: “true”, If no: “false”
 * useFahrenheit: When changing from Celsius to Fahrenheit: “true”, If no: “false”


Sample script files

$ sleep 10
/sbin/ifconfig eth0 [IP address: ex:192.168.10.8] netmask 255.255.255.0
/sbin/ip route add default via [gateway address: ex: 192.168.10.1] dev eth0

date -s 20190XXXX

cd /v2c-edge-1.50;
node index.js &
cd /vehicle-information-service-spec;
node visSvr.js &
sleep 10
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

chromium --no-sandbox --kiosk http://localhost:8088/cluster/#/

Vehicle Server

How to subscribe

  • Connect to Vehicle (HTTP) server

Connect to the VIS server by WebSocket then connect to the following URL: IP address is the same as Edge controller. ws://XXXX:8087 (XXXX: IP address)

  • Subscribe request

When receiving data from the Vehicle server server continuously, the Subscribe request is sent in JSON of the following format to the created WebSocket connection.

{
action: "subscribe",
path: "Signal.Vehicle.Speed",
filters: "",
requestId: "reqid-facb08d1-076c-47ed-8e2e-5a9d794eb494"
}

Set each item as follows.

  • action
    • When subscribing, specify "subscribe".
  • path
    • Specify the data path to subscribe. The path name specified here specifies the Genivi VSS path described in the JSON format specification.
  • requestId
    • A unique string for each request is generated and set as a UUID or random number so that each request can be identified. There are no particular restrictions on the format or length.

Receiving Reply Message to Subscribe Request As soon as the Subscribe request is accepted, a JSON response message will be returned

{
action: "subscribe",
requestId: "reqid-facb08d1-076c-47ed-8e2e-5a9d794eb494",
subscriptionId: "subid-16583f3a2be272",
timestamp: "1535517106878"
}

The requestId is the specified ID when sending the request. The subscriptionId is an ID determined by the Vehicle Server server to identify this Subscribe. The subscribed data will come with this subscriptionId.

Receive subscribed data For the data path registered with Subscribe, as soon as the latest value arrives at the Vehicle Server, the value is delivered to the client in the following format:

{
action: "subscription",
subscriptionId: "subid-16583f3a2be272",
value: 0,
timestamp: 1535517561503
}

The value contains the latest value. In this example, the speed is acquired as 0 m / s. Able to stop Subscribe by using the Unsubscribe command.


KEY BINDING LIST

1	Fine-Rainy-Snow DAY
2	Day-Night
3	City-Oval
4	
5	
6	
A	AirBag (ON-OFF)
B	
C	
D	DRIVE mode
E	
F	Fine day (2nd)
G	
H	Temperature Down
I	
J	
K	
L	Light (High beam-Low beam)
M	
N	
O	Door (Open-Lock)
P	Parking
Q	RESET
R	REAR mode
S	
T	Trunk (Open-Close)
U	
V	
W	Wiper (non-fast)
X	Move right for Info display
Y	
Z	Move left for Info display
↑	ACCEL
→	RIGHT
←	LEFT
↓	BRAKE