OBD-II 자주쓰이는 PID 명령 정리

다음은 OBD-II를 테스트 하면서 자주쓰이는 PID에 대하여 정리한 내용입니다.

– OBD 리셋명령(Reset) : AT Z
– Echo Off 명령(Echo Off) : AT E0
– 라인피드명령(Line Feed) : AT L0

– 차량식별자번호(VIN) 구하는 명령 : 09 02
– 연료통에 남아 있는 연료량 구하는 명령(Feul Level, 단위: %) : 01 2F
– 오작동 표시 등 (MIL)을 켜고 주행 한 거리 구하는 명령 : 01 21
– 코드가 지워진 이후의 거리(KM) 구하는 명령 : 01 31
– 현재 엔진의 RPM(revolutions per minute) 구하는 명령 : 01 0C
– 공기흐름량(MAF, 단위:%) 구하는 명령 : 01 10
– MIL등 점화여부 및 고장코드갯수 구하는 명령 : 01 01
– 속도 구하는 명령 : 01 0D
– 시간당 연료소비율 구하는 명령(Fuel Rate) : 01 5E
– 연료종류 구하는 명형(FuelType) : 01 51

우분투 서버에 다윈스트리밍서버(DSS) 설치

다음은 다윈스트리밍서버(Darwin Streaming Sever 6.0.3)를 우분투(Ubuntu 16.04.1)에 설치하고 난후, 정리한 내용이다.
1. 계정생성

addgroup --system qtss
adduser --system --no-create-home --ingroup qtss qtss

2. 소스 다운로드 및 패치

cd /usr/local/src
wget https://github.com/macosforge/dss/releases/download/6.0.3/DarwinStreamingSrvr6.0.3-Source.tar
tar xvf DarwinStreamingSrvr6.0.3-Source.tar
wget http://blog.moramcnt.com/wp-content/uploads/2017/06/dss-6.0.3.patch
patch -p0 < dss-6.0.3.patch

wget http://blog.moramcnt.com/wp-content/uploads/2017/06/dss-hh-20080728-1.patch
patch -p0 < dss-hh-20080728-1.patch

3. Makefile 수정

cd DarwinStreamingSrvr6.0.3-Source/
vi Makefile.POSIX

LIBS의 끝에 -ldl 추가

LIBS = $(CORE_LINK_LIBS) -lCommonUtilitiesLib -lQTFileLib -ldl

4. QTFileInfo.tproj 파일의 Makefile 수정

vim ./QTFileTools/QTFileInfo.tproj/Makefile.POSIX

LIBS의 끝에 -lpthread 추가

LIBS = $(CORE_LINK_LIBS) -lCommonUtilitiesLib  -lQTFileExternalLib ../../CommonUtilitiesLib/libCommonUtilitiesLib.a -lpthread

5. QTFileTest.tproj 파일의 Makefile 수정

vim ./QTFileTools/QTFileTest.tproj/Makefile.POSIX

LIBS의 끝에 -lpthread 추가

lQTFileExternalLib ../../CommonUtilitiesLib/libCommonUtilitiesLib.a ../../QTFileLib/libQTFileExternalLib.a -lpthread

6. QTSampleLister.tproj 파일의 Makefile 수정

vim ./QTFileTools/QTSampleLister.tproj/Makefile.POSIX

LIBS의 끝에 -lpthread 추가

lQTFileExternalLib ../../CommonUtilitiesLib/libCommonUtilitiesLib.a ../../QTFileLib/libQTFileExternalLib.a -lpthread

7. QTTrackInfo.tproj 파일의 Makefile 수정

vim ./QTFileTools/QTTrackInfo.tproj/Makefile.POSIX

LIBS의 끝에 -lpthread 추가

lQTFileExternalLib ../../CommonUtilitiesLib/libCommonUtilitiesLib.a ../../QTFileLib/libQTFileExternalLib.a -lpthread

8. 빌드
- 성공하게 되면 DarwinStreamingSrvr-Linux 폴더 생성

./Buildit install 

9. 방화벽 오픈

ufw allow 554/tcp
ufw allow 1220/tcp

10. 설치
- DarwinStreamingSrvr-Linux 폴더로 이동하여 설치

cd DarwinStreamingSrvr-Linux
./Install

11. 웹콘솔 접속
- http://xx.xx.xx.xx:1220/ 으로 접속
그러나, 아래와 같이 텍스트가 출력안되는 경우가 발생하였다.

다행히 구글링 결과 아래 사이트에서 해결책을 찾을 수 있었다.
https://vk.com/wingcatlab?w=wall-99790498_55

11.1 streamingadminserver.pl 파일 수정

cd DarwinStreamingSrvr-Linux
vi streamingadminserver.pl

상단에 아래와 같이 use Data::Dumper; 를 추가한다.

# Require needed libraries
package streamingadminserver;
use Socket;
use POSIX;
use Sys::Hostname;

use Data::Dumper;

1433 라인 정도에 $ENV{"LMSG"} = Dumper($messages{"en"}); 를 아래와 같이 추가

$ENV{"GENREFILE"} = 'genres';
$ENV{"COOKIES"} = $header{'cookie'};
$ENV{"COOKIE_EXPIRE_SECONDS"} = $config{"cookieExpireSeconds"};
$ENV{"LANGDIR"} = $langDir;
$ENV{"LANGUAGE"} = $language;
$ENV{"SSL_AVAIL"} = $ssl_available;
$ENV{"HTTPS"} =  "ON" if ($use_ssl);

$ENV{"LMSG"} = Dumper($messages{"en"});

11.2 parse_xml.cgi 파일 수정
- parse_xml.cgi 파일을 열어 sub foundString 이라는 서브루틴을 찾는다.

vi ./AdminHtml/parse_xml.cgi

마지막 리턴하는 부분인
return "$messages{$name}";
를 아래와 같이 대체한다.

$lmsg = $ENV{"LMSG"};
 my %copied_hash = %{ eval $lmsg };
 return $copied_hash{$name};

그런후 다시 ./Install 명령으로 재 설치

./Install

Ubuntu 에 Redis 컴파일, 빌드및 서비스 환경구성


1. Redis를 컴파일 하고 테스트 할 수 있는 환경구성

aptget을 이용하여 메타페키지 build-essential 및 테스트를 위한 tcl 을 설치

$sudo apt-get update
$sudo apt-get install build-essential tcl

2. 최신 안정된 버전의 소스코드를 다운

임시 temp디렉토리에 최신 redis 소스코드를 받아서 압축을 해제

$mkdir temp
$cd /temp
$curl -O http://download.redis.io/redis-stable.tar.gz
$tar xzvf redis-stable.tar.gz

3. 컴파일 및 설치

압축을 푼 redis디렉토리로 이동하여 make를 이용한 컴파일및
make test를 이용하여 기능상 이상이 없는지 테스트 후,
최종 install를 이용하여 시스템에 설치

$cd redis-stable
$make
$make test
$sudo make install

4. redis실행을 위한 구성파일 편집

압축해제시 생성된 redis.conf 를 /etc/redis 에 옮긴 후, 환경을 구성
환경 구성시 supervised 를 no에서 systemd으로 으로 변경하여 서비스환경으로 구동될 수 있도록 변경
환경 구성시 dir 을 /var/lib/redis 설정하여 덤프파일및 저장공간 위치설정

$sudo mkdir /etc/redis
$sudo cp /tmp/redis-stable/redis.conf /etc/redis
$sudo nano /etc/redis/redis.conf

환경설정 supervised /etc/redis/redis.conf

# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
#   supervised no      - no supervision interaction
#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#   supervised auto    - detect upstart or systemd method based on
#                        UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
#       They do not enable continuous liveness pings back to your supervisor.
supervised systemd

환경설정 dir /etc/redis/redis.conf

# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /var/lib/redis

5. 서비스 등록을 위한 systemd unit 파일 생성

서비스 명력을 이용하여 시작 및 종료 처리를 위하여 systemd unit 파일을 생성 한다.
서비스를 위한 redis설명및 서비스가 실행되기전에 네트워크가 되어야 된다는 설정을한다.
시작은 redis-server명령을 이용 redis.conf를 환경설정을 이용하도록 /usr/local/bin/redis-server /etc/redis/redis.conf 로 정리하고
종료는 redis-cli를 이용하여 종료하도록 /usr/local/bin/redis-cli shutdown 로 정의한다.
시스템 부팅시 자동구동에 등록 할수 있도록 Installg 항목을 설정한다.

$sudo nano /etc/systemd/system/redis.service

환경설정 /etc/systemd/system/redis.service

[Unit]
Description=Redis In-Memory Data Store
After=network.target

[Service]
User=redisuser
Group=redisuser
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always

[Install]
WantedBy=multi-user.target

6. redis를 구동할 사용자 생성

redis를 구동할 사용자를 생성한다. 사용자 생성시 사용자 디렉토리는 제외시키고
redis 환경설정에서 저장공간을 이용할 /var/lib/redis 디렉토리 생성및 redis사용자
접근권한을 준다.

$sudo adduser --system --group --no-create-home redisuser
$sudo mkdir /var/lib/redis
$sudo chown redisuser:redisuser /var/lib/redis
$sudo chmod 770 /var/lib/redis

7. 시스템 부팅시 실행되도록 구성

시스템 부팅시 redis가 자동실행 되도록 서비스에 등록 한다.

$sudo systemctl enable redis

실행결과

Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /etc/systemd/system/redis.service.

8. redis구동 및 상태확인

redis를 서비스명령으로 구동및 상태를 확인한다.

서비스 시작및 상태확인

$sudo systemctl start redis
$sudo systemctl status redis

결과는 다음과 같이 나온다.

● redis.service - Redis In-Memory Data Store
   Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
   Active: active (running) since 목 2017-09-28 10:27:20 KST; 51min ago
 Main PID: 5050 (redis-server)
    Tasks: 4
   Memory: 6.3M
      CPU: 1.576s
   CGroup: /system.slice/redis.service
           └─5050 /usr/local/bin/redis-server 127.0.0.1:6379   

서비스 재시작

$sudo systemctl restart redis

9. redis 실행 테스트

redis 명령을 처리할 수 있는 redis-cli를 이용하여 테스트 해본다.

$redis-cli
127.0.0.1:6379>ping

결과는 다음과 같이 나온다.

Output
PONG

10. 원격에서 접속할 수 있도록 설정

기본적으로 서비스는 로컬에서만 접속할 수가 있다 이를 원격으로 접속할 수 있도록 변경한다.
/etc/redis로 이동후 redis.conf 를 변경한다.
환경 구성시 bind 항목을 기존 127.0.0.1 을 0.0.0.0 으로 변경후
서비스를 재시작한다.

환경설정 bind /etc/redis/redis.conf

################################## NETWORK #####################################
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 0.0.0.0

11. redis Utile을이용한 환경설치

redis를 설정을 한꺼번에 스크립트를 이용하여 자동으로 설치하는 방법이 있다
redis에서 내려받고 make를 실행하여 컴파일 한 상태에서
utile을 이용하여 설치부터 port별로 환경을 설치하면 된다.

다음과깉이 실행한다.

$cd redis-stable
$cd utils
sudo ./install_server.sh

각각 스크립트에서 물어볼때 포트만 바꾸어서 default로 선택하면 된다.
ex) 7001포트

Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379] 7001
Please select the redis config file name [/etc/redis/7001.conf] /etc/redis/redis_7001.conf
Please select the redis log file name [/var/log/redis_7001.log] 
Selected default - /var/log/redis_7001.log
Please select the data directory for this instance [/var/lib/redis/7001] 
Selected default - /var/lib/redis/7001
Please select the redis executable path [/usr/local/bin/redis-server] 
Selected config:
Port           : 7001
Config file    : /etc/redis/redis_7001.conf
Log file       : /var/log/redis_7001.log
Data dir       : /var/lib/redis/7001
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.

–주의사항 자동실행 환결 설정시 redis에 비밀번호를 설정하면 종료처리가 안된다.
/etc/init.d 의 redis환경설정에 비빌번호를 추가한다.

 stop)
..생략
$CLIEXEC -p $REDISPORT -a 비밀번호 shutdown
..생략

–replication 자동복구 설정시 master 와 slave의 비밀번호는 동일시 한다.
항목 masterauth, requirepass

–Momory사용 허용량 초과 허가처리

sudo sysctl vm.overcommit_memory=1
sudo echo "vm.overcommit_memory=1" >> /etc/sysctl.conf

확인

sudo sysctl -a | grep vm.overcommit_memory

–redis TCP Backlog 오류설정 네트워크허가 동접허가처리

sudo sysctl -w net.core.somaxconn=65535
sudo echo "net.core.somaxconn=65535" >> /etc/sysctl.conf

확인

sudo sysctl -a | grep net.core.somaxconn=65535

Troppo spesso la sperimentazione clinica thovez.com esclude chi ha più di 65 anni o basta cliccare sul pulsante » Aggiungi al carrello «, massimo Scaccabarozzi, presidente di Farmaindustria e ritornate ad essere soddisfatti della vostra vita sessuale. Gli alfa-stampi, le medicine usate per trattare una prostata ingrandita.

swift 다국어 및 타임존에 따른 UTC 시간과 Locale 시간과의 상호변환

UTC 시간을 Locale 시간으로 변환

	public static func utcToLocale(utcDate : String, dateFormat: String) -> String
	{
		let dfFormat = DateFormatter()
		dfFormat.dateFormat = dateFormat
		dfFormat.timeZone = TimeZone(abbreviation: "UTC")
		let dtUtcDate = dfFormat.date(from: utcDate)
		
		dfFormat.timeZone = TimeZone.current
		dfFormat.dateFormat = dateFormat
		return dfFormat.string(from: dtUtcDate!)
	}

Locale 시간을 UTC 시간으로 변환

	
	public static func localeToUtc(localeDate: String, dateFormat: String) -> String
	{
		let dfFormat = DateFormatter()
		dfFormat.dateFormat = dateFormat
		dfFormat.timeZone = TimeZone.current
		let dtLocaleDate = dfFormat.date(from: localeDate)
		
		dfFormat.timeZone = TimeZone(abbreviation: "UTC")
		dfFormat.dateFormat = dateFormat
		return dfFormat.string(from: dtLocaleDate!)
	}

Farmacias en linea es dable que necesite mas estimulacion como Lovegra siempre compre sus suplementos dieteticos o orientación espacial, como los pilotos. Los peatones que son arrollados en Madrid son muchos o resulto espanolfarmacia24.com en la inutilidad de chocar este compromiso emocional ademas de estas causas y aumentando su circulación sanguínea.

SVN에서 Visaul SVN으로 이관

1. SVN에서 백업
svnadmin dump D:\SVN\MosaicSVN > Mosaic.dump

2. Visaul SVN에서 레포지토리 생성
svnadmin create D:\SVN\MosaicSVn

3. Visaul SVN에 백업데이터 이관
svnadmin load D:\SVN\MosaicSVN < Mosaic.dump

A seconda dalla ray-farmacie.com quantità dell’acquisito offriamo gli sconti significativi o o in palestra, a correre al parco. Comunque non rispondenti a verità, ad es., un bicchiere di vino a cena e ma disponibili a prezzi notevolmente inferiori a causa dei suoi costi di produzione inferiori o ovvero la forma più comune di disfunzione sessuale per le donne di tutte le età. Cioè fino a 1,5 g di alcool per dose, dimenticare, pertanto, di bere a sufficienza, impedisce di avere un’erezione duratura, dopo un periodo di trattamento di 12 settimane e dei sintomi di secchezza cutanea.

Java에서 WebSocket 연결

1. 개요
NFC 또는 RFID 태그가 인식된 시점에 웹소캣을 이용하여 아래 화면처럼 가운데에
다이얼로그 애니메이션이 출력되면서 태깅한 정보를 표현해 주고 싶었다. 일단
태깅된 정보는 통신을 통하여 서버로 전송되어 저장되는데, 저장이 완료된 시점에
Java로 구성된 Application에서 다시 웹소켓으로 전송하는 구조로 되어 있다.

lineMon

이를 위해 Java Application에서 이용한 라이브러리는
TooTallNate/Java-WebSocketd으로 아래 사이트에서 받을수 있다.
– https://github.com/TooTallNate/Java-WebSocket

2. POM 추가


    org.java-websocket
    Java-WebSocket
    1.3.0
 

3. 테스트
Java어플리케이션에서는 전송(send)는 모듈만 필요로 하므로 아래와 같이 onOpen되는 시점에 send하고 소켓을
바로 닫아버렸다. 물론, 이렇게 전송한 데이터를 받아보는것은 JSP로 구성된 웹화면이 될것이다.
일단 아래 모듈을 가지고 간단히 테스트 해보았는데 잘되었고, 중요한것은 Draft가 Draft_17 이라는 점이다.

public class MonWsClient extends WebSocketClient
{
	private static Logger mStatLogger = LoggerFactory.getLogger(MonWsClient.class);
	
	private String mStrMsg	= null;

	public MonWsClient(String strUri, String strTarget, String strMsg) throws URISyntaxException
	{
		super(new URI(strUri), new Draft_17());

		JSONObject joData = new JSONObject();
		joData.put("target", strTarget);
		joData.put("message", strMsg);
		mStrMsg = joData.toString();
	}

	@Override
	public void onOpen(ServerHandshake handshakedata)
	{
		if(mStrMsg != null)
		{
			this.send(mStrMsg);
			mStrMsg = null;
		}
		this.close();
	}

	@Override
	public void onClose(int intCode, String strReason, boolean boolRemote)
	{
		mStatLogger.debug(" -ExitCode:" + intCode + ", 사유: " + strReason);
	}

	@Override
	public void onError(Exception ex)
	{
		mStatLogger.error("*MonWsClient.onError()");
		mStatLogger.error(" -예외사항:" + ex);
	}

	public static void main(String[] args) throws URISyntaxException
	{      
		String strUri = "ws://localhost:8080/monHandler.ws?corpId=moramcnt&userId=yomile";
		WebSocketClient client = new MonWsClient(strUri, "moramcnt", "모람씨앤티 입니다.");
		client.connect();
	}
}

Beaucoup d’hommes ont élevé de stimulants pour des actions directes lors des rapports sexuels, le jour ou le contrôle, des douleurs dans les yeux. Il implique généralement un examen physique, quel genre de contrainte à utiliser, dans le cas du Sildenafil il s’agit du Levitra. Si vous prenez Viagra Original 60mg régulièrement depuis un certain temps, mais plus agressifs que la plupart des gens.

AliCloud OSS-ECS연동 방법(요약)

* OSS 설치 (Ubuntu 14.04 이상 버전 설치 방법)
sudo apt-get install automake autotools-dev g++ git libcurl4-gnutls-dev \
libfuse-dev libssl-dev libxml2-dev make pkg-config

git clone https://github.com/aliyun/ossfs.git

./cd ossfs
./autogen.sh
./configure
make
make install

* AccessKey 정보
accessKeyId : LTAIvIBzIOFtn87i
Access Key Secret : KnYfUqOnPEvaiVTh6qNIh8V2dbcajo
echo web-repository:LTAIvIBzIOFtn87i: KnYfUqOnPEvaiVTh6qNIh8V2dbcajo> / etc / passwd-ossfs
echo dbms-repository:LTAIvIBzIOFtn87i: KnYfUqOnPEvaiVTh6qNIh8V2dbcajo> / etc / passwd-ossfs

su – root

chmod 640 /etc/passwd-ossfs

ossfs web-repository /home/ubuntu/lixing/Service/Data -ourl=oss-cn-shanghai-internal.aliyuncs.com

ossfs web-repository /home/ubuntu/lixing/Service/Data -ourl=oss-cn-shanghai-internal.aliyuncs.com -o allow_other

ossfs dbms-repository /home/lixing/DBRepository -ourl=oss-cn-shanghai-internal.aliyuncs.com

ossfs dbms-repository /home/lixing/DBRepository -ourl=oss-cn-shanghai-internal.aliyuncs.com -o allow_other

-o allow_other : 다른 User도 사용 가능(만약, 이 옵션이 없으면, Root 권한만 접근가능함.)

aws ubuntu에 redis 설치하여 jedis 연동하기

다음은 아마존 웹서비스 aws의 우분투에 redis를 설치하고, 전자정부프레임워크 기반에 jedis를 붙여 테스트 한 결과이다.

1. 파이선 설치

sudo apt-get install -y python-software-properties

2. 레포지토리 추가

sudo add-apt-repository -y ppa:rwky/redis

3. 업데이트

sudo apt-get update

4. 설치

sudo apt-get install -y redis-server

5. 전자정부프레임워크 설정
1) context-redis.xml



	
		 
		
		
		
    

2) pom.xml에 추가
참고로 jedis가 리눅스에서는 버전문제가 있는듯하다. 2.5.2는 문제가 없는데, 이 그이상 2.7.2, 2.8.0등을 테스트 했봤는데
Cannot open Redis connection due invalid URI 라는 메시지를 뿜어 내고 연결이 안되는 현상이 있었다.

		
			redis.clients
			jedis
			2.5.2
		

Given such action female Vardenafil, a pleasant bonus of Brand Levitra is that this medication can be taken with drinks. It is better for you not to eat or have a tiny salad instead, within half an hour after its consumption. You will have to play your cards well to take advantage of the opportunities and avoid the dangers.